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

📄 smbmusicapsyncservercontentscontroller.cpp

📁 索爱相关代码。实现功能是server。很有参考价值。代码很难弄到。symbian。
💻 CPP
📖 第 1 页 / 共 4 页
字号:
	}


/**
 *  2nd僐儞僗僩儔僋僞
 **/
void CSmbMusicAPSyncServerContentsController::ConstructL()
	{
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber01;
	_LIT(KContentsControllerConstructL01, "SyncServerContentsController::ConstructL() Start");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelNormal, KContentsControllerConstructL01);

	iServiceQueue = CSmbMusicAPSyncServerContentsServiceQueue::NewL(iLog, *this);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber02;
	_LIT(KContentsControllerConstructL02, "SyncServerContentsController::ConstructL() ServiceQueue Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL02);
#endif

	iContentsFunc = CSmbMusicAPSyncServerContentsFunc::NewL(iLog, *this);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber03;
	_LIT(KContentsControllerConstructL03, "SyncServerContentsController::ConstructL() Func Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL03);
#endif

	iTraceManager = CSmbMusicAPSyncServerContentsScreenTraceManager::NewL(iLog, iModel);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber04;
	_LIT(KContentsControllerConstructL04, "SyncServerContentsController::ConstructL() ScreenTraceManager Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL04);
#endif

	iPLOrderManager = CSmbMusicAPSyncServerContentsPLOrderManager::NewL(iLog, iModel);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber05;
	_LIT(KContentsControllerConstructL05, "SyncServerContentsController::ConstructL() PLOrderManager Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL05);
#endif

	iImageDataManager = new(ELeave) CSmbMusicAPSyncServerContentsImageDataManager(iLog);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber06;
	_LIT(KContentsControllerConstructL06, "SyncServerContentsController::ConstructL() ImageDataManager Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL06);
#endif

	iPlSongInfoManager = new(ELeave) CSmbMusicAPSyncServerContentsPlaySongInfoManager(iLog);
	iPlSongInfoManager->ConstructL();

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber07;
	_LIT(KContentsControllerConstructL07, "SyncServerContentsController::ConstructL() PlaySongInfoManager Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL07);
#endif

	iNotifyManager = new(ELeave) CSmbMusicAPSyncServerContentsAppNotifyManager(iLog);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber08;
	_LIT(KContentsControllerConstructL08, "SyncServerContentsController::ConstructL() AppNotifyManager Complete");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLowest, KContentsControllerConstructL08);
#endif

	iObserveUpdateManager = CSmbMusicAPSyncServerContentsObserveUpdateManager::NewL(iLog, iContentsFunc->Session(), *this);

	logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber09;
	_LIT(KContentsControllerConstructL09, "SyncServerContentsController::ConstructL() End");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelNormal, KContentsControllerConstructL09);
	}


/**
 *  僋儔僀傾儞僩偐傜偺儊僢僙乕僕庴怣僴儞僪儔
 *
 *  @param[in]	aMessage	僋儔僀傾儞僩偐傜偺儊僢僙乕僕
 *
 *	@return	儊僢僙乕僕偺僴儞僪儖寢壥(ETrue:儊僢僙乕僕張棟偁傝丄EFalse:儊僢僙乕僕張棟柍偟)
 **/
TBool CSmbMusicAPSyncServerContentsController::ReceiveMessageL(const RMessage2& aMessage)
	{
//  MODIFY-S  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張
	TSmbMusicAPSyncServerFunction func(static_cast<TSmbMusicAPSyncServerFunction>(aMessage.Function() & ESmbMusicAPSyncServerFuncMaskFunction));
//  MODIFY-E  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber10;
	_LIT(KContentsControllerReceiveMessageL01, "SyncServerContentsController::ReceiveMessageL(0x%08x)");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelNormal, KContentsControllerReceiveMessageL01, func);
#endif

	if ((ESmbMusicAPSyncServerFuncContentsCommandMin < func) &&
		(func < ESmbMusicAPSyncServerFuncContentsCommandMax))
		{	//  僒乕價僗偺応崌
		CSmbMusicAPSyncServerContentsServiceBase* service(NULL);
		service = SelectServiceL(aMessage);
		if (service == NULL)
			{	//  懳墳偡傞僒乕價僗偑尒偮偐傜側偐偭偨応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
			logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber11;
			_LIT(KContentsControllerReceiveMessageL02, "SyncServerContentsController::ReceiveMessageL Service not found");
			SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLow, KContentsControllerReceiveMessageL02);
#endif
			return EFalse;
			}

//  ADD-S  [D_82400014801]  僒僽偺張棟偑懾傞偨傔偺懳墳
		if ((func == ESmbMusicAPSyncServerFuncGetPrevList) ||	//  慗堏尦儕僗僩忣曬傪庢摼
			(func == ESmbMusicAPSyncServerFuncGetListType))		//  儕僗僩庬暿傪庢摼
			{
			CleanupStack::PushL(service);
			service -> StartServiceL();
			CleanupStack::PopAndDestroy(service);

			return ETrue;
			}
//  ADD-E  [D_82400014801]  僒僽偺張棟偑懾傞偨傔偺懳墳

		TInt result = iServiceQueue -> Append(service);
		if (result != KErrNone)
			{
			//  張棟傪懕偗傞傛傝傓偟傠PANIC偝偣傞傋偒偐傕乧
			TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber12;
			_LIT(KContentsControllerReceiveMessageL03, "SyncServerContentsController::ReceiveMessageL SaveService Error:%d");
			SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelHigh, KContentsControllerReceiveMessageL03, result);

			service -> MessageComplete(result);
			delete service;

			return ETrue;	//  幚嵺偵偼僴儞僪儖偡傋偒儊僢僙乕僕側偺偱張棟嵪傒偱曉偡
			}
		}
	else if(ESmbMusicAPSyncServerFuncContentsRequestNotify == func)
		{	//  僀儀儞僩捠抦愝掕偺応崌
		iNotifyManager->SetObserver(aMessage);
		}
	else if(ESmbMusicAPSyncServerFuncContentsCancelRequestNotify == func)
		{	//  僀儀儞僩捠抦僉儍儞僙儖偺応崌
		iNotifyManager->CancelObserver(aMessage);
		}
	else if((ESmbMusicAPSyncServerFuncContentsCancelMin < func ) &&
			(func < ESmbMusicAPSyncServerFuncContentsCancelMax))
		{	//  僒乕價僗僉儍儞僙儖偺応崌
		CancelService(aMessage);
		}
	else if(ESmbMusicAPSyncServerFuncAppExit == func)
		{	//傾僾儕廔椆捠抦
		ServiceAllEnd();
		//傾僾儕廔椆偼張棟側偟偱曉偡
		return EFalse;

		}
	else
		{
		//僐儞僥儞僣宯埲奜偺儊僢僙乕僕偩偭偨応崌
		return EFalse;
		}
	return ETrue;
	}


