📄 sound.cpp
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -