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

📄 smbmusicapsingleplayerview.cpp

📁 symbian代码
💻 CPP
📖 第 1 页 / 共 4 页
字号:
/*----------------------------------------------------------------------------*/
// Copyright (c) 2004 Sony Ericsson Mobile Communications Japan, Inc.
// All rights reserved.
/*----------------------------------------------------------------------------*/
// FileName:
//  SmbMusicAPSinglePlayerView.cpp
//   
// Description:
//	儈儏乕僕僢僋堦嬋嵞惗夋柺昞帵
//
// Modify:
//	2006-07-07	僐乕僪惍棟	K3Hirono
//	2006-07-11	MW偲偺Disconnect慜張棟偵巊偆偨傔丄尰嵼偺嵞惗忬懺傪.
//				庢摼偡傞娭悢傪捛壛	K3Hirono
//	2006-08-05	僞僀儅娭楢傪command僋儔僗偵堏摦	K3Hirono
//				嵞惗宱夁帪娫昞帵埵抲偺嵗昗傪廋惓	K3Hirono
//	2006-08-09	夋柺昤夋埵抲傪曄峏	K3Hirono
//	2006-08-16	僋儕傾僉乕慗堏偺張棟傪曄峏	K3Hirono
//	2006-08-24	儈儏乕僩僗僺乕僇乕昤夋婡擻傪捛壛	K3hirono
//	2006-08-29	CurrentArrowState堦帪掆巭忬懺偵嵍仮傪捛壛	K3Hirono
//
//	2007-02-01	PTX824Start
//	2007-06-26	D_82400003894Confirm丒WarningDialog昞帵帪丄帺摦徚嫀傪峴傢側偄応崌偼僗僋儘乕儖傪峴偆傛偆愝掕傪捛壛
//				D_82400004307僒僽僗僋儕僾僔儑儞僐儞僥儞僣嵞惗惂尷偺専嵏桳柍梡偺廋惓(昁偢専嵏偡傞傛偆偵側偭偰偄傞)
//	2007-07-03	offerKeyEventL偺嫇摦曄峏(枹僨儕僶乕尰忬僐儊儞僩傾僂僩)
//	2007-07-03	D_82400005934婲摦帪偼忢偵壒検偑0傪廋惓(View惗惉帪偵弶婜抣愝掕)
//	2007-07-31	D_82400000632,D_82400004756
//	2007-08-07	D_82400009859,D_82400009861
//	2007-09-12	D_82400014729	僉乕僈僀僟儞僗仯偺僞僀儈儞僌偲丄壒検昞帵偺廋惓
//	2007-09-19	D_82400015332	offerKeyEventL丄僋儕傾丒嵍墴壓帪張棟偺廋惓
/*------------------------------------------------------------------------*/
// $NoKeywords: $

#ifndef SMBMUSICAPSINGLEPLAYERVIEW_H_
#include "SmbMusicAPSinglePlayerView.h"		//	堦嬋嵞惗僾儗僀儎乕View
#endif	//SMBMUSICAPSINGLEPLAYERVIEW_H_

#ifndef SMBMUSICAPSINGLEPLAYERAPPUI_H_
#include "SmbMusicAPSinglePlayerAppUi.h"	//	堦嬋嵞惗僾儗僀儎乕AppUi
#endif	//SMBMUSICAPSINGLEPLAYERAPPUI_H_

#ifndef SMBMUSICAPSINGLEPLAYERUTILS_H_
#include "SmbMusicAPSinglePlayerUtils.h"	//	堦嬋嵞惗僾儗僀儎乕Util
#endif	//SMBMUSICAPSINGLEPLAYERUTILS_H_

#ifndef __SMBMUSICAPSINGLEPLAYEREXTERNALINTERFACE_H__
#include "SmbMusicAPSinglePlayerExternalInterface.h"	//	堦嬋嵞惗僾儗僀儎乕Interface
#endif	//__SMBMUSICAPSINGLEPLAYEREXTERNALINTERFACE_H__

#ifndef __SMBMUSICMWLIBCLIENT_H__
#include <SmbMusicMWLibClient.h>		//	MW儔僀僽儔儕僋儔僀傾儞僩(忣曬庢摼帪偺峔憿懱偺偨傔)
#endif	//__SMBMUSICMWLIBCLIENT_H__

#ifndef __SMBPGMUSIC_H__
#include <SmbPGMusic.h>		//	堦嬋嵞惗僾儗僀儎忬懺.
#endif	//__SMBPGMUSIC_H__

#ifndef FJAFENV_H__
#include <FjAfEnv.h>	//AfEnv
#endif	//FJAFENV_H__

#ifndef FJWCDMAMPKEYS_H__
#include <FJWcdmaMpKeys.h>	//	僉乕張棟
#endif	//FJWCDMAMPKEYS_H__

#ifndef SMBMUSICAPSINGLEPLAYERDISPTIMECTRL_H_
#include "SmbMusicAPSinglePlayerDispPlayTimeCtrl.h"
#endif	//SMBMUSICAPSINGLEPLAYERDISPTIMECTRL_H_
	
#ifndef __SKONIMAGELABEL_H__
#include <SkonImageLabel.h>				//	僀儊乕僕儔儀儖.
#endif	//__SKONIMAGELABEL_H__

#ifndef __SKONCOMPOUNDPROGRESSLABEL_H__
#include <SkonCompoundProgressLabel.h>	//	恑峴忬嫷昞帵僟僀傾儘僌偺僾儘僌儗僗僶乕晹暘.
#endif	//__SKONCOMPOUNDPROGRESSLABEL_H__

#ifndef __SMBMUSICAPLIBPROGRESSDIALOG_H__
#include "SmbMusicAPLibProgressDialog.h"	//	恑峴忬嫷昞帵僟僀傾儘僌.
#endif	//__SMBMUSICAPLIBPROGRESSDIALOG_H__

#ifndef SMBMUSICAPSINGLEPLAYERLOG_H_
#include "SmbMusicAPSinglePlayerLog.h"	//	儘僌
#endif	//SMBMUSICAPSINGLEPLAYERLOG_H_

#ifndef __SMBAFWORDINGFORMATTER_H__
#include <SmbAfWordingFormatter.h>
#endif
//	夋憸
#include <Photo.mbg>		//	壒検丒宱夁帪娫偺悢帤
#include <Music.mbg>
#include <Movie.mbg>

USING_NAMESPACE_DCM
SEMCJ_NAMESPACE_BEGIN

#include <SmbAfWording.rsg>				//	儚乕僨傿儞僌
#include <SmbMusicAPSinglePlayer.rsg>	//	僉乕僈僀僟儞僗懠儕僜乕僗

#ifndef SMBMUSICAPSINGLEPLAYERVIEWDATA_H_
#include "SmbMusicAPSinglePlayerViewData.h"		//	堦嬋嵞惗僾儗僀儎乕ViewData
#endif	//SMBMUSICAPSINGLEPLAYERVIEWDATA_H_

///////////////////////////////////////////////////////////////////////////////
// CSmbMusicAPSinglePlayerView
/**
 *	僐儞僗僩儔僋僞
 *
 *	@param	TUint32 aVolume 壒検弶婜抣
 */
//MOD-S D_82400005933 堷悢捛壛
CSmbMusicAPSinglePlayerView::CSmbMusicAPSinglePlayerView(TUint32 aVolume)
//MOD-E D_82400005933
	: 	CSmbAfView(KSmbMusicAPSinglePlayerViewParam),
		iState(ESmbMusicAPSinglePlayerNumberOfPlayState),
		//ADD-S D_82400005933
		iVolume(aVolume),
		//ADD-E D_82400005933
		iShowDialog(ENone),
		iSetLcdPowerSaveOff(EFalse),
		//ADD-S D_82400014729
		iCurrentRightLeftArrowState(KCurrentArrowNone),
		iCurrentUpDownArrowState(KCurrentArrowNone)
		//ADD-E D_82400014729
    {
    }

/**
 *	僨僗僩儔僋僞
 *
 *	@param 側偟
 */
CSmbMusicAPSinglePlayerView::~CSmbMusicAPSinglePlayerView()
	{
	//	恑峴忬嫷昞帵僟僀傾儘僌
	delete iProgressDialog;

	//	壒検昞帵悢帤晹暘夋憸
	iVolumeIcon.ResetAndDestroy();
	iVolumeIcon.Close();
	
	//	嬋柤丒傾乕僥傿僗僩柤丒傾儖僶儉柤偺慜偵昞帵偡傞夋憸
	iSongInfoIcon.ResetAndDestroy();
	iSongInfoIcon.Close();
	
	//	嵞惗忬懺昞帵梡夋憸
	iStateIcon.ResetAndDestroy();
	iStateIcon.Close();
	
	//	僗僺乕僇乕丒亊僗僺乕僇乕夋憸
	iSpeakerIcon.ResetAndDestroy();
	iSpeakerIcon.Close();
	}


/**
 *	夋柺忋偵攝抲偡傞僐儞僩儘乕儖晹昳偺弶婜壔偲 View 傊偺搊榐傪偍偙側偆丅
 *	
 *	@param 側偟
 *	@return void
 */
void CSmbMusicAPSinglePlayerView::DoConstructContainerL()
    {
	//	夋柺晹昳傪嶌傞				
	//	僕儍働幨
	CSkonImageLabel* label = new(ELeave)CSkonImageLabel();
	CleanupStack::PushL(label);
	label->SetContainerWindowL(*this);
	label->ConstructL(ETrue);
	label->SetPictureOwnedExternally(ETrue);
	CleanupStack::Pop(label);
	label->SetNonFocusing();
	AddControlL(label);

	
	//	壒検(僗僺乕僇乕夋憸)
	CSkonImageLabel* volumeLabel = new(ELeave) CSkonImageLabel();
	CleanupStack::PushL(volumeLabel);
	volumeLabel->SetContainerWindowL(*this);
	volumeLabel->ConstructL(ETrue);
	CleanupStack::Pop(volumeLabel);
	volumeLabel->SetNonFocusing();
	volumeLabel->SetPictureOwnedExternally(ETrue);
	AddControlL(volumeLabel);
	
	//	壒検(僾儘僌儗僗僶乕)
	CSkonProgressBar* volume = new(ELeave) CSkonProgressBar();
	CleanupStack::PushL(volume);
	volume->ConstructL(ESkonProgressPattern2);
	volume->SetFinalValue(KMaxVolume);
	volume->SetContainerWindowL(*this);
	CleanupStack::Pop(volume);
	volume->SetNonFocusing();
	AddControlL(volume);

	//	婎杮忣曬(textLabel * 3(combinedtext))
	CSkonTextLabel* songName = new(ELeave) CSkonTextLabel();
	CleanupStack::PushL(songName);
	songName->SetContainerWindowL(*this);
	songName->ConstructL();
	songName->SetTransparent(ETrue);
	songName->SetContainerWindowL(*this);
	CleanupStack::Pop(songName);
	songName->SetNonFocusing();
	AddControlL(songName);

	CSkonTextLabel* albumName = new(ELeave) CSkonTextLabel();
	CleanupStack::PushL(albumName);
	albumName->SetContainerWindowL(*this);
	albumName->ConstructL();
	albumName->SetTransparent(ETrue);
	albumName->SetContainerWindowL(*this);
	CleanupStack::Pop(albumName);
	albumName->SetNonFocusing();
	AddControlL(albumName);

	CSkonTextLabel* artistName = new(ELeave) CSkonTextLabel();
	CleanupStack::PushL(artistName);
	artistName->SetContainerWindowL(*this);
	artistName->ConstructL();
	artistName->SetTransparent(ETrue);
	artistName->SetContainerWindowL(*this);
	CleanupStack::Pop(artistName);
	artistName->SetNonFocusing();
	AddControlL(artistName);
		
	//	嵞惗宱夁帪娫(僾儘僌儗僗僶乕)
	CSkonProgressBar* playTime = new(ELeave) CSkonProgressBar();
	CleanupStack::PushL(playTime);
	playTime->ConstructL(ESkonProgressPattern1);
	playTime->SetContainerWindowL(*this);
	CleanupStack::Pop(playTime);
	playTime->SetNonFocusing();
	AddControlL(playTime);
	
	CSmbMusicAPSinglePlayerDispPlayTimeCtrl* dispPlayTime = new(ELeave)CSmbMusicAPSinglePlayerDispPlayTimeCtrl();
	CleanupStack::PushL(dispPlayTime);
	dispPlayTime->ConstructL(iEikonEnv->DefaultDisplayMode());
	dispPlayTime->SetContainerWindowL(*this);
	CleanupStack::Pop(dispPlayTime);
	dispPlayTime->SetNonFocusing();
	AddControlL(dispPlayTime);
	
	// 價僢僩儅僢僾偺撉傒崬傒
	LoadBitmapL();

	volumeLabel->SetPicture(iSpeakerIcon[0]->Bitmap(), iSpeakerIcon[0]->Mask());	//	弶婜抣
	volumeLabel->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KVolumeLabelLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
							,TSizeOrg::MakeSize(KVolumeLabelSize));
//ADD-S D_82400005933
	volume->Set(iVolume);
//ADD-E D_82400005933

//ADD-S D_82400014729
	if(KMinVolume != iVolume)
		{
		iCurrentUpDownArrowState |= ESkonKeyGuidanceArrowDown;
		}
	if(KMaxVolume != iVolume)
		{
		iCurrentUpDownArrowState |= ESkonKeyGuidanceArrowUp;
		}
//ADD-E D_82400014729

//DEL-S	D_82400000632,D_82400004756
//	volume->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KVolumeProgressLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
//					,TSizeOrg::MakeSize(KVolumeProgressSize));
//DEL-E	D_82400000632,D_82400004756
//ADD-S D_82400000632,D_82400004756
	volume->SetPosition(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KVolumeProgressLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush)));
//ADD-E D_82400000632,D_82400004756
	
	playTime->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KPlayTimeProgressLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
						,TSizeOrg::MakeSize(KPlayTimeProgressSize));
	songName->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KSongLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
						,TSizeOrg::MakeSize(KInfoSize));	
	albumName->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KAlbumLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
						,TSizeOrg::MakeSize(KInfoSize));
	artistName->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KArtistLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush))
						,TSizeOrg::MakeSize(KInfoSize));
	dispPlayTime->SetExtent(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KPlayTimePoint), TPointOrg::MakePoint(KAdjustBrush))
						,dispPlayTime->MinimumSize());
    }

/**
 *	宱夁帪娫梡/儃儕儏乕儉梡/嬋忣曬昞帵梡價僢僩儅僢僾傪巊偆偨傔偺弨旛傪偡傞<br>
 *	[TBD]偪傖傫偲幪偰傞傋偒側傜丄峫偊傞
 *
 *	@param 側偟
 *	@return void
 *	@memo DoConstructContainerL()偺拞偱堦搙偩偗屇傃弌偝傟傞丅
 */
void CSmbMusicAPSinglePlayerView::LoadBitmapL()
	{
	//	壒検昞帵夋憸
	for(TInt i = 0; i < NumberOfNumberImage; i++)
		{
		SmbMusicAPSinglePlayerIconUtils::LoadIconL(KVolumeNumber[0][i], KVolumeNumber[1][i], iVolumeIcon, KSmbNumberBmpFileName);
		}
	

	//	嬋忣曬
	TRgb rgb = CSakProperty::SakSkinL()->SkonMusicSkinL()->Color(SkonMusicSkin::EIconColor); 
	for(TInt i = 0; i< KNumberOfSongInfoIcon; i++)
		{
		SmbMusicAPSinglePlayerIconUtils::LoadIconL(KSongInfo[i], rgb, TSizeOrg::MakeSize(KInfoImageSize), iSongInfoIcon, KSmbMusicBmpFileName);
		}

	//	嵞惗忬懺
	for(TInt i = 0; i < ESmbMusicAPSinglePlayerNumberOfPlayState + 1; i++)
		{
		SmbMusicAPSinglePlayerIconUtils::LoadIconL( KViewState[KImg][i], KViewState[KImg_m][i], iStateIcon, KSmbNumberBmpFileName);
		}
		
	//	僗僺乕僇乕
	for(TInt i = 0; i < KNumberOfSpeakerImage; i++)
		{
		SmbMusicAPSinglePlayerIconUtils::LoadIconL(KSpeaker[0][i], KSpeaker[1][i], iSpeakerIcon, KSmbMovieBmpFilename);
		}
	}
 
/**
 *	View 偺攚宨 (UI 僐儞僩儘乕儖偺攚宨) 傪昤夋偡傞丏
 *
 *	@param CBitmapContext &aGc
 *	@param	const TRect &aRect	昤夋椞堟
 *	@return void
 */
void CSmbMusicAPSinglePlayerView::Draw(CBitmapContext &aGc, const TRect &aRect) const
    {
    CSmbAfView::Draw (aGc, aRect);
//	壒検悢帤晹暘
//ADD-S D_82400014729
	if(0 < (iVolume / 10))
		{
//ADD-E D_82400014729
		aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPoint(KVolumeRect.iPointX, KVolumeRect.iPointY), TPointOrg::MakePoint(KAdjustBrush)),
				    iVolumeIcon[iVolume/10]->Bitmap(),
				    TRect(TPoint(0,0), TSize(KVolumeRect.iWidth, KVolumeRect.iHeight)),
				    iVolumeIcon[iVolume/10]->Mask(),
				    EFalse);
//ADD-S D_82400014729
		}
//ADD-E D_82400014729
		
	aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPoint(KVolumeRect.iPointX + KVolumeRect.iWidth, KVolumeRect.iPointY), TPointOrg::MakePoint(KAdjustBrush)),
					iVolumeIcon[iVolume%10]->Bitmap(),
					TRect(TPoint(0,0), TSize(KVolumeRect.iWidth, KVolumeRect.iHeight)),
					iVolumeIcon[iVolume%10]->Mask(),
					EFalse);

	//	嵞惗忬懺昞帵晹暘
	aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPoint(KPlayStateRect.iPointX, KPlayStateRect.iPointY), TPointOrg::MakePoint(KAdjustBrush)),
					iStateIcon[iState]->Bitmap(), 
					TRect(TPoint(0,0),TSize(KPlayStateRect.iWidth, KPlayStateRect.iHeight)),		
					iStateIcon[iState]->Mask(),
					EFalse);
	
	//	傾僀僐儞晹暘
	aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KSongImageLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush)),
					iSongInfoIcon[0]->Bitmap(), 
					TRect(TPoint(0,0),TSizeOrg::MakeSize(KInfoImageSize)),		
					iSongInfoIcon[0]->Mask(), 
					EFalse);
	
	aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KAlbumImageLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush)),
					iSongInfoIcon[1]->Bitmap(), 
					TRect(TPoint(0,0),TSizeOrg::MakeSize(KInfoImageSize)),		
					iSongInfoIcon[1]->Mask(), 
					EFalse);
	
	aGc.BitBltMasked(SmbMusicAPSinglePlayerIconUtils::AdjustPoint(TPointOrg::MakePoint(KArtistImageLeftTopPoint), TPointOrg::MakePoint(KAdjustBrush)),
					iSongInfoIcon[2]->Bitmap(), 
					TRect(TPoint(0,0),TSizeOrg::MakeSize(KInfoImageSize)),		
					iSongInfoIcon[2]->Mask(), 
					EFalse);
	    }
    


/**
 *	僉乕僀儀儞僩張棟(憗憲傝/栠偟/僋儕傾張棟)
 *	
 *	@param	const TKeyEvent& aKeyEvent	僉乕僀儀儞僩
 *	@param	TEventCode aType			僀儀儞僩僐乕僪
 *	@return	TKeyResponse				僉乕僀儀儞僩偑Handle偝傟偨偐偳偆偐
 */
TKeyResponse CSmbMusicAPSinglePlayerView::OfferKeyEventL(const TKeyEvent& aKeyEvent, 
											   TEventCode aType)
    {
   	TKeyResponse res = EKeyWasNotConsumed;
		
	if(EEventKeyUp == aType)	//	憗憲傝/栠偟偺応崌偵KeyUp偑棃偨
		{	
		SetLCDPowerSaveOffL(EFalse);
		if(ESmbMusicAPSinglePlayerPlayFF == iState && EStdKeyRightArrow == aKeyEvent.iScanCode)
			{
			ProcessCommandL(ESmbMusicAPSinglePlayerCmdExitPlayFF);
			res = EKeyWasConsumed;
			}
		else if(ESmbMusicAPSinglePlayerPlayFR == iState && EStdKeyLeftArrow == aKeyEvent.iScanCode)
			{
			ProcessCommandL(ESmbMusicAPSinglePlayerCmdExitPlayFR);
			res = EKeyWasConsumed;

⌨️ 快捷键说明

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