📄 audioplayerengine.cpp
字号:
/*
* ============================================================================
* Name : CAudioPlayerEngine from AudioPlayerEngine.cpp
* Part of : AudioPlayer
* Created : 31.01.2006 by ToBeReplacedByAuthor
* Implementation notes:
*
* Version :
* Copyright: ToBeReplacedByCopyright
* ============================================================================
*/
// INCLUDE FILES
#include "AudioPlayerEngine.h"
// ================= MEMBER FUNCTIONS =======================
// Two-phased constructor.
CAudioPlayerEngine* CAudioPlayerEngine::NewL(MObserver& aObserver)
{
CAudioPlayerEngine* self = new (ELeave) CAudioPlayerEngine( aObserver );
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop();
return self;
}
// destructor
CAudioPlayerEngine::~CAudioPlayerEngine()
{
Stop();
}
//
void CAudioPlayerEngine::MapcInitComplete(TInt aError,
const TTimeIntervalMicroSeconds& aDuration)
{
if (aError==KErrNone)
{
iAudioPlayer->SetVolume(iAudioPlayer->MaxVolume());
iAudioPlayer->Play();
}
else
{
Stop();
iObserver.OnComplete(aError);
}
}
//
void CAudioPlayerEngine::MapcPlayComplete(TInt aError)
{
Stop();
iObserver.OnComplete(aError);
}
//
void CAudioPlayerEngine::PlayL(const TFileName& aFileName)
{
Stop();
iAudioPlayer = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this);
}
//
void CAudioPlayerEngine::Stop()
{
if (iAudioPlayer)
{
iAudioPlayer->Stop();
}
delete iAudioPlayer;
iAudioPlayer = NULL;
}
// constructor
CAudioPlayerEngine::CAudioPlayerEngine(MObserver& aObserver)
: iObserver(aObserver)
{
}
// EPOC default constructor can leave.
void CAudioPlayerEngine::ConstructL()
{
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -