sound.cpp
来自「symbian 的lian-liankan」· C++ 代码 · 共 57 行
CPP
57 行
// Sound.cpp: implementation of the CPLayer class.
//
//////////////////////////////////////////////////////////////////////
#include "Sound.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CSound::~CSound()
{
delete iMdaAudioPlayerUtility;
iMdaAudioPlayerUtility=NULL;
}
CSound* CSound::NewLC(const TDesC& aFile)
{
CSound* self=new (ELeave)CSound();
CleanupStack::PushL(self);
self->ConstructL(aFile);
return self;
}
CSound* CSound::NewL(const TDesC& aFile)
{
CSound* self=NewLC(aFile);
CleanupStack::Pop(self);
return self;
}
void CSound::ConstructL(const TDesC& aFile)
{
iState=ENotReady;
iMdaAudioPlayerUtility=CMdaAudioPlayerUtility::NewFilePlayerL(aFile, *this);
}
void CSound::Play()
{
iMdaAudioPlayerUtility->Play();
iState = EPlaying;
}
void CSound::Stop()
{
iMdaAudioPlayerUtility->Stop();
iState = EReadyToPlay;
}
void CSound::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration)
{
}
void CSound::MapcPlayComplete(TInt aError)
{
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?