📄 smbmusicapsyncservercontentsservicegetimagecount.cpp
字号:
case EContentsServiceGetImageCountStateGetJacketInfo: // 僕儍働僢僩忣曬庢摼拞
case EContentsServiceGetImageCountStateGetLyricInfo: // 壧帉忣曬庢摼拞
{
ASSERT(iSongItem != NULL);
// 夋憸忣曬庢摼偺僉儍儞僙儖
iSongItem -> CancelGetInfo();
}
break;
case EContentsServiceGetImageCountStateIdle: // 張棟柍偟
break;
default:
{
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber09;
_LIT(KServiceGetImageCountCancelService02, "SyncServerContentsServiceGetImageCount::CancelService illegal default-route:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelHighest, KServiceGetImageCountCancelService02, iServiceState);
ASSERT(EFalse);
}
break;
}
MessageComplete(KErrCancel);
iServiceState = EContentsServiceGetImageCountStateIdle; // 僒乕價僗忬懺傪枹幚峴忬懺傊
if (IsActive() != EFalse)
{ // AO偑傾僋僥傿僽偱偁傟偽僉儍儞僙儖偡傞
CSmbMusicAPSyncServerContentsServiceBase::Cancel();
}
}
/**
* 僒乕價僗宲懕
*
* @return 僒乕價僗張棟偺宲懕忬嫷
**/
TSmbMusicAPSyncServerContentsServiceState CSmbMusicAPSyncServerContentsServiceGetImageCount::ContinueServiceL()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber10;
_LIT(KServiceGetImageCountContinueServiceL01, "SyncServerContentsServiceGetImageCount::ContinueServiceL()");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServiceGetImageCountContinueServiceL01);
#endif
TSmbMusicAPSyncServerContentsServiceState retState(ESmbMusicAPSyncServerContetnsServiceStateEnd);
switch(iServiceState)
{
case EContentsServiceGetImageCountStateGetSongItem: // 懳徾嬋傾僀僥儉庢摼拞
{
TInt result = SetSongItem(); // 懳徾嬋傾僀僥儉庢摼
if (result == KErrNone)
{ // 懳徾嬋傾僀僥儉庢摼偵惉岟
if (iCompleteGetCount != EFalse)
{ // 婛偵夋憸悢傪庢摼嵪傒
// 僋儔僀傾儞僩偵僨乕僞傪彂偒弌偟偰張棟姰椆
TInt result = CompletionGetImageCount();
MessageComplete(result);
// 枹幚峴忬懺傊
iServiceState = EContentsServiceGetImageCountStateIdle;
// 張棟廔椆
retState = ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
else
{ // 夋憸悢傪枹庢摼
TSmbMusicMWLibImageType imageType(ESmbMusicMWLibImageTypeJacket);
TContentsServiceGetImageCountState nextState(EContentsServiceGetImageCountStateGetJacketInfo);
// AAA夋憸庢摼懳墳
if (iExType == ESmbMusicAPSyncEngineExTypeEnableAAA)
{ // AAA夋憸庢摼巜掕偺応崌
if ((iImageCount.iFileFormat == TSmbMusicAPSyncEngineFileMtpModeWMA) ||
(iImageCount.iFileFormat == TSmbMusicAPSyncEngineFileMemoryModeWMA))
{ // 僼傽僀儖僼僅乕儅僢僩偑WMA偺応崌
// 傑偢偼AAA夋憸忣曬傪庢摼偡傞
imageType = ESmbMusicMWLibImageTypeAAA;
nextState = EContentsServiceGetImageCountStateGetAAAInfo;
}
}
result = GetImageInformationL(imageType);
if (result == KErrNone)
{ // 夋憸忣曬庢摼梫媮偵惉岟
iServiceState = nextState;
CSmbMusicAPSyncServerContentsServiceBase::Start();
// 張棟宲懕
retState = ESmbMusicAPSyncServerContetnsServiceStateContinue;
}
}
}
if (result != KErrNone)
{ // 懳徾嬋傾僀僥儉庢摼偵幐攕丄傑偨偼夋憸忣曬庢摼梫媮偵幐攕偺応崌
MessageComplete(result);
// 枹幚峴忬懺傊
iServiceState = EContentsServiceGetImageCountStateIdle;
// 張棟廔椆
retState = ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
}
break;
case EContentsServiceGetImageCountStateGetAAAInfo: // AAA夋憸忣曬庢摼拞
{
// AAA夋憸悢愝掕
TInt aaaCount = iImageInfo -> EntryCount();
if (aaaCount > KSmbMusicAPSyncServerMaxAAAImageCount)
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber11;
_LIT(KServiceGetImageCountContinueServiceL02, "SyncServerContentsServiceGetImageCount::ContinueServiceL AAAImage Over:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountContinueServiceL02, aaaCount);
#endif
aaaCount = KSmbMusicAPSyncServerMaxAAAImageCount;
}
iImageCount.iJacketCount = aaaCount;
// 杮僒乕價僗偼僒僽儊僯儏乕偺婸搙敿婸搙敾掕偺偨傔偵巊梡偝傟傞丅
// 偦偺偨傔丄AAA夋憸偑懚嵼偡傟偽[夋憸昞帵]偼婸搙昞帵偝傟傞偨傔
// 僕儍働僢僩夋憸枃悢偼庢傝偵峴偐側偄偙偲偲偡傞丅
// 媡偵丄AAA夋憸偑側偄応崌偼丄僕儍働僢僩夋憸枃悢偺庢摼傪峴偆昁梫偑偁傞丅
TSmbMusicMWLibImageType imageType(ESmbMusicMWLibImageTypeLylic);
TContentsServiceGetImageCountState nextState(EContentsServiceGetImageCountStateGetLyricInfo);
if (aaaCount < 1)
{ // AAA夋憸偑側偐偭偨(0埲壓)応崌
// 僕儍働僢僩夋憸忣曬傪庢摼偡傞
imageType = ESmbMusicMWLibImageTypeJacket;
nextState = EContentsServiceGetImageCountStateGetJacketInfo;
}
TInt result = GetImageInformationL(imageType);
if (result != KErrNone)
{ // 夋憸忣曬庢摼梫媮偵幐攕
MessageComplete(result);
// 枹幚峴忬懺傊
iServiceState = EContentsServiceGetImageCountStateIdle;
// 張棟廔椆
retState = ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
else
{ // 夋憸忣曬庢摼梫媮偵惉岟
iServiceState = nextState;
CSmbMusicAPSyncServerContentsServiceBase::Start();
// 張棟宲懕
retState = ESmbMusicAPSyncServerContetnsServiceStateContinue;
}
}
break;
case EContentsServiceGetImageCountStateGetJacketInfo: // 僕儍働僢僩忣曬庢摼拞
{
// 僕儍働僢僩夋憸悢愝掕
// MODIFY-S 庢摼夋憸悢偵嵟戝抣敾掕傪捛壛
TInt jacketCount = iImageInfo -> EntryCount();
if (jacketCount > KSmbMusicAPSyncServerMaxJacketImageCount)
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber11;
_LIT(KServiceGetImageCountContinueServiceL02, "SyncServerContentsServiceGetImageCount::ContinueServiceL JacketImage Over:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountContinueServiceL02, jacketCount);
#endif
jacketCount = KSmbMusicAPSyncServerMaxJacketImageCount;
}
iImageCount.iJacketCount = jacketCount;
// MODIFY-E 庢摼夋憸悢偵嵟戝抣敾掕傪捛壛
TInt result = GetImageInformationL(ESmbMusicMWLibImageTypeLylic);
if (result != KErrNone)
{ // 夋憸忣曬庢摼梫媮偵幐攕
MessageComplete(result);
// 枹幚峴忬懺傊
iServiceState = EContentsServiceGetImageCountStateIdle;
// 張棟廔椆
retState = ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
else
{ // 夋憸忣曬庢摼梫媮偵惉岟
iServiceState = EContentsServiceGetImageCountStateGetLyricInfo;
CSmbMusicAPSyncServerContentsServiceBase::Start();
// 張棟宲懕
retState = ESmbMusicAPSyncServerContetnsServiceStateContinue;
}
}
break;
case EContentsServiceGetImageCountStateGetLyricInfo: // 壧帉忣曬庢摼拞
{
// 壧帉夋憸悢愝掕
// MODIFY-S 庢摼夋憸悢偵嵟戝抣敾掕傪捛壛
TInt lyricCount = iImageInfo -> EntryCount();
if (lyricCount > KSmbMusicAPSyncServerMaxLyricImageCount)
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber12;
_LIT(KServiceGetImageCountContinueServiceL03, "SyncServerContentsServiceGetImageCount::ContinueServiceL LyricImage Over:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountContinueServiceL03, lyricCount);
#endif
lyricCount = KSmbMusicAPSyncServerMaxLyricImageCount;
}
iImageCount.iLyricCount = lyricCount;
// MODIFY-E 庢摼夋憸悢偵嵟戝抣敾掕傪捛壛
TInt result = CompletionGetImageCount();
MessageComplete(result);
// 枹幚峴忬懺傊
iServiceState = EContentsServiceGetImageCountStateIdle;
// 張棟廔椆
retState = ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
break;
case EContentsServiceGetImageCountStateIdle: // 張棟柍偟
// 張棟柍偟忬懺偵ContinueService偑屇偽傟傞偙偲偼堎忢宯偱偁傞偨傔default摨條偵張棟偡傞丅
default:
{
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber13;
_LIT(KServiceGetImageCountContinueServiceL04, "SyncServerContentsServiceGetImageCount::ContinueServiceL illegal default-route:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelHighest, KServiceGetImageCountContinueServiceL04, iServiceState);
ASSERT(EFalse);
}
break;
}
return retState;
}
/**
* 懳徾嬋傾僀僥儉愝掕
*
* @return 張棟惉斲(KErrNone:張棟惉岟丄System-wide Error:張棟幐攕)
**/
TInt CSmbMusicAPSyncServerContentsServiceGetImageCount::SetSongItem()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber14;
_LIT(KServiceGetImageCountSetSongItem01, "SyncServerContentsServiceGetImageCount::SetSongItem() Start");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServiceGetImageCountSetSongItem01);
#endif
// 庢摼偟偨儕僗僩攝楍偺梫慺悢僠僃僢僋
if (iItemArray -> Count() < 1)
{ // 梫慺悢偑懌傝側偄(1側偄)応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber15;
_LIT(KServiceGetImageCountSetSongItem02, "SyncServerContentsServiceGetImageCount::SetSongItem no enough array:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountSetSongItem02, iItemArray -> Count());
#endif
return KErrNotReady;
}
// 懳徾嬋傾僀僥儉弶婜壔
delete iSongItem;
iSongItem = NULL;
// 庢摼偟偨儕僗僩攝楍偐傜嬋傾僀僥儉傪庢傝弌偡
TRAPD(error, iSongItem = static_cast<CSmbMusicMWLibSongItem*>(iItemArray -> GetMusicItemL(0)););
if (error != KErrNone)
{ // 嬋傾僀僥儉偺庢傝弌偟偵幐攕偟偨応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber16;
_LIT(KServiceGetImageCountSetSongItem03, "SyncServerContentsServiceGetImageCount::SetSongItem GetMusicItemL is Leave:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountSetSongItem03, error);
#endif
return error;
}
if (iSongItem == NULL)
{ // 庢傝弌偟偨嬋傾僀僥儉偑NULL偩偭偨応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetImageCount | EMusicAPSyncServerLocationNumber17;
_LIT(KServiceGetImageCountSetSongItem04, "SyncServerContentsServiceGetImageCount::SetSongItem GetMusicItemL is NULL");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetImageCountSetSongItem04);
#endif
return KErrNotFound;
}
// 傾僀僥儉儕僗僩偺弶婜壔
iItemArray -> Reset();
// ADD-S [iKeeper(TRK):7935] 僒僽儊僯儏乕梡徻嵶忣曬庢摼懳墳
// UIM幚峴惂尷忣曬庢摼
TInt result = IsUimLimited();
if (result != KErrNone)
{
return result;
}
// 僆儞儔僀儞忣曬庢摼
result = IsOnline();
if (result < 0)
{ // result偑晧偺抣偺帪偼僄儔乕
return result;
}
// 僼傽僀儖僼僅乕儅僢僩庢摼
result = FileFormat();
if (result != KErrNone)
{
return result;
}
// 僼傽僀儖曐懚応強庢摼
result = WhereStore();
if (result != KErrNone)
{
return result;
}
// ADD-E [iKeeper(TRK):7935] 僒僽儊僯儏乕梡徻嵶忣曬庢摼懳墳
// ADD-S PTX824 k3-sugimoto
// 嵞惗惂尷忣曬庢摼
result = Limitation();
if (result != KErrNone)
{
return result;
}
// ADD-E PTX824 k3-sugimoto
return KErrNone;
}
/**
* 夋憸忣曬庢摼
*
* @param[in] aType 庢摼偡傞夋憸偺僞僀僾
*
* @return 張棟寢壥(KErrNone:張棟惉岟丄System-wide Error:張棟幐攕
**/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -