📄 smbmusicapmainplayerplaydrawer.cpp
字号:
{
if (ESmbMusicAPMainPlayerPlayDispPlayFF == self->iDispStatus)
{
// 憗憲傝夋柺偺応崌偼攞懍抣傪壛嶼偡傞丅
self->iObserver->UpdateFFPicture();
}
else
{
self->iPlayTime++;
if (self->iPlayTime > ptime && ptime) // TRK:8704 2006.09.13
{
// 嵞惗宱夁帪娫偑嵞惗帪娫傪挻夁偟偨偲偒偺張棟
self->iPlayTime = ptime;
}
}
}
// 嵞惗忣曬僷僱儖偺嵞惗宱夁帪娫傪峏怴偡傞丅
// Change 2007.08.08
// self->iPlayPanel->SetPlayTime(self->iPlayTime);
// self->iVzNormal->SetPlayTime(self->iPlayTime);
// self->iPlayPanel->HandleControlStatusUpdatedL();
// 2007.05.23丂昩偺峏怴偑偲傑傞偺偱偨傔偟偵擖傟偰傒傞
// self->iMusicControl->DrawToOffscreen(self->iSkonGc, TPoint(KSmbMusicAPMainPlayerPlayDispPointX, KSmbMusicAPMainPlayerPlayDispPointX),
// TRect(TPoint(0, 0), self->iMusicControl->Size().AsPoint()));
// ADD 2007/08/31 SEMC 媑壀
// 嬋帪娫僇僂儞僞偺昤夋傪巭傔傞僼儔僌偑棫偭偰傞偐偳偆偐偺敾掕傪捛壛
if(self->IsRedrawTimer() != EFalse && self->iIsSongTimerTmpStop == EFalse)
{
self->SetPlayTimeL(self->iPlayTime * 1000, ETrue);
}
// Change End 2007.08.08
if (EFalse == self->iBacklight ||
(EFalse == self->iAfEnv.IsForeground() &&
!(SmbPGMenu::MainMenuStateL(self->iPropAgent) == ESmbPGMainMenuOpenDialog &&
PGPropAgentLaServer::TopAppL(self->iPropAgent) == KSmbMusicAPMainPlayerUid
)
)
)
{
// LCD僶僢僋儔僀僩OFF帪偼僞僀儅乕傪掆巭偡傞丅
self->StopRedrawTimer();
}
return KErrNone;
}
/**
* 嵞惗夋柺峏怴偺僞僀儅乕傪廔椆偡傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::StopRedrawTimer()
{
//_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayDrawer::StopRedrawTimer");
//SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt1);
delete iPeriodic;
iPeriodic = NULL;
}
/**
* 嵞惗夋柺峏怴偺僞僀儅乕忬懺傪捠抦偡傞丅
* @retval ETrue 僞僀儅乕婲摦拞
* @retval EFalse 僞僀儅乕掆巭拞
*/
TBool CSmbMusicAPMainPlayerPlayDrawer::IsRedrawTimer()
{
return ((NULL != iPeriodic) ? ETrue : EFalse);
}
/**
* 價僕儏傾儔僀僓傪掆巭偝偣傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::StopVisualizer()
{
if (EFalse != iVzNormal->IsRunningEffect())
{
// 價僕儏傾儔僀僓乕偺僄僼僃僋僩偑桳岠偺応崌丄埲壓偺張棟傪峴偆丅
// 嵞惗夋柺偺応崌偼丄價僕儏傾儔僀僓乕傪掆巭偡傞丅
iVzNormal->CancelEffect();
}
// Vss昤夋
DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoStop); // 2006.10.23
// 價僕儏傾儔僀僓乕掆巭傪捠抦偡傞丅
iObserver->StopedVisualizer();
}
/**
* 價僕儏傾儔僀僓傪嵞奐偝偣傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::RestartVisualizerL()
{
if (CSkonVisualizer::EPatternNormal == iVzNormal->VisualizerPattern())
{
if (EFalse == iVzNormal->IsRunningEffect())
{
// 價僕儏傾儔僀僓乕偺僄僼僃僋僩偑柍岠偺応崌丄埲壓偺張棟傪峴偆丅
// 嵞惗夋柺偺応崌偼丄價僕儏傾儔僀僓乕傪奐巒偡傞丅
iVzNormal->StartEffectL();
}
// 價僕儏傾儔僀僓乕奐巒傪捠抦偡傞丅
DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoPlay); // 2006.10.23
iObserver->StartedVisualizer();
}
}
/**
* 僶乕僠儍儖僗儁乕僗僗僋儕乕儞傪夋柺偵昤夋偡傞丅
* @param aPlayInfo 嵞惗忬懺
*/
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayVssPictureL(CSkonVisualizer::TPlayInfo aPlayInfo)
{
// 嵞惗忬懺傪價僕儏傾儔僀僓乕偵僙僢僩偡傞丅
iVzNormal->SetPlayInfo(aPlayInfo);
iVzNormal->HandleControlStatusUpdatedL();
// iMusicControl->DrawToOffscreen(iSkonGc, TPoint(KSmbMusicAPMainPlayerPlayDispPointX, KSmbMusicAPMainPlayerPlayDispPointX),
// TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));
}
/**
* 嵞惗忣曬僷僱儖傪夋柺偵昤夋偡傞丅
* @param aPlayInfo 嵞惗忬懺
*/
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::TPlayInfo aPlayInfo)
{
// 嵞惗忬懺傪嵞惗忣曬僷僱儖偵僙僢僩偡傞丅
iPlayPanel->SetPlayInfo(aPlayInfo);
iPlayPanel->HandleControlStatusUpdatedL();
// // 旕昞帵忬懺偺応崌偼嵞惗忣曬僷僱儖傪昞帵偡傞丅
// if (ESmbMusicAPMainPlayerPlayDispNone == iDispStatus)
// {
// iPlayPanel->ShowL(EFalse);
// }
}
/**
* 昤夋壜擻忬懺傪僙僢僩偡傞丅
* @param[in] aDrawable
*/
void CSmbMusicAPMainPlayerPlayDrawer::SetDrawable(TBool aDrawable)
{
iDrawable = aDrawable;
}
/**
* 夋柺昞帵忬懺傪捠抦偡傞丅
* @return 夋柺昞帵忬懺
*/
TSmbMusicAPMainPlayerPlayDisp CSmbMusicAPMainPlayerPlayDrawer::DispStatus()
{
return iDispStatus;
}
/**
* 嵞惗忣曬僷僱儖傪捠抦偡傞丅
* @return 嵞惗忣曬僷僱儖偺傾僪儗僗
*/
CSkonMusicPlayInfoPanel* CSmbMusicAPMainPlayerPlayDrawer::PlayInfoPanel()
{
return iPlayPanel;
}
/**
* 昤夋壜擻偐傪捠抦偡傞丅
* @retval ETrue 昤夋壜擻
* @retval EFalse 昤夋晄壜
*/
TBool CSmbMusicAPMainPlayerPlayDrawer::IsDrawable()
{
return (EFalse != iDrawable && EFalse != iBacklight);
}
/**
* LCD僶僢僋儔僀僩忬懺傪愝掕偡傞丅
* @param[in] aBacklight LCD僶僢僋儔僀僩忬懺乮ETrue丗揰摂丄EFalse丗徚摂乯
*/
void CSmbMusicAPMainPlayerPlayDrawer::SetBacklight(TBool aBacklight)
{
iBacklight = aBacklight;
}
//ADD-S 2006.12.22 TRK:12643 (PTX824 TRK:771)
// 師婡庬懳墳
/**
* 僼僅乕僇僗忬懺傪愝掕偡傞
* @param[in] aFocus 僼僅乕僇僗忬懺
*/
void CSmbMusicAPMainPlayerPlayDrawer::SetFocus(TBool aFocus)
{
iFocus = aFocus;
}
/**
* 僼僅乕僇僗忬懺傪庢摼偡傞
* @return 僼僅乕僇僗忬懺
*/
TBool CSmbMusicAPMainPlayerPlayDrawer::IsFocused()
{
return iFocus;
}
//ADD-E 2006.12.22 TRK:12643 (PTX824 TRK:771)
// Add 2007.04.23
/**
* 婡擻僉乕忬懺傪愗傝懼偊傞
*
* @param[in] aState ETrue:婡擻僉乕桳岠丄EFalse:婡擻僉乕柍岠
*/
void CSmbMusicAPMainPlayerPlayDrawer::ChangeFuncKeyState(TBool aState)
{
iEnableFuncKey = aState;
}
/**
* 婡擻僉乕忬懺傪捠抦偡傞
*
* @retval ETrue 婡擻僉乕桳岠
* @retval EFalse 婡擻僉乕柍岠
*/
TBool CSmbMusicAPMainPlayerPlayDrawer::IsFuncKeyState()
{
return iEnableFuncKey;
}
// Add End 2007.04.23
/**
* 嵞惗忣曬僷僱儖偺嬋僞僀僩儖偺僗僋儘乕儖昞帵傪奐巒偡傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::StartScrollL()
{
iPlayPanel->SetMarqueeDelay(KSmbMusicAPMainPlayerPlayMarqueeDelay); // 2昩Delay
iPlayPanel->ScrollMarqueeL(CSkonMusicPlayInfoPanel::EScroll);
}
/**
* 栴報昞帵忣曬捠抦(MArrowStateProvider偺幚憰)
* @return 栴報忣曬
*/
TInt CSmbMusicAPMainPlayerPlayDrawer::CurrentArrowState() const
{
// Change 2007.04.04 PTX824 TRK:497 懳墳
// if (ESmbMusicAPMainPlayerPlayDispPlaying == iDispStatus
// || ESmbMusicAPMainPlayerPlayDispStop == iDispStatus)
if ((ESmbMusicAPMainPlayerPlayDispPlaying == iDispStatus && EFalse == iFailSong)
|| ESmbMusicAPMainPlayerPlayDispStop == iDispStatus)
// Change 2007.04.04 PTX824 TRK:497 懳墳
{
// 嵞惗夋柺丄掆巭夋柺偺応崌偼丄忋丄壓丄嵍丄塃僉乕傪桳岠偵偡傞丅
return (ESkonKeyGuidanceArrowUp|ESkonKeyGuidanceArrowDown|ESkonKeyGuidanceArrowLeft|ESkonKeyGuidanceArrowRight);
}
else if (ESmbMusicAPMainPlayerPlayDispIdle == iDispStatus)
{
// 嬻夋柺偺応崌偼丄忋丄壓僉乕傪桳岠偵偡傞丅
return (ESkonKeyGuidanceArrowUp|ESkonKeyGuidanceArrowDown);
}
else
{
// 偦偺懠偺応崌偼丄桳岠僉乕側偟
return NULL;
}
}
/**
* MSakOffscreen僋儔僗偺Invalidate儊僜僢僪偺幚憰
* 嵞昤夋梫媮
* @param[in] aRect 嵞昤夋椞堟
*/
void CSmbMusicAPMainPlayerPlayDrawer::Invalidate(const TRect& /*aRect*/)
{
// 僂傿儞僪僂昤夋奐巒梫媮
Window().Invalidate(Rect());
}
/**
* 壒検愝掕僷僱儖傪徚嫀偡傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::HideVolumePanelL()
{
iVolumePanel->HideL();
iShowVolumePanel = EFalse;
}
/**
* 僶乕僠儍儖僗儁乕僗僗僋儕乕儞傪嵞昤夋偡傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::RedrawVssPicture()
{
if (EFalse != iVzNormal->IsRunningEffect() && ESmbMusicAPMainPlayerPlayDispPlaying == iDispStatus)
{
iLevelCount++;
if (KSmbMusicAPMainPlayerLevelCount <= iLevelCount)
{
iLevelCount = 0;
// 價僕儏傾儔僀僓乕偺僄僼僃僋僩偑桳岠偺応崌
TInt left, right;
iObserver->RedrawVisualizer(left, right); // 壒埑儗儀儖庢摼
iVzNormal->SetSoundPressureLevel(left, right);
}
}
// Music僐儞僥僫僋儔僗傪嵞昤夋偡傞丅
iMusicControl->DrawToOffscreen(iSkonGc, TPoint(KSmbMusicAPMainPlayerPlayDispPointX, KSmbMusicAPMainPlayerPlayDispPointX),
TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));
}
/**
* 僆僼僗僋儕乕儞夋憸傪嵞昤夋偡傞丅
*/
void CSmbMusicAPMainPlayerPlayDrawer::DrawOffscreen()
{
if (EFalse != IsDrawable())
{
// 僂傿儞僪僂昤夋奐巒張棟
Window().Invalidate(iContainer.Rect());
// RedrawVssPicture();
iMusicControl->DrawToOffscreen(iSkonGc, TPoint(KSmbMusicAPMainPlayerPlayDispPointX, KSmbMusicAPMainPlayerPlayDispPointX),
TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));
// // 僂傿儞僪僂昤夋奐巒張棟
// Window().Invalidate(iContainer.Rect());
ActivateGc();
Window().BeginRedraw(iContainer.Rect());
// 僆僼僗僋儕乕儞傪僂傿儞僪僂偵昤夋
CWindowGc& gc = SystemGc();
gc.BitBlt(TPoint(0, 0), iScreen);
// 僂傿儞僪僂昤夋廔椆張棟
Window().EndRedraw();
DeactivateGc();
}
}
/**
* SkonMusic偐傜偺嵞昤夋捠抦
* @param[in] aControl 嵞昤夋捠抦偟偨SkonMusic僐儞僩儘乕儖
* @param[in] aRect 嵞昤夋斖埻
*/
void CSmbMusicAPMainPlayerPlayDrawer::HandleSkonControlRedrawEvent(CSkonControl* /*aControl*/, const TRect& /*aRect*/)
{
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayDrawer::HandleSkonControlRedrawEvent Start Interval=%d");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt1, iDrawInterval);
#endif
if (EFalse != IsDrawable())
{
if (EFalse == iKeyGuidanceDrawed)
{
RedrawKeyGuidance();
}
// 僂傿儞僪僂昤夋奐巒張棟
Window().Invalidate(iContainer.Rect());
// Music僐儞僥僫僋儔僗傪嵞昤夋偡傞丅
RedrawVssPicture();
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt2, "CSmbMusicAPMainPlayerPlayDrawer::HandleSkonControlRedrawEvent DrawToOffscreen End");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt2);
#endif
// // 僂傿儞僪僂昤夋奐巒張棟
// Window().Invalidate(iContainer.Rect());
ActivateGc();
Window().BeginRedraw(iContainer.Rect());
// 僆僼僗僋儕乕儞傪僂傿儞僪僂偵昤夋
CWindowGc& gc = SystemGc();
gc.BitBlt(TPoint(0, 0), iScreen);
// 僂傿儞僪僂昤夋廔椆張棟
Window().EndRedraw();
DeactivateGc();
}
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt2, "CSmbMusicAPMainPlayerPlayDrawer::HandleSkonControlRedrawEvent End");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt2);
#endif
}
/**
* SkonMusic偐傜偺僐儞僩儘乕儖僀儀儞僩捠抦
* @param[in] aControl 僐儞僩儘乕儖僀儀儞僩捠抦偟偨SkonMusic僐儞僩儘乕儖
* @param[in] aEventType 僀儀儞僩僞僀僾
*/
void CSmbMusicAPMainPlayerPlayDrawer::HandleSkonControlEventL(CSkonControl* aControl, TSkonControlEvent aEventType)
{
if (aControl == static_cast<CSkonControl*>(iVolumePanel))
{
// 壒検愝掕僷僱儖偐傜偺捠抦
switch (aEventType)
{
case ESkonControlEventStateChanged:
{
// 壒検曄壔捠抦
TInt vol = iVolumePanel->Level();
if (vol < ESmbMusicAPPlayerVolumeMin)
{
vol = ESmbMusicAPPlayerVolumeMin;
iVolumePanel->SetLevel(vol);
}
else if (vol > ESmbMusicAPPlayerVolumeMax)
{
vol = ESmbMusicAPPlayerVolumeMax;
iVolumePanel->SetLevel(vol);
}
if (ESmbPGMusicAPAVLSSettingOn == iAvls && vol > iAvlsValue)
{
// AVLS偑ON偱AVLS儕儈僢僩抣傪墇偊偨応崌偼丄儕儈僢僩抣偺傑傑
vol = iAvlsValue;
iVolumePanel->SetLevel(vol);
iAfEnv.DialogManager().ShowWarningModalDialogL(R_DL_MUSIC_MAIN_PLAY_AVLS_DIALOG, NULL, NULL);
RedrawKeyGuidance();
}
else
{
// 壒検抣偑曄峏偝傟偨偙偲傪捠抦偡傞丅
if (EFalse == iObserver->ChangedVolumeLevel(vol) )
{
// 壒検愝掕偵幐攕偟偨応崌偼捈慜偺壒検偵栠偡丅
vol = iVolume;
iVolumePanel->SetLevel(iVolume);
}
}
iVolume = vol;
iSettingInfo->SetVolume(iVolume);
iPlayPanel->HandleControlStatusUpdatedL();
}
break;
case ESkonControlEventRequestExit:
{
// 壒検愝掕憖嶌廔椆捠抦
iShowVolumePanel = EFalse;
// 僉乕僈僀僟儞僗傪嵞昤夋偡傞丅
RedrawKeyGuidance();
}
break;
default:
break;
}
}
}
//----------------------------------------------
//
// 嬋帪娫偺僇僂儞僩傪巭傔傞偨傔偺僼儔僌傪僙僢僩
// @return : 側偟
//
void CSmbMusicAPMainPlayerPlayDrawer::SetIsSongTimerTmpStop(TBool aFlag)
{
iIsSongTimerTmpStop = aFlag;
}
SEMCJ_NAMESPACE_END
// end of SmbMusicAPMainPlayerPlayDrawer.cpp
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -