smbmusicapmainplayerappui.cpp

来自「symbian」· C++ 代码 · 共 1,625 行 · 第 1/5 页

CPP
1,625
字号
/* Copyright (C) 2005-2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
//	SmbMusicAPMainPlayerAppUi.cpp
//
// Description: 
//	儈儏乕僕僢僋僾儗僀儎乕偺傾僾儕働乕僔儑儞UI僋儔僗偺幚憰丅
/*------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅			|曄峏幰 	|撪梕
//--------------+-----------+----------------------------------------------
//2006/06/07	|K3戝嫶		|怴婯嶌惉
//2007/09/01	|SEMCJ暯壀	|D_82400013712懳墳

///!!!!!! 儔僀僙儞僗僠僃僢僋傾僾儕僒億乕僩帪偵僐儊儞僩傾僂僩乮嶍彍乯偡傞 !!!!!!
//#define _KSMBMUSICAP_LICENSECHECK_NOTSUPPORT_

// SmbMusicAPMainPlayer.mmp 偵堏摦
//#define _KSMBMUSICAP_CPU_HIGH_

#include "SmbMusicAPMainPlayerPlayDebug.h"

#ifdef __SMBMUSICAP_PTX824_DEF__
#ifndef __SMBAFAPPLICATION_H__
#include <SmbAfApplication.h>
#ifndef __SMBAFENV_H__
#include <SmbAfEnv.h>
#endif
#endif
#endif

#ifndef FJAFAPPLICATION_H__
#include <FjAfApplication.h>
#endif
#ifndef FJAFENV_H__
#include <FjAfEnv.h>
#endif
#ifndef FJPGBASICSTATUS_H__
#include <FjpgBasicStatus.h>
#endif
#ifndef FJAFASYNCCOMMAND_H__
#include <FjAfAsyncCommand.h>
#endif
#ifndef FJPGBASICJAM_H__
#include <FjpgBasicJam.h>
#endif
#ifndef FJPGBASICLASERVER_H__
#include <FjpgBasicLaServer.h>
#endif
#ifndef FJOBIAPPLIEXTERNALINTERFACE_H__
#include <FJOBIAPPLIExternalInterface.h>
#endif

// PTX824懳墳
#ifndef FJPGBASICIAPPLI_H__
#include <FjpgBasicIAppli.h>
#endif

// Add 2008.08.15
#ifdef _KSMBMUSICAP_CPU_HIGH_
#ifndef   FJLACLIENT_H__
#include <Fjlaclient.h>
#endif
#endif
// Add End 2008.08.15

#ifndef __SMBJAPPEXTERNALINTERFACE_H__
#include <SmbJappExternalInterface.h>
#endif
#ifndef __SMBPMFPROBEXTERNALINTERFACE_H__
#include <SmbPmfprobExternalInterface.h>
#endif
#ifndef __SMBFEPEXTERNALINTERFACE_H__
#include <SmbFepExternalInterface.h>
#endif

#ifndef _KSMBMUSICAP_LICENSECHECK_NOTSUPPORT_
#ifndef __SMBMUSICAPLICENSECHECKEXTERNALINTERFACE_H__
#include <SmbMusicAPLicenseCheckExternalInterface.h>
#endif
#endif

#ifndef __SMBFEP_H__
#include <SmbFep.h>
#endif
//#ifndef FJXLANGUAGE_H__
//#include <FJxLanguage.h>
//#endif

#ifdef __SMBMUSICAP_PTX824_DEF__
#ifndef __SMBPGIAPPLI_H__
#include <SmbPGIAppli.h>
#endif
#endif

#ifndef __SMBPGMENU_H__
#include <SmbPGMenu.h>
#endif
#ifndef __SMBPGCONNECT_H__
#include <SmbPGConnect.h>
#endif
#ifndef __SMBPGSTATUS_H__
#include <SmbPGStatus.h>
#endif
#ifndef __SMBDBX_APPINTERFACE_H__
#include <SmbDbxAppInterface.h>
#endif
#ifndef __SMBMUSICAPFILEMGREXTERNALINTERFACE_H__
#include <SmbMusicAPFileMgrExternalInterface.h>
#endif
#ifndef __SMBMUSICAPSONGINFOEXTERNALINTERFACE_H__
#include <SmbMusicAPSongInfoExternalInterface.h>
#endif
#ifndef __SMBMUSICAPPLAYERCOMMONDEF_H__
#include "SmbMusicAPPlayerCommonDef.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERDIALOGMANAGER_H__
#include "SmbMusicAPMainPlayerDialogManager.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERSETSYNCENGINEFUNC_H__
#include "SmbMusicAPMainPlayerSetSyncEngineFunc.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERACCESSSYNCENGINEFUNC_H__
#include "SmbMusicAPMainPlayerAccessSyncEngineFunc.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERSYNCSERVERCONTROLLER_H__
#include "SmbMusicAPMainPlayerFilterSyncServerController.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERVIEWBASE_H__
#include "SmbMusicAPMainPlayerViewBase.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERFILTERVIEW_H__
#include "SmbMusicAPMainPlayerFilterView.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERPLAYVIEW_H__
#include "SmbMusicAPMainPlayerPlayView.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERIMAGEVIEW_H__
#include "SmbMusicAPMainPlayerImageView.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERSETTINGVIEW_H__
#include "SmbMusicAPMainPlayerSettingView.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERPLSELECTVIEW_H__
#include "SmbMusicAPMainPlayerPLSelectView.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERUTILITY_H__
#include "SmbMusicAPMainPlayerUtility.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERAPPUI_H__
#include "SmbMusicAPMainPlayerAppUi.h"
#endif
#ifndef __SMBMUSICAPSYNCENGINE_H__
#include <SmbMusicAPSyncEngine.h>
#endif
#ifndef __SMBMUSICAPMAINPLAYERBASE_HRH__
#include "SmbMusicAPMainPlayerBase.hrh"
#endif

#include <SmbAfWording.rsg>
#include <SmbMusicAPMainPlayer.rsg>

#define _SMBMUSICAPMAINPLAYER_SYNCSERVER_ACCESS_LOG  // 摨婜僒乕僶傾僋僙僗尃庢摼/夝曻偵娭偡傞儘僌傪弌椡

USING_NAMESPACE_DCM
SEMCJ_NAMESPACE_BEGIN

/**
 * 僐儞僗僩儔僋僞
 */
