⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smbmusicapmainplayerplaydrawer.cpp

📁 symbian
💻 CPP
📖 第 1 页 / 共 4 页
字号:
	iPlayTimeDelay = aTime % 1000;		// 梋傝偼嵞惗忣曬僷僱儖峏怴梡僞僀儅偺Delay偵巊梡偡傞
	iPlayTimeDelay = 1000 - iPlayTimeDelay;
	if (ESmbMusicAPMainPlayerPlayDispNone != iDispStatus && ESmbMusicAPMainPlayerPlayDispIdle != iDispStatus)
		{
		if (iTrackInfo->MusicTime() < iPlayTime && 0 != iTrackInfo->MusicTime())
			{
			iPlayTime = iTrackInfo->MusicTime();
			}
		}
	iPlayPanel->SetPlayTime(iPlayTime);
	iVzNormal->SetPlayTime(iPlayTime);
	if (EFalse != aUpdate)
		{
		iPlayPanel->HandleControlStatusUpdatedL();
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayDrawer::SetPlayTimeL Draw Start %d");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt1, iPlayTime);
#endif
//		HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));
		}
	}
	
/**
 * 嵞惗宱夁帪娫傪捠抦偡傞丅
 * @return 嵞惗宱夁帪娫乮昩乯
 */
TInt CSmbMusicAPMainPlayerPlayDrawer::PlayTime()
	{
	return iPlayTime;
	}
	
/**
 * 嵞昤夋張棟
 * @param[in] aRect 嵞昤夋斖埻
 */
void CSmbMusicAPMainPlayerPlayDrawer::Draw(const TRect /*aRect*/)
	{
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayDrawer::Draw Start Interval=%d");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt1, iDrawInterval);
#endif
	if (ESmbMusicAPMainPlayerPlayDispNone != iDispStatus)
		{
		// Music僐儞僥僫僋儔僗傪嵞昤夋偡傞丅
// Add 2007.04.19 SkonMusic Invalidate懳墳
		// Music僐儞僥僫僋儔僗傪嵞昤夋偡傞丅
		iMusicControl->DrawToOffscreen(iSkonGc, TPoint(KSmbMusicAPMainPlayerPlayDispPointX, KSmbMusicAPMainPlayerPlayDispPointX), 
		                               TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));
// Add End 2007.04.19 SkonMusic Invalidate懳墳
		
		// 僆僼僗僋儕乕儞傪僂傿儞僪僂偵昤夋
//		if (EFalse != IsDrawable())
			{
			CWindowGc& gc = SystemGc();
			gc.BitBlt(TPoint(0, 0), iScreen);
			}
		// Add 2006.10.02
// del 2006.10.18  TRK:11704
//		if (EFalse == iKeyGuidanceDrawed)
//			{
//			RedrawKeyGuidance();
//			}
		// Add End 2006.10.02
		}
#ifdef __SMBMUSICAP_PERFORMANCE_DEF__
_LIT(KLogFmt2, "CSmbMusicAPMainPlayerPlayDrawer::Draw End");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt2);
#endif
	}
	
/**
 * 嵞惗夋柺傪昤夋偡傞丅
 * @param[in] aInit 弶婜夋柺昞帵乮ETrue:價僕儏傾儔僀僓乕夋柺昞帵乯
 * @param[in] aTimer 僞僀儅乕婲摦乮ETrue:婲摦乯
 * @param[in] aFailSong ETrue:嵞惗晄壜嬋僗僉僢僾拞		TRK497 懳墳
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayPictureL(TBool aInit, TBool aTimer, TBool aFailSong/*=EFalse*/)
	{
	if (EFalse != aInit)
		{
		// 價僕儏傾儔僀僓乕夋柺昞帵偵愗懼偊傞丅
//		iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternNormal);
		}

	if (EFalse != IsDrawable())
		{
		// 昤夋壜擻偱偁傟偽丄價僕儏傾儔僀僓乕傪奐巒偡傞丅
		RestartVisualizerL();
		}

	// Vss昤夋
	DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoPlay);
	
	// 嵞惗忣曬僷僱儖昤夋
	DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoPlay);

	if (EFalse != aTimer)
		{
		// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪婲摦偡傞丅
		StartRedrawTimerL();
		}

	iDispStatus = ESmbMusicAPMainPlayerPlayDispPlaying;

////////// 昤夋惈擻懳墳  2007.08.08
	HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

	// 僉乕僈僀僟儞僗昤夋
// Change 2007.04.04 PTX824 TRK:497 懳墳
//	iCurKeyGuidance = iPlayKeyGuidance;
	if (EFalse == aFailSong)
		{
		iCurKeyGuidance = iPlayKeyGuidance;
		}
	else
		{
		iCurKeyGuidance = iFailSongKeyGuidance;
		}
	iFailSong = aFailSong;
// Change End 2007.04.04 PTX824 TRK:497 懳墳
	RedrawKeyGuidance();
	}
	
/**
 * 嵞惗夋柺傪昤夋偡傞丅乮價僕儏傾儔僀僓乕偺嵞昤夋側偟乯
 * @param[in] aInit 弶婜夋柺昞帵乮ETrue:價僕儏傾儔僀僓乕夋柺昞帵乯
 * @param[in] aTimer 僞僀儅乕婲摦乮ETrue:婲摦乯
 * @param[in] aFailSong ETrue:嵞惗晄壜嬋僗僉僢僾拞		TRK497 懳墳
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayPictureNoVssL(TBool aInit, TBool aTimer, TBool aFailSong/*=EFalse*/)
	{
	if (EFalse != aInit)
		{
		// 價僕儏傾儔僀僓乕夋柺昞帵偵愗懼偊傞丅
//		iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternNormal);
		}

	// 嵞惗忣曬僷僱儖昤夋
	DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoPlay);

	if (EFalse != aTimer)
		{
		// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪婲摦偡傞丅
		StartRedrawTimerL();
		}

	iDispStatus = ESmbMusicAPMainPlayerPlayDispPlaying;

////////// 昤夋惈擻懳墳  2007.08.08
	HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

	// 僉乕僈僀僟儞僗昤夋
// Change 2007.04.04 PTX824 TRK:497 懳墳
//	iCurKeyGuidance = iPlayKeyGuidance;
	if (EFalse == aFailSong)
		{
		iCurKeyGuidance = iPlayKeyGuidance;
		}
	else
		{
		iCurKeyGuidance = iFailSongKeyGuidance;
		}
	iFailSong = aFailSong;
// Change End 2007.04.04 PTX824 TRK:497 懳墳
	RedrawKeyGuidance();
	}
	