/**
僙僢僔儑儞愗抐捠抦
 * @param [in]	aSession	愗抐偡傞僙僢僔儑儞
 * @return	側偟
 */
void CSmbMusicAPSyncServerContentsController::DisConnect(CSession2& /*aSession*/)
	{
	ServiceAllEnd();
	}


/**
 傾僋僥傿僽僙僢僔儑儞偺栤偄崌傢偣
 * @param [in]	aMessage	僋儔僀傾儞僩偐傜搉偝傟偨僨乕僞傪奿擺偟偨儊僢僙乕僕偺嶲徠
 * @return	傾僋僥傿僽僙僢僔儑儞偐傜偺儊僢僙乕僕偐斲偐
 */
TBool CSmbMusicAPSyncServerContentsController::IsActiveSession(const RMessage2& aMessage)
	{
//  MODIFY-S  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張
	TSmbMusicAPSyncServerFunction func(static_cast<TSmbMusicAPSyncServerFunction>(aMessage.Function() & ESmbMusicAPSyncServerFuncMaskFunction));
//  MODIFY-E  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張

	TBool res(EFalse);
	switch(func)
		{
	//  僀儀儞僩捠抦愝掕偺応崌
	case ESmbMusicAPSyncServerFuncContentsRequestNotify:
		//僒乕僶偺強桳尃偵娭學側偄
		res = ETrue;
		break;

	//  僀儀儞僩捠抦僉儍儞僙儖偺応崌
	//  [iKeeper(TRK):6108]僉儍儞僙儖僀儀儞僩偑IsActiveSession偱惓偟偔僴儞僪儖偝傟偰偄側偐偭偨栤戣偺廋惓
	case ESmbMusicAPSyncServerFuncContentsCancelRequestNotify:
		//僒乕僶偺強桳尃偵娭學側偄
		res = ETrue;
		break;

	//	慗堏傕偲偺儕僗僩傪庢摼偡傞
	case ESmbMusicAPSyncServerFuncGetPrevList:
		//僒乕僶偺強桳尃偵娭學側偄
		res = ETrue;
		break;

	//	儕僗僩偵娷傑傟傞娷傑傟傞傾僀僥儉悢傪庢摼偡傞
	case ESmbMusicAPSyncServerFuncGetItemCount:
		res = ETrue;
		break;

	//	儕僗僩偺庬暿傪庢摼偡傞
	case ESmbMusicAPSyncServerFuncGetListType:
		//僒乕僶偺強桳尃偵娭學側偄
		res = ETrue;
		break;

	//	巜掕偝傟偨儕僗僩偺僞僀僩儖傪庢摼偡傞
	case ESmbMusicAPSyncServerFuncGetListTitle:
		//僒乕僶偺強桳尃偵娭學側偄
		res = ETrue;
		break;

	default:
		break;
		}
	return res;
	}


/**
 *  僒乕僶撪偺僐儅儞僪庴怣僴儞僪儔
 *
 *  @param[in]	aMessage	僒乕僶撪僐儅儞僪
 *
 *	@return	僐儅儞僪偺僴儞僪儖寢壥(ETrue:僐儅儞僪張棟偁傝丄EFalse:僐儅儞僪張棟柍偟)
 **/
TBool CSmbMusicAPSyncServerContentsController::CommandL(TSmbMusicAPSyncServerInternalCommandPkg aCommand)
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber13;
	_LIT(KContentsControllerCommandL01, "SyncServerContentsController::CommandL Command(%d)");
	SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelNormal, KContentsControllerCommandL01, aCommand.iCommand);
#endif
	TBool retState(ETrue);

	//  僒乕價僗敾暿
	switch(aCommand.iCommand)
		{
		case ESmbMsuicAPSyncServerIndexFromIHandle:			//	Index偐傜Iterator僴儞僪儖傪庢摼偡傞
		case ESmbMsuicAPSyncServerHandleFromIndex:			//	Iterator僴儞僪儖偐傜Index傪庢摼偡傞
		case ESmbMusicAPSyncServerUpDateAvailableInfo:		//	傾僀僥儉桳岠惈忣曬峏怴
		case ESmbMusicAPSyncServerSetResumeInfo:			//	儗僕儏乕儉忣曬曐懚
			{
			CSmbMusicAPSyncServerContentsServiceBase* service(NULL);
			service = SelectServiceL(aCommand);
			if (service != NULL)
				{
				CleanupStack::PushL(service);
				TSmbMusicAPSyncServerContentsServiceState result(ESmbMusicAPSyncServerContetnsServiceStateEnd);
				result = service -> StartServiceL();

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
				logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber14;
				_LIT(KContentsControllerCommandL03, "SyncServerContentsController::CommandL Direct Serviced:%d");
				SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLow, KContentsControllerCommandL03, result);
#endif
				CleanupStack::PopAndDestroy(service);
				}
			else
				{	//  懳墳偡傞僒乕價僗偑尒偮偐傜側偐偭偨応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
				logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber15;
				_LIT(KContentsControllerCommandL04, "SyncServerContentsController::CommandL Service not found Command=%d");
				SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLow, KContentsControllerCommandL04,aCommand.iCommand);
#endif
				retState = EFalse;
				}
			}
			break;
		case ESmbMsuicAPSyncServerChangeExtMemState:		//	奜晹儊儌儕偺忬懺曄峏捠抦
		case ESmbMsuicAPSyncServerInsertMS:					//	MS憓擖
		case ESmbMsuicAPSyncServerInsertSD:					//	SD憓擖
		case ESmbMsuicAPSyncServerRemoveMS:					//	MS敳嫀
		case ESmbMsuicAPSyncServerRemoveSD:					//	SD敳嫀
		case ESmbMusicAPSyncServerDeleteResumeInfo:			//	儗僕儏乕儉忣曬嶍彍
		case ESmbMsuicAPSyncServerIncrementPlaySongTimes:	//	専嶕梡偺嵞惗夞悢傪峏怴偡傞
//  ADD-S  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張
		case ESmbMsuicAPSyncServerDeleteCacheItem:			//	傾僀僥儉僉儍僢僔儏攋婞
//  ADD-E  [iKeeper(TRK):10587] 僉儍儞僙儖弴偺僨僢僪儘僢僋栤戣懳張
			{
			CSmbMusicAPSyncServerContentsServiceBase* service(NULL);
			service = SelectServiceL(aCommand);
			if (service != NULL)
				{
				TInt result = iServiceQueue -> Append(service);
				if (result != KErrNone)
					{
					//  張棟傪懕偗傞傛傝傓偟傠PANIC偝偣傞傋偒偐傕乧
					TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber16;
					_LIT(KContentsControllerCommandL05, "SyncServerContentsController::CommandL SaveService Error:%d");
					SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelHigh, KContentsControllerCommandL05, result);

					delete service;
					retState = ETrue;	//  幚嵺偵偼僴儞僪儖偡傋偒儊僢僙乕僕側偺偱張棟嵪傒偱曉偡
					}
				}
			else
				{	//  懳墳偡傞僒乕價僗偑尒偮偐傜側偐偭偨応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
				logCode = EMusicAPSyncServerClassNumber_ContentsController | EMusicAPSyncServerLocationNumber17;
				_LIT(KContentsControllerCommandL06, "SyncServerContentsController::CommandL Service not found Command=%d");
				SmbMusicAPSyncServerLog(iLog, logCode, ELogLevelLow, KContentsControllerCommandL06, aCommand.iCommand);
#endif

⌨️ 快捷键说明

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