CSmbMusicAPMainPlayerAppUi::CSmbMusicAPMainPlayerAppUi()
	{
	}

/**
 * 2nd僼僃乕僘僐儞僗僩儔僋僞
 *
 * 傾僾儕働乕僔儑儞僼儗乕儉儚乕僋(CEikDocument::PrepareToEditL)偐傜屇偽傟傞丅
 * 乮CEikAppUi偱virtual偱掕媊乯
 */
void CSmbMusicAPMainPlayerAppUi::ConstructL()
	{
	// 弶婜壔張棟拞

	// 弶婜壔廔椆偼NotifyStartAppAsyncResL()撪偱愝掕偝傟傞
	iInternalState = ESmbStarting;

	//__UHEAP_FAILNEXT(22);  // UT丗BaseConstructL()幐攕(1:__ASSERT_ALWAYS()偵傛傞僷僯僢僋偑敪惗,2:僼儗乕儉儚乕僋偱AppUi傪delete偝傟側偄偨傔丄儊儌儕儕乕僋敪惗,3乣21丗Leave屻丄僞僗僋廔椆帪偵僷僯僢僋敪惗,22乣:Leave偣偢偵惓忢摦嶌偟偰偟傑偆乯
	BaseConstructL();

// Add 2007.09.15
//	iAfEnv.LauncherSession().ControlCPUSpeed(DCM_NAMESPACE::ELaCpuSpeedHigh);
// Add End 2007.09.15

	// ViewActivate帪偵昞帵桪愭搙傪寛掕偡傞偨傔丄偙偙偱僆乕僩僽儕儞僌傪柍岠偵偡傞
#ifndef __SMBMUSICAP_PTX824_DEF__
	iAfEnv.LauncherSession().EnableAutoBring(EFalse);
#else
	iSmbAfEnv.SmbLaSession().EnableAutoBring(EFalse);
#endif

//ADD-S 2006.10.14 K3戝嫶 [i-keeper(TRK):10496] 擇廳婲摦偺戙傢傝偵慜柺偵昞帵偝傟傞傛偆丄廔椆僗僥乕僞僗傪巜掕
	// 擇廳婲摦偺戙傢傝偵慜柺偵昞帵
#ifndef __SMBMUSICAP_PTX824_DEF__
	iAfEnv.LauncherSession().SetAppExitState(ELaAppStateNotEndAndSwitchToApp);
#else
	iSmbAfEnv.SmbLaSession().SetAppExitState(ELaAppStateNotEndAndSwitchToApp);
#endif
//ADD-E 2006.10.14 K3戝嫶 [i-keeper(TRK):10496] 擇廳婲摦偺戙傢傝偵慜柺偵昞帵偝傟傞傛偆丄廔椆僗僥乕僞僗傪巜掕

	// 僾儘僷僥傿僄乕僕僃儞僩傊偺僙僢僔儑儞傪庢摼
	RPGPropAgent& propAgent = iAfEnv.PropAgent();

	// 偙偙偵棃偨帪揰偱僾儗僀儎乕偺忬懺偑枹婲摦乮ESmbPGMusicAPPlayerStateNotStarting乯偺偼偢
	// 擇廳婲摦偺偲偒偼丄嵟弶偵婲摦偝傟偰偄偨傕偺傪廔椆偟偨屻偵婲摦偡傞偨傔丄
	// 傾僾儕撪偱惓偟偔PA抣偺慗堏偑偱偒偰偄傟偽丄偙偺帪揰偱偼枹婲摦埲奜偁傝偊側偄丅
	// 廔椆帪丄壗傜偐偺梫慺偵傛偭偰丄曄峏偑偱偒側偐偭偨偙偲傕偁傝偆傞丅

	// 儈儏乕僕僢僋僾儗僀儎乕偺忬懺傪婲摦搑拞偵愝掕
	// 傑偩PA娔帇搊榐傪偟偰偄側偄偨傔丄偙偙偺PA抣偺曄峏偼僴儞僪儔偵偼専抦偝傟側偄
    SmbPGMusic::SetMusicAPPlayerStateL(propAgent, ESmbPGMusicAPPlayerStateStarting);
	iPlayerState = ESmbPGMusicAPPlayerStateStarting;// 婲摦搑拞偵愝掕

	// 旕摨婜僐儅儞僪偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CAfAsyncCommand惗惉幐攕
	iAsyncCommand = new(ELeave) CAfAsyncCommand();

	// 摨婜僄儞僕儞偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPSyncEngine惗惉幐攕
	iSyncEngine = CSmbMusicAPSyncEngine::NewL(iAfEnv.Log());
	iSyncEngine->AppendEngineObserver(this);
	// 儈儏乕僕僢僋僾儗僀儎乕婲摦帪偼儊僀儞僾儗僀儎乕偑強桳尃傪帩偭偰偄傞
	iHasSyncServerFlag = ETrue;

	//FilterView梡 摨婜僒乕僶惂屼儌僕儏乕儖偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerFilterSyncServerController惗惉幐攕
	iFilterSyncServerCtrl = CSmbMusicAPMainPlayerFilterSyncServerController::NewL(*iSyncEngine);

	// 摨婜僄儞僕儞傊偺旕摨婜梫媮張棟
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerAccessSyncEngineFunc惗惉幐攕
	iAccessSyncEngineFunc = new(ELeave) CSmbMusicAPMainPlayerAccessSyncEngineFunc(*iSyncEngine);
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerSetSyncEngineFunc惗惉幐攕
	iSetSyncEngineFunc = new(ELeave) CSmbMusicAPMainPlayerSetSyncEngineFunc(*iSyncEngine);

	// 摨婜僄儞僕儞偺愝掕
	// 嵟弶偼儊僀儞僾儗僀儎乕偵傾僋僙僗尃偑偁傞
	iSetSyncEngineFunc->SetMusicAllParamL(this);

	// 僟僀傾儘僌儅僱乕僕儍偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗DialogManager惗惉幐攕
#ifdef __SMBMUSICAP_PTX824_DEF__
	iDialogManager = CSmbMusicAPMainPlayerDialogManager::NewL(iSmbAfEnv, *iSyncEngine, *this, iAfEnv.Log());
#else
	iDialogManager = CSmbMusicAPMainPlayerDialogManager::NewL(iAfEnv, *iSyncEngine, *this, iAfEnv.Log());
#endif
	// 僉儍僢僔儏抣偺庢摼
	iForegroundFlag = EFalse;// 偲傝偁偊偢嵟慜柺偱偼側偄偲偟偰偍偔
	iBatteryLevel   = PGPropAgentBattery::GetDataL(propAgent);
	iChargeStatus   = PGPropAgentStatus::GetBatteryStatusL(propAgent);
	iCaseCloseFlag  = PGPropAgentStatus::IsCaseClosedL(propAgent);
//	iLanguage       = XLanguageUtilities::Language();

	// 儈儏乕僩忬懺偺愝掕
	UpdateMuteStateL();

	// DB忬懺傪庢摼乮傾僾儕掅揹埑僠僃僢僋屻偵嵞搙庢摼偡傞乯
	iDbState = CheckDbStateL();

// Add-S PTX-824 D_82400013712懳墳 暯壀 2007.09.01
	// 僆僼僗僋儕乕儞
	iOffScreen = new(ELeave) CFbsBitmap;
	iOffScreen->Create(TSize(KSmbLayout_WIN_W, KSmbLayout_WIN_H), iEikonEnv->DefaultDisplayMode());
	iDev = CFbsBitmapDevice::NewL(iOffScreen);
	iDev->CreateContext(iScreenGc);	
	iSkonGc = CSkonBitGc::NewL(iScreenGc, iOffScreen);
// Add-E PTX-824 D_82400013712懳墳 暯壀 2007.09.01

	// 奺價儏乕偺惗惉
	TInt viewCount = 0;

	// 専嶕Top夋柺偺惗惉
	// 嵞惗夋柺傛傝慜偵専嶕夋柺傪嶌惉偟丄億僀儞僞傪搉偡傛偆偵偡傞
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerFilterView惗惉幐攕
// Mod-S PTX-824 D_82400013712懳墳 暯壀 2007.09.01
//	CSmbMusicAPMainPlayerFilterView* filterView = CSmbMusicAPMainPlayerFilterView::NewL(*this, *iSyncEngine, *iAsyncCommand);
	CSmbMusicAPMainPlayerFilterView* filterView = CSmbMusicAPMainPlayerFilterView::NewL(*this, *iSyncEngine, *iAsyncCommand, iOffScreen, iSkonGc);
// Mod-S PTX-824 D_82400013712懳墳 暯壀 2007.09.01
	iViews[viewCount] = static_cast<CSmbMusicAPMainPlayerViewBase*>(filterView);
	iViews[viewCount]->SetBasisPartObserver(this);
	//__UHEAP_FAILNEXT(1);  // UT丗RegisterViewL()幐攕
	iViews[viewCount]->RegisterViewL();
	viewCount++;

	// 嵞惗夋柺偺惗惉
	// 嵞惗夋柺傛傝慜偵専嶕夋柺傪嶌惉偟丄億僀儞僞傪搉偡傛偆偵偡傞
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerPlayView惗惉幐攕
// Change 2007.09.01 nakai
//	iPlayView = CSmbMusicAPMainPlayerPlayView::NewL(*this, *iSyncEngine, *filterView);
	iPlayView = CSmbMusicAPMainPlayerPlayView::NewL(*this, *iSyncEngine, *filterView, iOffScreen, iSkonGc);
// Change End 2007.09.01 nakai
	iViews[viewCount] = static_cast<CSmbMusicAPMainPlayerViewBase*>(iPlayView);
	iViews[viewCount]->SetBasisPartObserver(this);
	//__UHEAP_FAILNEXT(1);  // UT丗RegisterViewL()幐攕
	iViews[viewCount]->RegisterViewL();
	viewCount++;

	// 夋憸昞帵夋柺偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerImageView惗惉幐攕
	iViews[viewCount] = CSmbMusicAPMainPlayerImageView::NewL(*this, *iSyncEngine);
	iViews[viewCount]->SetBasisPartObserver(this);
	//__UHEAP_FAILNEXT(1);  // UT丗RegisterViewL()幐攕
	iViews[viewCount]->RegisterViewL();
	viewCount++;

	// 愝掕夋柺偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerSettingView惗惉幐攕
	iViews[viewCount] = CSmbMusicAPMainPlayerSettingView::NewL(*this, *iSyncEngine);
	iViews[viewCount]->SetBasisPartObserver(this);
	//__UHEAP_FAILNEXT(1);  // UT丗RegisterViewL()幐攕
	iViews[viewCount]->RegisterViewL();
	viewCount++;

	// 僾儗僀儕僗僩慖戰夋柺偺惗惉
	//__UHEAP_FAILNEXT(1);  // UT丗CSmbMusicAPMainPlayerPLSelectView惗惉幐攕
// Mod-S PTX-824 D_82400013712懳墳 暯壀 2007.09.01

⌨️ 快捷键说明

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