/**
 * 掆巭夋柺傪昤夋偡傞丅
 * @param[in] aInit 弶婜夋柺昞帵乮ETrue:價僕儏傾儔僀僓乕夋柺昞帵乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawStopPictureL(TBool aInit)
	{
	if (EFalse != aInit)
		{
		// 價僕儏傾儔僀僓乕夋柺昞帵偵愗懼偊傞丅
//		iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternNormal);
		}
	// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪掆巭偡傞丅
	StopRedrawTimer();
	// 嵞惗忣曬僷僱儖昤夋
	DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoPause);
	// Vss昤夋
	DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoStop);

	// 價僕儏傾儔僀僓乕傪掆巭偡傞丅
	StopVisualizer();

////////// 昤夋惈擻懳墳  2007.08.08
	HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

	iDispStatus = ESmbMusicAPMainPlayerPlayDispStop;
	// 僉乕僈僀僟儞僗昤夋
	iCurKeyGuidance = iPauseKeyGuidance;
	RedrawKeyGuidance();
// Add 2007.04.04 PTX824 TRK:497 懳墳
	iFailSong = EFalse;
// Add End 2007.04.04 PTX824 TRK:497 懳墳
	}

/**
 * 枹張棟夋柺傪昤夋偡傞丅
 * @param[in] aDecide 寛掕僉乕昞帵乮ETrue丗昞帵丄EFalse丗旕昞帵乯
 * @param[in] aPlay 嵞惗忬懺乮ETrue丗嵞惗丄EFalse丗掆巭乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawIdlePictureL(TBool aDecide, TBool aPlay)
	{
	// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪掆巭偡傞丅
	StopRedrawTimer();
	// 嵞惗忣曬僷僱儖昤夋
	iTrackInfo->SetMusicTitleL( _L("") );
	iTrackInfo->SetAlbumNameL( _L("") );
	iTrackInfo->SetArtistNameL( _L("") );
	iTrackInfo->SetTrackNo(-1);
	iTrackInfo->SetMusicTime(KSmbMusicAPMainPlayerPlayIdleTimeValue);
	iTrackInfo->SetJacketIcon(NULL);
	iListInfo->SetTotalTrackNo(0);
	iPlayPanel->SetPlayTime(KSmbMusicAPMainPlayerPlayIdleTimeValue);
	iVzNormal->SetImage(NULL);			// 2006.09.28  TRK:9883
		
	if (EFalse == aPlay)
		{
		DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoPause);
		DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoStop);	// 2006.10.19  TRK:11836
		}
	else
		{
		DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoPlay);
		}

//	RedrawVssPicture();
	// 價僕儏傾儔僀僓乕傪掆巭偡傞丅
// PTX824懳墳
// Change 2007.03.28
//	iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternNormal);
// 2007.08.18
//	ReleaseJacketPictureL(ETrue);
// Change End 2007.03.28
	StopVisualizer();
		
	iDispStatus = ESmbMusicAPMainPlayerPlayDispIdle;

////////// 昤夋惈擻懳墳  2007.08.08
	HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

	// 僉乕僈僀僟儞僗昤夋
	iNoneKeyGuidance->MakeVisibleKey(ESkonKeyGuidanceSelectKey, aDecide);
	iCurKeyGuidance = iNoneKeyGuidance;
	RedrawKeyGuidance();
	iNoneKeyGuidance->MakeVisibleKey(ESkonKeyGuidanceSelectKey, aDecide);
// Add 2007.04.04 PTX824 TRK:497 懳墳
	iFailSong = EFalse;
// Add End 2007.04.04 PTX824 TRK:497 懳墳
	}

/**
 * 憗憲傝夋柺傪昤夋偡傞丅
 * @param[in] aTimer 僞僀儅乕婲摦乮ETrue:婲摦乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayFFPictureL(TBool aTimer)
	{
	if (EFalse != IsDrawable())
		{
		// Vss昤夋
		DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoForward);
		// 嵞惗忣曬僷僱儖昤夋
		DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoForward);
		// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪婲摦偡傞丅
		if (EFalse != aTimer)
			{
			StartRedrawTimerL();
			}

		iDispStatus = ESmbMusicAPMainPlayerPlayDispPlayFF;

////////// 昤夋惈擻懳墳  2007.08.08
		HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

		// 僉乕僈僀僟儞僗昤夋
		iCurKeyGuidance = iFFKeyGuidance;
		RedrawKeyGuidance();
		}
	}

/**
 * 憗栠偟夋柺傪昤夋偡傞丅
 * @param[in] aTimer 僞僀儅乕婲摦乮ETrue:婲摦乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawPlayFRPictureL(TBool aTimer)
	{
	if (EFalse != IsDrawable())
		{
		// Vss昤夋
		DrawPlayVssPictureL(CSkonVisualizer::EPlayInfoPreview);
		// 嵞惗忣曬僷僱儖昤夋
		DrawPlayInfoPanelL(CSkonMusicPlayInfoPanel::EPlayInfoRewind);
		// 嵞惗忣曬僷僱儖峏怴梡僞僀儅乕傪婲摦偡傞丅
		if (EFalse != aTimer)
			{
			StartRedrawTimerL();
			}

		iDispStatus = ESmbMusicAPMainPlayerPlayDispPlayFR;

////////// 昤夋惈擻懳墳  2007.08.08
		HandleSkonControlRedrawEvent(static_cast<CSkonControl*>(iMusicControl), TRect(TPoint(0, 0), iMusicControl->Size().AsPoint()));

		// 僉乕僈僀僟儞僗昤夋
		iCurKeyGuidance = iFFKeyGuidance;
		RedrawKeyGuidance();
		}
	}

/**
 * 僶乕僠儍儖僗儁乕僗僗僋儕乕儞偺昞帵傪愗懼偊傞丅
 */
void CSmbMusicAPMainPlayerPlayDrawer::ChangeVirtualSpaceL()
	{
	CSkonVisualizer::TVisualizerPattern pattern = iVzNormal->VisualizerPattern();
	if (CSkonVisualizer::EPatternNormal == pattern)
		{
		if (ESmbMusicAPMainPlayerPlayDispPlaying == iDispStatus)
			{
			// 嵞惗夋柺偺応崌偼丄價僕儏傾儔僀僓乕傪掆巭偡傞丅
			StopVisualizer();
			}
		// 尰嵼昞帵偑價僕儏傾儔僀僓乕偺応崌丄僕儍働僢僩夋憸偵愗懼偊傞丅
		iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternImage);
		}
	else
		{
		// 尰嵼昞帵偑僕儍働僢僩夋憸偺応崌丄價僕儏傾儔僀僓乕偵愗懼偊傞丅
		iVzNormal->SetVisualizerPattern(CSkonVisualizer::EPatternNormal);
		if (ESmbMusicAPMainPlayerPlayDispPlaying == iDispStatus)
			{
			// 嵞惗夋柺偺応崌偼丄價僕儏傾儔僀僓乕傪奐巒偡傞丅
			RestartVisualizerL();
			
			}
		}
	iPlayPanel->HandleControlStatusUpdatedL();
	iVzNormal->HandleControlStatusUpdatedL();
	}

