Hi,
since garden doesn't support phonon or QSound yet, i had tried to use the native symbian classes for that: I failed disgraceful, and now I assess Qt even more.
May someone could help me. Following is my current state of art after c&p various sample codes and snippets... All ends in the compiler message that
/Symbian/Carbide/workspace/sound/csoundplayer.cpp:36: undefined reference to `CMdaAudioPlayerUtility::NewFilePlayerL(TDesC16 const&, MMdaAudioPlayerCallback&, int, TMdaPriorityPreference, CMdaServer*)' make[2]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\relea se\gcce\udeb\sound.exe] Error 1
is there a specific *.lib I have to add is the *.mmp?
#ifndef AUDIOPLAYER_H_
#define AUDIOPLAYER_H_
#include <e32std.h>
#include <MdaAudioSamplePlayer.h>
class CPlayerUtility : public CBase, public MMdaAudioPlayerCallback
{
public:
static CPlayerUtility* NewL(const TDesC& aFileName);
static CPlayerUtility* NewLC(const TDesC& aFileName);
~CPlayerUtility();
private:
CPlayerUtility();
void ConstructL(const TDesC& aFileName);
public:
void Play();
void Stop();
public:
// from MMdaAudioToneObserver
void MapcInitComplete(TInt aError,
const TTimeIntervalMicroSeconds& aDuration);
void MapcPlayComplete(TInt aError);
private:
CMdaAudioPlayerUtility* iPlayUtility;
TBool iPlaying, iPrepared;
};
#endif /* AUDIOPLAYER_H_ */
#ifndef AUDIOPLAYER_H_
#define AUDIOPLAYER_H_
#include <e32std.h>
#include <MdaAudioSamplePlayer.h>
class CPlayerUtility : public CBase, public MMdaAudioPlayerCallback
{
public:
static CPlayerUtility* NewL(const TDesC& aFileName);
static CPlayerUtility* NewLC(const TDesC& aFileName);
~CPlayerUtility();
private:
CPlayerUtility();
void ConstructL(const TDesC& aFileName);
public:
void Play();
void Stop();
public:
// from MMdaAudioToneObserver
void MapcInitComplete(TInt aError,
const TTimeIntervalMicroSeconds& aDuration);
void MapcPlayComplete(TInt aError);
private:
CMdaAudioPlayerUtility* iPlayUtility;
TBool iPlaying, iPrepared;
};
#endif /* AUDIOPLAYER_H_ */
To copy to clipboard, switch view to plain text mode
#include "CSoundPlayer.h"
#include <MdaAudioSamplePlayer.h>
#include <eikmenup.h>
CPlayerUtility* CPlayerUtility::NewL(const TDesC& aFileName)
{
CPlayerUtility* self = NewLC(aFileName);
CleanupStack::Pop(self);
return self;
}
CPlayerUtility* CPlayerUtility::NewLC(const TDesC& aFileName)
{
CPlayerUtility* self = new (ELeave) CPlayerUtility();
CleanupStack::PushL(self);
self->ConstructL(aFileName);
return self;
}
CPlayerUtility::~CPlayerUtility()
{
if (iPlayUtility)
{
iPlayUtility->Stop();
iPlayUtility->Close();
}
delete iPlayUtility;
}
CPlayerUtility::CPlayerUtility()
{
}
void CPlayerUtility::ConstructL(const TDesC& aFileName)
{
iPlayUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this,
EMdaPriorityNormal);
iPlaying = iPrepared = EFalse;
}
void CPlayerUtility::Play()
{
iPlayUtility->Play();
iPlaying = ETrue;
}
void CPlayerUtility::Stop()
{
iPlayUtility->Stop();
iPlaying = EFalse;
}
void CPlayerUtility::MapcPlayComplete(TInt /*aError*/)
{
iPlaying = EFalse;
}
void CPlayerUtility::MapcInitComplete(TInt aError,
const TTimeIntervalMicroSeconds& /*aDuration*/)
{
if (aError == KErrNone)
{
iPrepared = ETrue;
iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
}
}
#include "CSoundPlayer.h"
#include <MdaAudioSamplePlayer.h>
#include <eikmenup.h>
CPlayerUtility* CPlayerUtility::NewL(const TDesC& aFileName)
{
CPlayerUtility* self = NewLC(aFileName);
CleanupStack::Pop(self);
return self;
}
CPlayerUtility* CPlayerUtility::NewLC(const TDesC& aFileName)
{
CPlayerUtility* self = new (ELeave) CPlayerUtility();
CleanupStack::PushL(self);
self->ConstructL(aFileName);
return self;
}
CPlayerUtility::~CPlayerUtility()
{
if (iPlayUtility)
{
iPlayUtility->Stop();
iPlayUtility->Close();
}
delete iPlayUtility;
}
CPlayerUtility::CPlayerUtility()
{
}
void CPlayerUtility::ConstructL(const TDesC& aFileName)
{
iPlayUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this,
EMdaPriorityNormal);
iPlaying = iPrepared = EFalse;
}
void CPlayerUtility::Play()
{
iPlayUtility->Play();
iPlaying = ETrue;
}
void CPlayerUtility::Stop()
{
iPlayUtility->Stop();
iPlaying = EFalse;
}
void CPlayerUtility::MapcPlayComplete(TInt /*aError*/)
{
iPlaying = EFalse;
}
void CPlayerUtility::MapcInitComplete(TInt aError,
const TTimeIntervalMicroSeconds& /*aDuration*/)
{
if (aError == KErrNone)
{
iPrepared = ETrue;
iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
}
}
To copy to clipboard, switch view to plain text mode
THANKS!
Bookmarks