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

📄 smbmusicapsingleplayernotify.cpp

📁 symbian代码
💻 CPP
字号:
/*----------------------------------------------------------------------------*/
// Copyright (c) 2004 Sony Ericsson Mobile Communications Japan, Inc.
// All rights reserved.
/*----------------------------------------------------------------------------*/
// FileName:
//  SmbMusicAPSinglePlayerNotify.cpp
//   
// Description:
//	堦嬋嵞惗僾儗僀儎乕MW僾儗僀儎乕惂屼忣曬捠抦僋儔僗
//
//	Modify:
//	2007-02-01	PTX824Start
/*------------------------------------------------------------------------*/
// $NoKeywords: $

#ifndef SMBMUSICAPSINGLEPLAYERNOTIIFY_H_
#include "SmbMusicAPSinglePlayerNotify.h"	//	堦嬋嵞惗僾儗僀儎乕MW僾儗僀儎乕惂屼忣曬捠抦僋儔僗
#endif	//SMBMUSICAPSINGLEPLAYERNOTIIFY_H_

#ifndef SMBMUSICAPSINGLEPLAYERMODEL_H_
#include "SmbMusicAPSinglePlayerModel.h"	//	堦嬋嵞惗僾儗僀儎乕Model
#endif //SMBMUSICAPSINGLEPLAYERMODEL_H_

#ifndef __SMBMUSICMWPLAYERIF_H__
#include <SmbMusicMWPlayerIF.h>				//	MW僾儗僀儎乕惂屼IF
#endif	//__SMBMUSICMWPLAYERIF_H__

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

SEMCJ_NAMESPACE_BEGIN

#ifdef _DEBUG
_LIT(KPanicCategory, "SMBMUSICSINGLEPLAYERNOTIFY");
#endif

_LIT(KNotify, "SmbMusicAPSinglePlayerNotify");

/**
 *	僨僗僩儔僋僞
 *
 *	@prama 	側偟
 */
CSmbMusicAPSinglePlayerNotify::~CSmbMusicAPSinglePlayerNotify()
	{
	Cancel();
	}


/**
 *	僼傽僋僩儕娭悢
 *
 *	@param	RSmbMusicMWPlayerSession* aSession		儈儏乕僕僢僋MW僾儗僀儎乕惂屼
 *	@param	CSmbMusicAPSinglePlayerModel* aModel	堦嬋嵞惗僾儗僀儎乕儌僨儖
 *	@return CSmbMusicAPSinglePlayerNotify*			堦嬋嵞惗僾儗僀儎乕MW僾儗僀儎乕惂屼忣曬捠抦僋儔僗億僀儞僞
 */
CSmbMusicAPSinglePlayerNotify* CSmbMusicAPSinglePlayerNotify::NewL(RSmbMusicMWPlayerSession* aSession,
																				CSmbMusicAPSinglePlayerModel* aController)
	{
	CSmbMusicAPSinglePlayerNotify* self = new(ELeave) CSmbMusicAPSinglePlayerNotify(aSession, aController);
	return self;
	}

/**
 *	旕摨婜張棟廔椆屻張棟
 *	
 *	@param	側偟
 *	@return void
 */
void CSmbMusicAPSinglePlayerNotify::RunL()
	{
	TInt ret = 	iStatus.Int();

	SmbMusicAPSinglePlayerLog::OutputLog(KNotify, ENotify, ELogLevelLowest,_L("event:%d state:%d modifycause:%d failcause:%d") ,iPlayerInfo.iPlayerEvent ,iPlayerInfo.iPlayState, iPlayerInfo.iModifyCause, iPlayerInfo.iPlayFailCause);	

	if(KErrNone != ret)
		{
		SmbMusicAPSinglePlayerLog::OutputLog(KNotify, ENotify, ELogLevelNormal,_L("Notify(RunL)Error:%d") ,ret);
		User::Leave(ret);
		}
	
	iController->PlayerStateChangedL(iPlayerInfo);
	}

/**
 *	僾儗僀儎乕忬懺曄峏捠抦梫媮
 *
 *	@param	側偟
 *	@return void
 */
void CSmbMusicAPSinglePlayerNotify::SetNotifyPlayerEventL()
	{
	SmbMusicAPSinglePlayerLog::OutputLog(KNotify, ENotify, ELogLevelLowest,_L("SetNotify"));
	
	TInt err = iSession->SetNotifyPlayerEvent(iStatus, iPlayerInfo);

	if(KErrNone != err)
		{
		SmbMusicAPSinglePlayerLog::OutputLog(KNotify, ENotify, ELogLevelNormal,_L("SetNotifyPlayerEventL Err:%d"), err);
		User::Leave(err);
		}
		
	SetActive();
	}

/**
 *	旕摨婜梫媮僉儍儞僙儖張棟
 *
 *	@param	側偟
 *	@return void
 */
void CSmbMusicAPSinglePlayerNotify::DoCancel()
	{
	// 曉傝抣偵墳偠偰摿偵張棟傪曄偊傞昁梫偑側偄偨傔丄曉傝抣傪柍帇
	TInt ret = iSession->CancelNotifyPlayerEvent();
	if(KErrNone != ret)
		{
		SmbMusicAPSinglePlayerLog::OutputLogWithServerConnect(KNotify, ENotify, ELogLevelLowest,_L("SetNotifyPlayerEventLCancelErr:%d"), ret);
		}
	}

/////private////////////////////
/**
 *	僐儞僗僩儔僋僞
 *	
 *	@param RSmbMusicMWPlayerSession*	aSession	儈儏乕僕僢僋MW僾儗僀儎乕惂屼
 *	@param	CSmbMusicAPSinglePlayerModel*	aModel	堦嬋嵞惗僾儗僀儎乕儌僨儖
 */
CSmbMusicAPSinglePlayerNotify::CSmbMusicAPSinglePlayerNotify(RSmbMusicMWPlayerSession* aSession,
															CSmbMusicAPSinglePlayerModel* aController)
	: 	CActive(EPriorityStandard),
		iController(aController),
		iSession(aSession)	
	{
	__ASSERT_DEBUG(aSession != NULL, 
					User::Panic(KPanicCategory, EInvalidArgument));
	__ASSERT_DEBUG(aController != NULL, 
					User::Panic(KPanicCategory, EInvalidArgument));
	CActiveScheduler::Add(this);
	}	

SEMCJ_NAMESPACE_END
// end of SmbMusicAPSinglePlayerNotify.cpp
/* Copyright (C) 2007 Sony Ericsson Mobile Communications Japan, Inc. */

⌨️ 快捷键说明

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