smbmusicapmainplayerstatefr.cpp
来自「symbian」· C++ 代码 · 共 454 行
CPP
454 行
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
// SmbMusicAPMainPlayerStateFR.cpp
//
// Description:
// 儈儏乕僕僢僋僾儗僀儎乕嵞惗宯偺忬懺僋儔僗
// 憗栠偟忬懺
/*------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅 |曄峏幰 |撪梕
//--------------+-----------+----------------------------------------------
//2006/06/07 |K3拞堜 | 弶斉儕儕乕僗
/// 忬懺僋儔僗
/**
* @file SmbMusicAPMainPlayerStateFR.cpp
*
* 儈儏乕僕僢僋僾儗僀儎乕嵞惗宯偺忬懺僋儔僗
*/
//////////////////////////////////////////////////////////
//#define __SKIP_GETIMAGE__ // 摦嶌晄椙偺偨傔僗僉僢僾
//#define __SKIP_NOTIFY_INDEX__ // 摦嶌晄椙偺偨傔僗僉僢僾
#define __SKIP_ASSERT__
//////////////////////////////////////////////////////////
#include "SmbMusicAPMainPlayerPlayDebug.h"
#ifndef FJAFENV_H__
#include <FjAfEnv.h>
#endif
#ifndef FJPGBASIC_H__
#include <FjpgBasic.h>
#endif
#ifndef FJPGBASICSTATUS_H__
#include <FjpgBasicStatus.h>
#endif
#ifndef FJPGBASICLASERVER_H__
#include <FjpgBasicLaServer.h>
#endif
#ifndef __SMBPGMENU_H__
#include <SmbPGMenu.h>
#endif
#ifndef FJPGKEYSOUNDBACKLIGHTS_H__
#include <FjpgKeySoundBackLight.h>
#endif
#ifndef FJLACOMMON_H__
#include <Fjlacommon.h>
#endif
#ifndef __SMBMUSICAPPLAYERCOMMONDEF_H__
#include "SmbMusicAPPlayerCommonDef.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYEREXTERNALINTERFACE_H__
#include <SmbMusicAPMainPlayerExternalInterface.h>
#endif
#ifndef __SMBMUSICAPSONGINFOEXTERNALINTERFACE_H__
#include <SmbMusicAPSongInfoExternalInterface.h>
#endif
#ifndef __SMBMUSICAPMAINPLAYERSTATEFR_H__
#include "SmbMusicAPMainPlayerStateFR.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERUTILITY_H__
#include "SmbMusicAPMainPlayerUtility.h"
#endif
//#ifndef __SMBMUSICAPMAINPLAYERDIALOGMANAGER_H__
//#include "SmbMusicAPMainPlayerDialogManager.h"
//#endif
#ifndef __SMBMUSICAPMAINPLAYERAPPBASISPARTFUNCINTERFACE_H__
#include "SmbMusicAPMainPlayerBasisPartFuncInterface.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERAPPUI_H__
#include "SmbMusicAPMainPlayerAppUi.h"
#endif
#ifndef __SMBAFWORDING_RSG__
#include <SmbAfWording.rsg>
#endif
SEMCJ_NAMESPACE_BEGIN
USING_NAMESPACE_DCM
#include <SmbMusicAPMainPlayer.RSG>
#include <Music.mbg>
/**
* 掆巭夋柺偺僉乕僀儀儞僩懳墳昞
*/
/**
* 憗憲傝乮憗栠偟乯夋柺偺僉乕僀儀儞僩懳墳昞
*/
const TSmbMusicAPMainPlayerStateKeyEvent KSmbMusicAPMainPlayerStateKeyFF[] =
{
{// 3.僜僼僩3
EWcdmaMpKeyMenu, // iKeyCode
ESmbMusicAPMainPlayerStateKeyUnUse, // 旕徚旓
NULL, // iShortPressFunc
NULL, // iLongPressFunc
NULL // iRepeatFunc
},
{// 13.廔榖
EWcdmaMpKeyOnHook, // iKeyCode
ESmbMusicAPMainPlayerStateKeyUnUse, // 旕徚旓
NULL, // iShortPressFunc
NULL, // iLongPressFunc
NULL // iRepeatFunc
}
};
/**
* 僀儞僗僞儞僗惗惉
* @param[in] aMusicAPMainPlayerEnv 儊僀儞僾儗僀儎乕娐嫬
* @param[in] aMusicSyncEngine 摨婜僄儞僕儞
* @param[in] aSelectView 専嶕宯價儏乕
*/
CSmbMusicAPMainPlayerStateFR::CSmbMusicAPMainPlayerStateFR(MSmbMusicAPMainPlayerEnv& aPlayerEnv,
RLog& aLog, RPGPropAgent& aPropAgent, CSmbMusicAPMainPlayerPlayView* aView
) : CSmbMusicAPMainPlayerStateBase(aPlayerEnv, aLog, aPropAgent, aView)
{
}
/**
* 僨僗僩儔僋僞
*/
CSmbMusicAPMainPlayerStateFR::~CSmbMusicAPMainPlayerStateFR()
{
}
//==============================================================================================
//
// Query儊僜僢僪
//
//
//==============================================================================================
/**
* 忬懺傪幆暿偡傞Enum抣偺庢摼
*
* @return 忬懺傪幆暿偡傞TSmbMusicAPMainPlayerPlayStatus宆偺抣
*/
TSmbMusicAPMainPlayerPlayStatus CSmbMusicAPMainPlayerStateFR::PlayStatus()
{
return ESmbMusicAPMainPlayerPlayPlayFR;
}
//==============================================================================================
//
// ViewActivated娭楢儊僜僢僪
//
//
//==============================================================================================
//==============================================================================================
//
// OfferKeyEvent娭楢儊僜僢僪
//
//
//==============================================================================================
/**
* 憗栠偟忬懺偱偺僉乕僀儀儞僩庴怣張棟
*
* @param[in] aKeyEvent 僉乕僀儀儞僩
* @param[in] aType 僀儀儞僩僐乕僪
* @return 僉乕偺徚旓(EKeyWasConsumed)丒旕徚旓(EKeyWasNotConsumed)傪曉媝偡傞丅
*/
TKeyResponse CSmbMusicAPMainPlayerStateFR::OfferKeyEventImplL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
TInt num;
TKeyResponse response;
if (EEventKeyUp == aType)
{//僉乕傾僢僾僀儀儞僩偺応崌
//憗栠偟忬懺偱偼仼僉乕偺傾僢僾偑憗栠偟偺廔椆偲側傞偺偱Up僀儀儞僩傪僠僃僢僋偡傞丅
response = KeyUpEvent(aKeyEvent);
}
else if(iView->IsActiveKeyEvent(aType) != EFalse)
{//僉乕僀儀儞僩偱丄堦審嶍彍拞偱偼柍偄応崌
// 傾僾儕掅揹埑偵傛傞掆巭忬懺傪夝彍 2006.10.25
iView->iLowBatteryStoped = EFalse;
// 憗栠偟忬懺偺僉乕僥乕僽儖傪巊偭偰張棟儊僜僢僪偵僨傿僗僷僢僠偡傞
iView->iKeyEvent = aKeyEvent;
num = sizeof(KSmbMusicAPMainPlayerStateKeyFF) / sizeof(KSmbMusicAPMainPlayerStateKeyFF[0]);
response = KeyEventL(aKeyEvent, KSmbMusicAPMainPlayerStateKeyFF, num);
}
else
{//偦偺懠偺応崌(僉乕僟僂儞僀儀儞僩傑偨偼堦審嶍彍拞偺僉乕僀儀儞僩偺応崌)
//僀儀儞僩偼徚旓偟側偄
response = EKeyWasNotConsumed;
}
return response;
}
/**
* 憗栠偟忬懺偱偺僉乕傾僢僾庴怣張棟
* public
*
* @param[in] aKeyEvent 僉乕僀儀儞僩
* @return 僉乕偺徚旓(EKeyWasConsumed)丒旕徚旓(EKeyWasNotConsumed)傪曉媝偡傞丅
*/
TKeyResponse CSmbMusicAPMainPlayerStateFR::KeyUpEvent(const TKeyEvent& aKeyEvent)
{
TKeyResponse response;
//TODO: 晄梫偲巚傢傟傞丅妋擣屻嶍彍丅
// iView->iCmd->GetRequestKind(iView->iProckind, iView->iInfokind);
if (EStdKeyLeftArrow == aKeyEvent.iScanCode)
{//仺 僉乕偺僉乕傾僢僾僀儀儞僩応崌
//憗栠偟偺廔椆
ProcKeyLongLeftUp();
response = EKeyWasConsumed;
}
else
{//仺 僉乕埲奜偺偺僉乕傾僢僾僀儀儞僩応崌
//僀儀儞僩偼徚旓偟側偄
response = EKeyWasNotConsumed;
}
return response;
}
/**
* 嵍僉乕傾僢僾張棟
* private
* 憗栠偟夝彍張棟傪峴偆丅
*/
void CSmbMusicAPMainPlayerStateFR::ProcKeyLongLeftUp()
{
if (ESmbMusicAPMainPlayerPlayProcCancelFR == iView->iProc
|| iView->IsHoldingCancelPlayFR() != EFalse)
{//FR偺僉儍儞僙儖偑敪峴嵪傒傑偨偼FR僉儍儞僙儖偑儁儞僨傿儞僌偵側偭偰偄傞応崌
//壗傕偟側偄
return;
}
//昤夋偺掆巭
iView->iDrawer->StopRedrawTimer();
//TODO: 晄梫偲巚傢傟傞丅妋擣屻嶍彍丅
//iView->iCmd->GetRequestKind(iView->iProckind, iView->iInfokind);
// 憗憲傝掆巭偺梫媮傪敪峴丅
iView->iCmd->CancelPlayFR();
//TODO: FF偺張棟偱偼ProcNon傪妋擣偟偨忋偱張棟庬暿傪愝掕偟偰偄傞丅梫妋擣丅
//張棟庬暿傪FRF僉儍儞僙儖張棟偵愝掕偡傞
iView->iProc = ESmbMusicAPMainPlayerPlayProcCancelFR;
}
//==============================================================================================
//
// 旕摨婜屇傃弌偟偺墳摎張棟娭楢儊僜僢僪
//
//
//==============================================================================================
/**
* 憗栠偟夝彍墳摎張棟\n
* 憗栠偟夋柺偐傜嵞惗夋柺傊慗堏偡傞丅
*
* Y: public
*
* @param[in] aResult 張棟寢壥
*/
void CSmbMusicAPMainPlayerStateFR::RespCancelPlayFRL(TInt aResult)
{
// Change 2007.07.10
// if (EFalse == aResult)
if (KErrNone != aResult)
{// 堎忢廔椆帪
if (KErrNotReady != aResult)
{
// KErrNotReady 傪徣偔
// Change End 2007.07.10
// 枹張棟忬懺偵偡傞丅 乮掆巭張棟忬懺偺応崌傪徣偔乯
if (ESmbMusicAPMainPlayerPlayProcStop != iView->iProc
&& ESmbMusicAPMainPlayerPlayProcStopChange != iView->iProc)
{//掆巭張棟拞偱偼柍偄応崌
//張棟庬暿傪張棟柍偟偵偡傞丅
iView->iProc = ESmbMusicAPMainPlayerPlayProcNone;
//忬懺傪嵞惗忬懺偵偡傞丅
iView->ChangeState(ESmbMusicAPMainPlayerPlayPlaying); // 2006.10.04 TRK:9538
}
}
}
else
{//惓忢廔椆帪
//忬懺傪(FR忬懺偐傜)嵞惗忬懺偵偡傞丅
iView->ChangeState(ESmbMusicAPMainPlayerPlayPlaying); // 2006.10.04 TRK:9538
if (EFalse != iView->iLowBatteryStoped) // PTX824 TRK:513懳墳
{//掅揹埑掆巭偑妡偐偭偰偄傞応崌
//掆巭梫媮傪敪峴偡傞丅
iView->iCmd->PlayStop(); // TRK:11141 2006.10.12
}
else
{//掅揹埑掆巭偑妡偐偭偰偄側偄応崌
// 嵞惗宱夁帪娫傪庢摼偡傞丅
iView->iCmd->GetPlayTime();
}
}
// (惓忢廔椆偱傕堎忢廔椆偱傕乯LCD忢帪揰摂忬懺傪僉儍儞僙儖偡傞丅
PGBackLights::ApplyUserSettingL(iPropAgent);
}
//==============================================================================================
//
// 嵞惗宯僀儀儞僩張棟娭楢儊僜僢僪
//
//
//==============================================================================================
/**
* 憗栠偟嬋愭摢専弌捠抦
* 嵞惗奐巒梫媮傪峴偆丅
*
* Y: public
*
*/
void CSmbMusicAPMainPlayerStateFR::NotifyFRToSongHeadL()
{
iView->iDrawer->StopRedrawTimer();
// LCD僶僢僋儔僀僩忢帪揰摂傪僉儍儞僙儖
PGBackLights::ApplyUserSettingL(iPropAgent);
// Add 2007.04.04 PTX824 TRK:513懳墳
if (EFalse == iView->iLowBatteryStoped)
// Add ENd 2007.04.04 PTX824 TRK:513懳墳
{
// 尰嵼嬋偺嵞惗傪峴偆丅
iView->iCmd->PlayStart(iPlayerEnv.MannerModePlayingState());
iView->iProc = ESmbMusicAPMainPlayerPlayProcPlayFRTop;
}
iView->ChangeState(ESmbMusicAPMainPlayerPlayStop);
// PTX824懳墳
// 婡擻僉乕柍岠 2007.03.09
iView->ChangeFuncKeyState(EFalse); // 2007.04.23
}
// Add 2007.08.03
/**
* 堦帪掆巭捠抦張棟
*/
void CSmbMusicAPMainPlayerStateFR::NotifyStopPlayL()
{
iView->iFailState = EFalse;
delete iView->iPeriodic;
iView->iPeriodic = NULL;
iView->iStartPause = EFalse;
//儅僫乕儌乕僪嵞惗僼儔僌傪儕僙僢僩偡傞
iPlayerEnv.SetMannerModePlayingStateL(EFalse); // 2006.10.18 TRK:11757
if (EFalse != iView->iExtMemory)
{// 奜晹儊儌儕乕憓敳偑偁偭偨応崌
return;
}
iView->iBeforeIndex = iView->iPlayList.iIndex;
iView->iPlayList.iIndex = iView->iIndex;
if (ESmbMusicAPMainPlayerPlayProcListEnd == iView->iProc)
{// 儕僗僩嵞惗姰椆張棟忬懺(嵞惗嬋偑嵞惗晄壜)
NotifyCompletePlayListL();
return;
}
if (ESmbMusicAPMainPlayerPlayProcPlayLowBattery == iView->iProc)
{// 傾僾儕掅揹埑偵傛傞掆巭
ProcNotifyStopPlayInLowBatteryL();
}
else
{// 偦偺懠偺応崌
ProcNotifyStopPlayInOtherL(iView->iPauseState/*pauseState*/);
}
iView->iPlayCancel = EFalse; // TRK9304 2006.09.18
}//end of NotifyStopPlayL()
// Add End 2007.08.03
//==============================================================================================
//
// 偦偺懠
//
//
//==============================================================================================
/**
* 憗栠偟忬懺夋柺偺昤夋傪峴偆丅
*
* Y: public
*
* @param[in] aInit 弶婜夋柺昞帵乮ETrue:價僕儏傾儔僀僓乕夋柺昞帵乯
*/
void CSmbMusicAPMainPlayerStateFR::RedrawL(TBool /*aInit*/)
{
iView->iDrawer->DrawPlayFRPictureL(ETrue);
}
SEMCJ_NAMESPACE_END
// end of SmbMusicAPMainPlayerStateFR.cpp
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?