/**
 * 壒検愝掕僷僱儖傪昤夋偡傞丅
 * @param[in] aVolume ETrue:憹壛乮+1乯丄EFalse:尭彮乮-1乯
 * @param[in] aMute   Mute忬懺乮ETrue:ON丄EFalse:OFF乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::DrawVolumePanelL(TBool aVolume, TBool aMute)
	{
	// 尰嵼壒検抣傪庢摼
	TInt volume = iVolumePanel->Level();
	TInt prevolume = volume;

	if (EFalse != aVolume)
		{
		// 憹壛巜掕乮+1乯偺応崌
		if (volume == KSmbMusicAPMainPlayerPlayVolumeMax ||
		    (ESmbPGMusicAPAVLSSettingOn == iAvls && volume >= iAvlsValue) )
			{
			// 尰嵼抣偑忋尷抣丄枖偼AVLS偑ON偱AVLS儕儈僢僩抣埲忋偺応崌偼憹壛偟側偄丅
			}
		else
			{
			volume++;
			}
		}
	else
		{
		// 尭彮巜掕乮-1乯偺応崌
		if (0 < volume)
			{
			volume--;
			}
		}
	
	if (volume != prevolume)
		{
		// 壒検抣偑曄峏偝傟偨応崌偼壒検愝掕僷僱儖丄愝掕忣曬偺壒検抣傪曄峏偡傞丅
		iVolumePanel->SetLevel(volume);
		iSettingInfo->SetVolume(volume);
		iPlayPanel->HandleControlStatusUpdatedL();
		}

	// 壒検愝掕僷僱儖傪昞帵偡傞丅
	iVolumePanel->SetSpeakerMuting(aMute);
	iVolumePanel->ShowL();
	iShowVolumePanel = ETrue;
	
	if (volume != prevolume)
		{
		// 壒検抣偑曄壔偟偨応崌偼捠抦偡傞丅
		iObserver->ChangedVolumeLevel(volume);
		}
	}

/**
 * 嵞惗夋柺峏怴偺僞僀儅乕傪奐巒偡傞丅乮1昩娫妘乯
 */
void CSmbMusicAPMainPlayerPlayDrawer::StartRedrawTimerL()
	{
	StopRedrawTimer();
	
//_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayDrawer::StartRedrawTimerL");
//SmbMusicAPMainPlayerUtility::OutputLog(iLog, 220016, ELogLevelNormal, KLogFmt1);

	iPeriodic = CPeriodic::NewL(EActivePriorityIpcEventsHigh /*EPriorityHigh*/);	// 2006.09.28  TRK:9957
	iPeriodic->Start(
			TTimeIntervalMicroSeconds32(iPlayTimeDelay * 1000),	// delay(Max1昩)
			TTimeIntervalMicroSeconds32(1 * 1000 * 1000), 		// interval = 1昩
			TCallBack(CallBackRedrawTimerL, this) );
	iPlayTimeDelay = 1 * 1000;
	}

#ifdef __DRAW_CHANGE_CPU_SPEED_
void CSmbMusicAPMainPlayerPlayDrawer::CallCpuSpeed()
	{
	iAfEnv.ChangeCpuSpeed(iChangeCpuSpeed);
	}
#endif

/**
 * 僞僀儉傾僢僾帪偺僐乕儖僶僢僋張棟
 *   嵞惗忣曬僷僱儖傪峏怴偡傞丅
 * @param[in] aAny 僐乕儖僶僢僋僋儔僗
 * @return KErrNone:惓忢廔椆
 */
TInt CSmbMusicAPMainPlayerPlayDrawer::CallBackRedrawTimerL(TAny* aAny)
	{
	CSmbMusicAPMainPlayerPlayDrawer* self = static_cast<CSmbMusicAPMainPlayerPlayDrawer*>(aAny);

#ifdef __DRAW_CHANGE_CPU_SPEED_
	self->CallCpuSpeed();
	
//	self->iAfEnv.BasisPartFuncInterface().ChangeCpuSpeed(self->iChangeCpuSpeed);

	if (self->iChangeCpuSpeed != EFalse)
		{
		self->iChangeCpuSpeed = EFalse;
		}
	else
		{
		self->iChangeCpuSpeed = ETrue;
		}
#endif	// __DRAW_CHANGE_CPU_SPEED_

	if (ESmbMusicAPMainPlayerPlayDispStop == self->iDispStatus ||
	    ESmbMusicAPMainPlayerPlayDispIdle == self->iDispStatus
	   )
		{
		self->StopRedrawTimer();
		return KErrNone;
		}

	// 嬋偺嵞惗帪娫傪庢摼偡傞丅
	TInt ptime = self->iTrackInfo->MusicTime();
	
	if (ESmbMusicAPMainPlayerPlayDispPlayFR == self->iDispStatus)
		{
		// 憗栠偟夋柺偺応崌偼攞懍抣傪尭嶼偡傞丅
		self->iObserver->UpdateFRPicture();
		}
	else

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -