📄 smbmusicapsingleplayerview.cpp
字号:
TRect(TPoint(0,0),TSize(KPlayStateRect.iWidth, KPlayStateRect.iHeight)),
iStateIcon[iState]->Mask(),
EFalse);
DeactivateGc();
}
/**
* AppUi偵僐儅儞僪傪攝怣偡傞
*
* @param TInt aCommand 僐儅儞僪ID
* @return void
*/
void CSmbMusicAPSinglePlayerView::ProcessCommandL(TInt aCommandId)
{
static_cast<CAfAppUi*>(iCoeEnv->AppUi())->HandleCommandL(aCommandId);
}
/**
* 怴偟偄僉乕僈僀僟儞僗傪愝掕偡傞
*
* @param TInt aKeyGuidanceResId 僉乕僈僀僟儞僗偺ResId
* @param TBool &aErr ETrue:僉乕僈僀僟儞僗傪愝掕偟偨/EFalse:僉乕僈僀僟儞僗傪愝掕偟側偐偭偨(僟僀傾儘僌昞帵拞偺偨傔)
* @return void
*/
void CSmbMusicAPSinglePlayerView::SetNewKeyGuidanceL(TInt aKeyGuidance, TBool &aErr)
{
if(ENone == iShowDialog)
{
CSkonKeyGuidance *keyguidance = new(ELeave)CSkonKeyGuidance(NULL,this);
CleanupStack::PushL(keyguidance);
TResourceReader keyGuidanceResourceReader;
iCoeEnv->CreateResourceReaderLC(keyGuidanceResourceReader, aKeyGuidance);
keyguidance->ConstructFromResourceL(keyGuidanceResourceReader);
CleanupStack::PopAndDestroy(); // keyGuidanceResourceReader.
CleanupStack::Pop(keyguidance);
delete SwapKeyGuidance(keyguidance);
aErr = ETrue;
}
}
/**
* 夋柺忋偵昞帵偝傟傞僐儞僩儘乕儖傪庢摼偡傞
*
* @param TControlId aControlId 夋柺忋僐儞僩儘乕儖偵妱傝怳偭偨ID
* @return CCoeControl* 僐儞僩儘乕儖偺億僀儞僞
*/
CCoeControl* CSmbMusicAPSinglePlayerView::ComponentControl(TControlId aControlId) const
{
return CSmbAfView::ComponentControl(aControlId);
}
/**
* 夞悢妋擣僟僀傾儘僌
*
* @memo {nn}偺偁傞儚乕僨傿儞僌懳墳丅夞悢妋擣帪埲奜偵偼昞帵偟側偄偨傔愱梡偵偟偨
* @param TInt aCount(巆傝夞悢 0乣99)
* @return TInt CSkonSelectionDialog偺巇條(+ aCount偑懡偡偓(彮側偡偓)傞)
*/
TInt CSmbMusicAPSinglePlayerView::ShowCountConfirmDialogL(TInt aCount)
{
TInt count(0);
if(KMinPlayCount < aCount && KMaxPlayCount >= aCount)
{
count = aCount;
}
else if(KMaxPlayCount < aCount)
{
count = KMaxPlayCount;
}
// 僟僀傾儘僌傪暵偠傞
static_cast<CSakAppUi*>(CEikonEnv::Static()->EikAppUi())->CloseSakDialogsL();
iShowDialog = ESelection;
// 昞帵暥帤楍傪嶌傞
HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(R_SMB_AF_STR_MSG2534);
HBufC* new_message = SmbAfWordingFormatter::FormatLC(*message, count);
// 慖戰暥帤楍攝楍傪嶌傞
CDesCArrayFlat* itemTextArray = new(ELeave)CDesCArrayFlat(KNumberOfSelection); // 2戰傑偱偟偐堷悢偑側偄偺偱2
CleanupStack::PushL(itemTextArray);
// 慖戰巿0
HBufC* item0 = CEikonEnv::Static()->AllocReadResourceLC(R_SMB_AF_STR_ITM002);
itemTextArray->AppendL(*item0);
CleanupStack::PopAndDestroy(item0); // item0
// 慖戰巿1
HBufC* item1 = CEikonEnv::Static()->AllocReadResourceLC(R_SMB_AF_STR_ITM001);
itemTextArray->AppendL(*item1);
CleanupStack::PopAndDestroy(item1); // item1
CSkonSelectionDialog* dialog = new(ELeave) CSkonSelectionDialog();
dialog->ConstructLC();
dialog->SetTextL(*new_message);
dialog->SetItemTextArrayL(itemTextArray);
dialog->SetDefaultItemIndexL(KDefaultIndex); //0斣栚屌掕
dialog->DisableSoftKey1(ETrue); // 僜僼僩僉乕1柍岠
dialog->SetExResultMode(ETrue); // 奼挘暅婣抣儌乕僪 //ADD For D_82400011121
TInt res = dialog->ShowLD();
CleanupStack::PopAndDestroy(itemTextArray);
CleanupStack::PopAndDestroy(new_message);
CleanupStack::PopAndDestroy(message);
iShowDialog = ENone;
return res;
}
/**
* 慖戰僟僀傾儘僌偺昞帵
*
* @param TInt aResId 僟僀傾儘僌忋晹偵昞帵偡傞儊僢僙乕僕偺ResId
* @param TInt aSelection0 慖戰巿(0)
* @param TInt aSelection1 慖戰巿(1)
* @memo 僨僼僅儖僩僇乕僜儖埵抲偼index0
* @return TInt CSkonSelectionDialog偺巇條偵摨偠
*/
TInt CSmbMusicAPSinglePlayerView::ShowSelectionDialogL( TInt aResId,
TInt aSelection0,
TInt aSelection1,
TInt aDefaultIndex)
{
// 僟僀傾儘僌傪暵偠傞
static_cast<CSakAppUi*>(CEikonEnv::Static()->EikAppUi())->CloseSakDialogsL();
iShowDialog = ESelection;
// 昞帵暥帤楍傪嶌傞
HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(aResId);
// 慖戰暥帤楍攝楍傪嶌傞
CDesCArrayFlat* itemTextArray = new(ELeave)CDesCArrayFlat(KNumberOfSelection); // 2戰傑偱偟偐堷悢偑側偄偺偱2
CleanupStack::PushL(itemTextArray);
// 慖戰巿0
HBufC* item0 = CEikonEnv::Static()->AllocReadResourceLC(aSelection0);
itemTextArray->AppendL(*item0);
CleanupStack::PopAndDestroy(item0); // item0
// 慖戰巿1
HBufC* item1 = CEikonEnv::Static()->AllocReadResourceLC(aSelection1);
itemTextArray->AppendL(*item1);
CleanupStack::PopAndDestroy(item1); // item1
CSkonSelectionDialog* dialog = new(ELeave) CSkonSelectionDialog();
dialog->ConstructLC();
dialog->SetTextL(*message);
dialog->SetItemTextArrayL(itemTextArray);
dialog->SetDefaultItemIndexL(aDefaultIndex);
dialog->DisableSoftKey1(ETrue); // 僜僼僩僉乕1柍岠
dialog->SetExResultMode(ETrue); // 奼挘暅婣抣儌乕僪 //ADD For D_82400011121
TInt res = dialog->ShowLD();
CleanupStack::PopAndDestroy(itemTextArray);
CleanupStack::PopAndDestroy(message);
iShowDialog = ENone;
return res;
}
/**
* 妋擣僟僀傾儘僌偺昞帵
*
* @param TInt aResId 僟僀傾儘僌偵昞帵偡傞儊僢僙乕僕偺ResId
* @param TBool aIsAutoDelete 帺摦徚嫀偡傞偐偳偆偐(default = ETrue(徚嫀偡傞))
* @return TInt CSkonConfirmDialog偺巇條偵摨偠
*/
TInt CSmbMusicAPSinglePlayerView::ShowConfirmDialogL(TInt aResId, TBool aIsAutoClose)
{
// 僟僀傾儘僌傪暵偠傞
static_cast<CSakAppUi*>(CEikonEnv::Static()->EikAppUi())->CloseSakDialogsL();
iShowDialog = EConfirm;
// 昞帵暥帤楍傪嶌傞
HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(aResId);
CSkonConfirmDialog* dialog = new(ELeave) CSkonConfirmDialog();
dialog->ConstructLC();
dialog->SetTextL(*message);
if(EFalse == aIsAutoClose)
{
dialog->SetAutoCloseTime(0); //帺摦徚嫀偟側偄
//add-S D_82400003894
dialog->SetTextOmitType(ESkonDialogTextShowAll);
//add-E D_82400003894
}
TInt res = dialog->ShowLD();
CleanupStack::PopAndDestroy(message);
iShowDialog = ENone;
return res;
}
/**
* 寈崘僟僀傾儘僌偺昞帵
*
* @param TInt 僟僀傾儘僌偵昞帵偡傞儊僢僙乕僕偺ResId
* @return TInt CSkonWarningDialog偺巇條偵摨偠
*/
TInt CSmbMusicAPSinglePlayerView::ShowWarningDialogL(TInt aResId, TBool aIsAutoClose)
{
// 僟僀傾儘僌傪暵偠傞
static_cast<CSakAppUi*>(CEikonEnv::Static()->EikAppUi())->CloseSakDialogsL();
iShowDialog = EWarning;
// 昞帵暥帤楍傪嶌傞
HBufC* message = CEikonEnv::Static()->AllocReadResourceLC(aResId);
CSkonWarningDialog* dialog = new(ELeave) CSkonWarningDialog();
dialog->ConstructLC();
dialog->SetTextL(*message);
if(EFalse == aIsAutoClose)
{
dialog->SetAutoCloseTime(0); //帺摦徚嫀偟側偄
//add-S D_82400003894
dialog->SetTextOmitType(ESkonDialogTextShowAll);
//add-E D_82400003894
}
User::After(KDelay); // 寈崘壒偑柭傜側偄偙偲偑偁傞偨傔丄旝柇側Delay傪擖傟傞(壒惡僷僗愗傝懼偊帪偲摨偠抣)
TInt res = dialog->ShowLD();
CleanupStack::PopAndDestroy(message);
iShowDialog = ENone;
return res;
}
/**
* 嶍彍忬嫷恑峴僟僀傾儘僌傪昞帵偡傞
*
* @param 側偟
* @return void
*/
void CSmbMusicAPSinglePlayerView::ShowProgressDialogL()
{
// 嶍彍恑峴僟僀傾儘僌傪昞帵偟偰偄傞偲偄偆偙偲偼丄夋柺忬懺偼嶍彍丅堦嬋嵞惗偼偦偺屻廔椆偡傞偺偱丄忬懺傪曄偊偰偟傑偆
iState = ESmbMusicAPSinglePlayerNumberOfPlayState;
iShowDialog = EProgress;
iProgressDialog = CSmbMusicAPLibProgressDialog::NewL(R_PROGRESS_DIALOG);
iProgressDialog->ShowL(EDialogHalfSecond);
iProgressDialog->DisableClearKey(ETrue);
CSkonCompoundProgressLabel* label = iProgressDialog->ProgressLabel();
label->SetFinalValue(60); // 巄掕(傒側偟dialog側偺偱摿偵巜掕偼側偄)
}
/**
* 嶍彍忬嫷恑峴僟僀傾儘僌傪徚偡
*
* @param 側偟
* @return void
*/
void CSmbMusicAPSinglePlayerView::CloseProgressDialog()
{
if(NULL == iProgressDialog)
{
return;
}
CSkonCompoundProgressLabel* label = iProgressDialog->ProgressLabel();
label->SetAndDraw(60); // 巄掕
iProgressDialog->Close();
iShowDialog = ENone;
delete iProgressDialog;
iProgressDialog = NULL;
}
/**
* 嶍彍恑峴僟僀傾儘僌傪峏怴偡傞
*
* @param 側偟
* @return void
*/
void CSmbMusicAPSinglePlayerView::UpdateProgressDialog()
{
if(NULL == iProgressDialog)
{
return;
}
CSkonCompoundProgressLabel* label = iProgressDialog->ProgressLabel();
TInt currentValue = label->CurrentValue();
TInt value = (label->FinalValue() - currentValue)/4; // 傒側偟
label->SetAndDraw(currentValue + value);
}
/**
* 僗僺乕僇乕偺夋憸傪昤夋偡傞
*
* @param TBool aBool EFalse:捠忢/ETrue:儈儏乕僩
* @return void
*/
void CSmbMusicAPSinglePlayerView::DrawMuteSpeaker(TBool aBool)
{
if(aBool == iMute)
{
return;
}
// 儈儏乕僩偲捠忢偺2庬椶偺夋憸側偺偱丄Bool傪偦偺傑傑巊偭偰偄傞
iMute = aBool;
TInt index = static_cast<TInt>(aBool);
CSkonImageLabel* image = static_cast<CSkonImageLabel*>(ComponentControl(EVolumeImg));
image->SetPicture(iSpeakerIcon[index]->Bitmap(), iSpeakerIcon[index]->Mask());
image->DrawDeferred();
}
/**
* LCD偺僷儚乕惂屼傪愝掕偡傞
*
* @param TBool aBool ETrue:LCDPowerSaveOFF/EFalse:LCDPowerSave
*/
void CSmbMusicAPSinglePlayerView::SetLCDPowerSaveOffL(TBool aBool)
{
if(aBool != iSetLcdPowerSaveOff)
{
iSetLcdPowerSaveOff = aBool;
if(EFalse != iSetLcdPowerSaveOff)
{
PGBackLights::TPGDataItems backLight;
backLight.iSettingFlag = PGBackLights::ELcdPW | PGBackLights::ELcdTime ;
backLight.iLcdPW = ETrue; // LCD僶僢僋儔僀僩揰摂巜掕
backLight.iLcdTime = PGBackLights::ELcdPwlTimeInfinite; // LCD揰摂帪娫(柍惂尷)
PGBackLights::SetAllDataL(iAfEnv.PropAgent(), backLight);
}
else
{
PGBackLights::ApplyUserSettingL(iAfEnv.PropAgent());
}
}
}
/**
* 嬫娫嵞惗拞偐偳偆偐
*
* @param 側偟
* @return TBool ETrue:嬫娫嵞惗拞/EFalse:慡懱嵞惗拞
*/
TBool CSmbMusicAPSinglePlayerView::IsCpPlay() const
{
return static_cast<CSmbMusicAPSinglePlayerAppUi*>(iEikonEnv->EikAppUi())->IsCpPlay();
}
/**
* 嬫娫嵞惗摢弌偟拞偐偳偆偐傪庢摼偡傞
*
* @return TBool ETrue:嬫娫嵞惗摢弌偟拞/EFalse:嬫娫嵞惗摢弌偟拞偱偼側偄
* @param 側偟
*/
TBool CSmbMusicAPSinglePlayerView::IsSetSongHeadInCpPlay() const
{
return static_cast<CSmbMusicAPSinglePlayerAppUi*>(iEikonEnv->EikAppUi())->IsSetSongHeadRequestInCpPlay();
}
/**1
* 嵟弶偺壒柭摦偑偁偭偨偐偳偆偐
*
* @param void
* @return TBool ETrue:嵟弶偺壒柭摦偑偁偭偨/EFalse:壒柭摦慜
* @memo 尰忬丄摢弌偟張棟嬛巭偵偺傒棙梡<br>
* 憗栠偟/憗憲傝/掆巭側偳偵棙梡偡傞丒嵟弶偱偼側偔僾儗僀儎惂屼偲偺Connect傑偱奼挘摍偼梫専摙(摦嶌偑撦偔側傞偨傔)
*/
TBool CSmbMusicAPSinglePlayerView::IsStartPlay()
{
return iStartPlay;
}
/**
* 嵟弶偺壒柭摦偑偁偭偨偐偳偆偐傪愝掕偡傞
*
* @param TBool ETrue:嵟弶偺壒柭摦偑偁偭偨/EFalse:壒柭摦慜
* @return void
* @memo 捠忢嵞惗壒柭摦奐巒帪偵忢偵ETrue傪愝掕偟偵偒偰偄傞丅<br>
* 摢弌偟惂屼偺偨傔偩偗偺僼儔僌丅摢弌偟側傜偽壒柭摦慜偵懸偪峔偊傞昁梫偼側偄偨傔棙梡壜擻
*/
void CSmbMusicAPSinglePlayerView::SetStartPlay(TBool aBool)
{
iStartPlay = aBool;
}
/**
* 嬋摢偱偺僉乕僈僀僟儞僗愝掕傪峴偆
*
* @memo ADD For 82400014729
* @param aDrawNow EDrawNow 嵞昤夋桳柍
* @return void
*/
void CSmbMusicAPSinglePlayerView::SetSongHead(TDrawNow aDrawNow)
{
iCurrentRightLeftArrowState &= ~ESkonKeyGuidanceArrowLeft;
if(EDrawNow == aDrawNow)
{
KeyGuidance()->DrawNow();
}
}
SEMCJ_NAMESPACE_END
// end of SmbMusicAPSinglePlayerView.cpp
/* Copyright (C) 2007Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -