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

📄 smbmusicapmainplayerplayview.cpp

📁 symbian
💻 CPP
📖 第 1 页 / 共 5 页
字号:
				// 僾儗僀儕僗僩傊搊榐
				SMenuRegisterPlayListL(func);
				break;
				
			case EMainPlayerPlayKGCmdDetail:
				// 徻嵶忣曬昞帵
				SMenuDisplayDetailInfoL();
				break;
				
			case EMainPlayerPlayKGCmdJacket:
				// 夋憸昞帵
				SMenuDisplayJacketL();
				break;
			
			case EMainPlayerPlayKGCmdSongWords:
				// 壧帉昞帵
				SMenuDisplaySongWordsL();
				break;
			
			case EMainPlayerPlayKGCmdDelete:
				// 1審嶍彍
				SMenuDeleteSongL();
				break;
			
			default:
				break;
			}
		}
	}//end of ShowSubMenuL()


/**
 *  僒僽儊僯儏乕偺儕僗僩崁栚偺婸搙乛敿婸搙愝掕傪峴偆丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 * @param[in] aSubMenu 僒僽儊僯儏乕
 */
void CSmbMusicAPMainPlayerPlayView::ModefySubMenuL(CSkonSubMenu& aSubMenu)
	{
	CSkonSubMenuItemArray* mlist = aSubMenu.MenuItemArrayL();
	
	if (0 == iNumJacket || EFalse != iIsUimLimited || EFalse == iIsOnline)
		{// 僕儍働僢僩夋憸枃悢偑0偺応崌丄USIM惂尷丄僆僼儔僀儞
		
		// 乽夋憸昞帵乿傪旕慖戰偵偡傞丅
		TInt index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdJacket);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		}
		
	if (0 == iNumLyric || EFalse != iIsUimLimited || EFalse == iIsOnline ||
	    TSmbMusicAPSyncEngineFileiMotionEx != iFileFormat
	   )
		{// 壧帉夋憸枃悢偑0偺応崌丄USIM惂尷丄僆僼儔僀儞丄僼儖妝嬋埲奜
		
		// 乽壧帉昞帵乿傪旕慖戰偵偡傞丅
		TInt index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdSongWords);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		}

	if (ESmbMusicAPMainPlayerPlayPlaying == iState->PlayStatus() &&
	    EFalse == iPauseState &&			// 2006.10.10  TRK:10291
	    ESmbMusicAPMainPlayerPlayListTypePlaylist != iReqPlayList.iListType
	   )
		{// 嵞惗夋柺忬懺偺応崌
		
		// 乽1審嶍彍乿傪旕慖戰偵偡傞丅
		TInt index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdDelete);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		}

	if (ESmbMusicAPMainPlayerPlayInitial == iState->PlayStatus())
		{// 嬻夋柺偺応崌
		
		// 乽儈儏乕僕僢僋愝掕乿埲奜偼旕慖戰偲偡傞丅
		TInt index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdDetail);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		
		index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdJacket);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		
		index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdSongWords);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);

		// 2006.09.11  僾儗僀儕僗僩嵞惗埲奜
		if (ESmbMusicAPMainPlayerPlayListTypePlaylist != iReqPlayList.iListType)
			{
			index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdPlayList);
			aSubMenu.SetItemDisableL(mlist, index, ETrue);
			
			index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdDelete);
			aSubMenu.SetItemDisableL(mlist, index, ETrue);
			}
		}
	
	if ((EFalse != iIsUimLimited && ESmbMusicAPSyncEngineInSD != iSDBind) ||
	     EFalse == iIsOnline
	   )
		{// UIM惂尷偱SDBind埲奜偺応崌
		
		// 徻嵶忣曬昞帵傪旕慖戰偵偡傞丅
		TInt index = aSubMenu.IndexByCommand(mlist, EMainPlayerPlayKGCmdDetail);
		aSubMenu.SetItemDisableL(mlist, index, ETrue);
		}
		
	}//end of ModefySubMenuL(CSkonSubMenu& aSubMenu)

/**
 * 僒僽儊僯儏乕乽儈儏乕僕僢僋愝掕乿張棟
 *   儈儏乕僕僢僋愝掕價儏乕傊慗堏偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 */
void CSmbMusicAPMainPlayerPlayView::SMenuMusicSettingL()
	{
	// 儈儏乕僕僢僋愝掕價儏乕傊愗懼偊傞丅
	iViewTop = EFalse;		// TRK:10795  2006.10.13
	
	DCM::TLaViewParam param;
	param.SetReturnView(*this);
	TLaViewParamBuf parambuf(param);
	
	iPlayerEnv.BasisPartFuncInterface().ChangeViewL(ESmbMusicAPMainPlayerSettingViewId,
	                                                         KSmbMusicAPMainPlayerChangeViewMsgUid, parambuf);
	}

/**
 * 僒僽儊僯儏乕乽僾儗僀儕僗僩傊搊榐乿張棟\n
 *   巕奒憌傪昞帵偟偰丄巜掕偝傟偨撪梕偱僼傿儖僞價儏乕傊慗堏偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 * @param[in] aCmd 僒僽儊僯儏乕僐儅儞僪
 */
void CSmbMusicAPMainPlayerPlayView::SMenuRegisterPlayListL(TSmbMusicAPMainPlayerPlayViewKGCommand /*aCmd*/)
	{
// Add 2007.08.29
	if (EFalse != PGPropAgentStatus::IsCaseClosedL(iAfEnv.PropAgent()) ||
	    EFalse == iPlayerEnv.IsAccessSyncEngine()
	   )
		{
		return;
		}
// Add End 2007.08.29
	// 婲摦僷儔儊乕僞嶌惉
	TSmbMusicAPMainPlayerPrmRegister param;
	param.iKind = ESmbMusicAPMainPlayerRegiterEntryKind;
	param.iListHandle = iPlayList.iListHandle;

	// 1審搊榐
	param.iType = ESmbMusicAPMainPlayerSelectionOne;
	param.iIndex = iIndex;

	param.vparam.SetReturnView(*this);
	TPckgBuf<TSmbMusicAPMainPlayerPrmRegister> parambuf(param);
	
	iViewTop = EFalse;		// TRK:10795  2006.10.13
	// 僾儗僀儕僗僩價儏乕傊愗懼偊傞丅
	iPlayerEnv.BasisPartFuncInterface().ChangeViewL(ESmbMusicAPMainPlayerPLSelectViewId,
	                                                         KSmbMusicAPMainPlayerRegisterMsgUid, parambuf);
	}

/**
 * 僒僽儊僯儏乕乽徻嵶忣曬昞帵乿張棟\n
 *   徻嵶忣曬昞帵傾僾儕傪婲摦偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 */
void CSmbMusicAPMainPlayerPlayView::SMenuDisplayDetailInfoL()
	{
	// 婲摦僷儔儊乕僞嶌惉
	TSmbMusicAPSongInfoStartParam param;
	param.SetReturnView(*this);				// TRK:4919 2006/07/25
	param.iSongID = iCmd->SongID(iPlayList);
	param.iEditSelect = EFalse;
	param.iWebToSelect = ETrue;				// TRK:4513 2006.07.28
	
	TSmbMusicAPSongInfoStartParamBuf parambuf(param);
	
	// 徻嵶忣曬昞帵傾僾儕婲摦
	iPlayerEnv.BasisPartFuncInterface().StartChildAppL(KSmbMusicAPSongInfoUid, KSmbMusicAPSongInfoDetailViewUid,
	                                                            KSmbMusicAPSongInfoStartUid, parambuf);
	}

/**
 * 僒僽儊僯儏乕乽僕儍働僢僩夋憸昞帵乿張棟\n
 *   僕儍働僢僩夋憸昞帵偺偨傔偵丄夋憸昞帵價儏乕傊慗堏偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 */
void CSmbMusicAPMainPlayerPlayView::SMenuDisplayJacketL()
	{
	iViewTop = EFalse;		// TRK:10795  2006.10.13
	
	// 婲摦僷儔儊乕僞嶌惉
	TSmbMusicAPMainPlayerPrmImageDisp param;
	param.iListHandle = iPlayList.iListHandle;
	param.iIndex = iPlayList.iIndex;
	param.kind = ESmbMusicAPMainPlayerImageKindJacket;
	param.vparam.SetReturnView(*this);
	TPckgBuf<TSmbMusicAPMainPlayerPrmImageDisp> parambuf(param);
	
	// 夋憸昞帵價儏乕傊愗懼偊傞丅
	iPlayerEnv.BasisPartFuncInterface().ChangeViewL(ESmbMusicAPMainPlayerImageViewId,
	                                                         KSmbMusicAPMainPlayerChangeViewMsgUid, parambuf);
	}

/**
 * 僒僽儊僯儏乕乽壧帉昞帵乿張棟\n
 *   壧帉昞帵偺偨傔偵丄夋憸昞帵價儏乕傊慗堏偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 */
void CSmbMusicAPMainPlayerPlayView::SMenuDisplaySongWordsL()
	{
	iViewTop = EFalse;		// TRK:10795  2006.10.13
	
	// 婲摦僷儔儊乕僞嶌惉
	TSmbMusicAPMainPlayerPrmImageDisp param;
	param.iListHandle = iPlayList.iListHandle;
	param.iIndex = iPlayList.iIndex;
	param.kind = ESmbMusicAPMainPlayerImageKindSongWords;
	param.vparam.SetReturnView(*this);
	
	TPckgBuf<TSmbMusicAPMainPlayerPrmImageDisp> parambuf(param);
	
	// 夋憸昞帵價儏乕傊愗懼偊傞丅
	iPlayerEnv.BasisPartFuncInterface().ChangeViewL(ESmbMusicAPMainPlayerImageViewId, 
	                                                         KSmbMusicAPMainPlayerChangeViewMsgUid, parambuf);
	}

/**
 * 僒僽儊僯儏乕乽1審嶍彍乿張棟\n
 *   尰嵼掆巭拞偺嬋傪嶍彍偡傞丅
 *   掆巭拞夋柺偵偼嵞惗儕僗僩偺師偺嬋傪昞帵偡傞丅
 * @param[in] aKeyFunc 僉乕僀儀儞僩張棟僋儔僗
 */
void CSmbMusicAPMainPlayerPlayView::SMenuDeleteSongL()
	{
	iProc = ESmbMusicAPMainPlayerPlayProcDelete;		// TRK:11810  2006.10.21

	iDrawer->DrawStopPictureL(EFalse);

//ADD-S 2007.4.2 [PTX824 i-keeper(TRK):384] 嶍彍梫媮拞偵嬋堦棗偵栠傜側偄傛偆偵丄僉乕梷惂傪峴偆
	// 嶍彍墳摎偑曉偭偰偔傞傑偱丄僉乕梷惂偡傞
	iRejectKeyEvent = ETrue;
//ADD-E 2007.4.2 [PTX824 i-keeper(TRK):384] 嶍彍梫媮拞偵嬋堦棗偵栠傜側偄傛偆偵丄僉乕梷惂傪峴偆

// PTX824懳墳
// Change 2007.03.16
//	iCmd->HoldApp(ESmbMusicAPPlayerProgressDialog);
	iPlayerEnv.RequestHoldApp(ESmbMusicAPPlayerProgressDialog);
// Change End 2007.03.16
	iDelete->RequestDeleteSong(iPlayList, iSongTitle, ESmbMusicAPMainPlayerDelSongStd);
	}

/**
 * 1審嶍彍姰椆捠抦
 * @param[in] aResult 張棟寢壥乮KErrNone:惉岟丄偦偺懠:幐攕乯
 */
void CSmbMusicAPMainPlayerPlayView::CompleteDeleteSongL(TInt aResult)
	{
	_LIT(KLogFmt, "CSmbMusicAPMainPlayerPlayView::CompleteDeleteSongL aResult=%d");
	SmbMusicAPMainPlayerUtility::OutputLog(iAfEnv.Log(), 203007, ELogLevelNormal, KLogFmt, aResult);

	iDrawer->DrawStopPictureL(EFalse);

	if (KErrNone == aResult)		// 2006.09.28
		{
		TInt count = iCmd->GetItemCount(iPlayList.iListHandle);

		iReqPlayList.iCount = count;

		_LIT(KLogFmt1, "CSmbMusicAPMainPlayerPlayView::CompleteDeleteSongL iCount=%d");
		SmbMusicAPMainPlayerUtility::OutputLog(iAfEnv.Log(), 203007, ELogLevelNormal, KLogFmt1, iReqPlayList.iCount);

		if (!iReqPlayList.iCount)
			{
			// 嵞惗儕僗僩偵嬋傾僀僥儉偑柍偔側偭偨応崌偺張棟
			iDrawer->DrawIdlePictureL(EFalse, EFalse);
			ChangeState(ESmbMusicAPMainPlayerPlayInitial);
			iJacketIndex   = KSmbMusicAPMainPlayerPlayDefaaultJaket;
			iSongInfoIndex = KSmbMusicAPMainPlayerPlayDefaaultJaket;
			iPlayerEnv.BasisPartFuncInterface().CancelHoldAppEx();
			iProc = ESmbMusicAPMainPlayerPlayProcNone;
			}
		else
			{
			if (ESmbMusicAPMainPlayerPlayListTypePlaylist == iReqPlayList.iListType)
				{
				// 僾儗僀儕僗僩偺応崌偼僇僂儞僩偑曄傢傜側偄偺偱-1偡傞丅
				count--;
				}
			if (count == iPlayList.iIndex)		// 2006.09.27
				{
				// 嶍彍懳徾嬋偑嵟廔嬋偺応崌
				iPlayList.iIndex = 0;
				iIndex = 0;
				}

			// 嵞惗儕僗僩傪嵞愝掕偡傞丅
			TSmbMusicAPSyncEngineItemIndex sinfo;
			sinfo.iListHandle = iPlayList.iListHandle;
			sinfo.iIndex      = iPlayList.iIndex;
			iCmd->PreparePlay(sinfo, iAllShuffle, EFalse);
			iProc = ESmbMusicAPMainPlayerPlayProcDelete;
			}
		}
	else
		{
		if (KErrCancel != aResult)
			{
			// 嶍彍幐攕帪偺張棟
			TSmbMusicAPSyncEngineItemIndex sinfo;
			sinfo.iListHandle = iPlayList.iListHandle;
			sinfo.iIndex      = iPlayList.iIndex;
			iCmd->PreparePlay(sinfo, iAllShuffle, EFalse);
			iProc = ESmbMusicAPMainPlayerPlayProcDelete;
			}
		else
			{
			// 嶍彍僉儍儞僙儖帪偺張棟
			iPlayerEnv.BasisPartFuncInterface().CancelHoldAppEx();
// Del 2007.03.09
//			iState->RedrawL(EFalse);
			iProc = ESmbMusicAPMainPlayerPlayProcNone;
			}
		}
//ADD-S 2007.4.2 [PTX824 i-keeper(TRK):384] 嶍彍墳摎張棟偑姰椆偟偨偨傔丄僉乕梷惂傪夝彍
	// 嶍彍墳摎張棟偑姰椆偟偨偨傔丄僉乕梷惂傪夝彍偡傞
	iRejectKeyEvent = EFalse;
//ADD-E 2007.4.2 [PTX824 i-keeper(TRK):384] 嶍彍墳摎張棟偑姰椆偟偨偨傔丄僉乕梷惂傪夝彍
	}

/**
 * 尰嵼摦嶌拞偺嬋忣曬宯張棟傪僉儍儞僙儖偡傞丅
 * @retval ETrue  僉儍儞僙儖偟偨
 * @retval EFalse 僉儍儞僙儖側偟
 */
TBool CSmbMusicAPMainPlayerPlayView::ProcCancelAction()
	{
	TBool ret(EFalse);
	iCmd->GetRequestKind(iProckind, iInfokind);
	if (ESmbMusicAPMainPlayerReqGetPlayTime == iProckind)
		{
		// 嵞惗帪娫庢摼拞偺応崌
		iCancelTimeGet = ETrue;
		ret = ETrue;
		}
	if (ESmbMusicAPMainPlayerReqNone != iInfokind)
		{
		iCmd->CancelAction();
		ret = ETrue;
		}
	return ret;
	}

/**
 * 嵞惗弨旛墳摎張棟
 *
 * Y: State僆僽僕僃僋僩偵張棟傪埾忳偡傞
 *
 * @param[in] aResult 張棟寢壥
 */
void CSmbMusicAPMainPlayerPlayView::RespPreparePlayL(TInt aResult)
	{
	iState->RespPreparePlayL(aResult);
	}

/**
 * 嵞惗奐巒墳摎張棟\n
 * 仸嵞惗夋柺傊偺曄峏偼捠忢嵞惗奐巒捠抦傪庴偗偨偲偒偵偡傞丅
 * @param[in] aResult 張棟寢壥
 * @param[in] aIndex 摨婜僒乕僶偐傜捠抦偝傟偨嵞惗嬋僀儞僨僢僋僗斣崋
 */
void CSmbMusicAPMainPlayerPlayView::RespPlayStartL(TInt aResult, TInt aIndex)
	{
	iState->RespPlayStartL(aResult, aIndex);
	}

/**
 * 掆巭墳摎張棟\n
 * 掆巭夋柺傊偺曄峏偼堦帪掆巭捠抦傪庴偗偨偲偒偵偡傞丅
 * @param[in] aResult 張棟寢壥
 */
void CSmbMusicAPMainPlayerPlayView::RespPlayStopL(TBool aResult)
	{
	iState->RespPlayStopL(aResult);
	}

/**
 * 憗憲傝奐巒墳摎張棟\n
 * 嵞惗夋柺偐傜憗憲傝夋柺傊慗堏偡傞丅
 * @param[in] aResult 張棟寢壥
 */
void CSmbMusicAPMainPlayerPlayView::RespStartPlayFFL(TBool aResult)
	{
	iState->RespStartPlayFFL(aResult);
	}


/**
 * LCD傪忢帪揰摂忬懺偵偡傞丅
 */
void CSmbMusicAPMainPlayerPlayView::BackLightOn()
	{
	//僉乕儔僀僩偺揰摂
	PGBackLights::TPGDataItems backLight;
	
	// P.A.偵僶僢僋儔僀僩揰摂帪娫巜掕
	backLight.iSettingFlag = PGBackLights::ELcdPW | PGBackLights::ELcdTime ;
	backLight.iLcdPW = ETrue;				// LCD僶僢僋儔僀僩揰摂巜掕
	backLight.iLcdTime = PGBackLights::ELcdPwlTimeInfinite; // LCD揰摂帪娫(柍惂尷)

	//僙僢僩
	PGBackLights::SetAllDataL(iAfEnv.PropAgent(), backLight);
	}

/**
 * 憗憲傝夝彍墳摎張棟\n

⌨️ 快捷键说明

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