- // Copyright (c) 2006 Nokia Corporation.
- #include "S60MMFLabUtility.h"
- #include "s60mmflab.hrh"
- #include <MdaAudioTonePlayer.h>
- #include <eikmenup.h>
- #include <aknnotewrappers.h>
- // TONE UTILITY
- _LIT(KToneLabel, "Tone Utility...");
- CS60MMFLabToneUtility::CS60MMFLabToneUtility()
- : iToneUtility(NULL)
- {
- // Do nothing
- }
- CS60MMFLabToneUtility* CS60MMFLabToneUtility::NewL()
- {
- CS60MMFLabToneUtility* self = NewLC();
- CleanupStack::Pop(self);
- return self;
- }
- CS60MMFLabToneUtility* CS60MMFLabToneUtility::NewLC()
- {
- CS60MMFLabToneUtility* self = new (ELeave) CS60MMFLabToneUtility();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
- void CS60MMFLabToneUtility::ConstructL()
- {
- const TInt KFrequency = 1000; // Hz
- const TTimeIntervalMicroSeconds KDuration =
- TTimeIntervalMicroSeconds(6000000); // 6 seconds
- }
- CS60MMFLabToneUtility::~CS60MMFLabToneUtility()
- {
- delete iToneUtility;
- }
- void CS60MMFLabToneUtility::MatoPrepareComplete(TInt aError)
- {
- _LIT(KWarningNote, "The tone utility could not be configured");
- }
- void CS60MMFLabToneUtility::MatoPlayComplete(TInt aError)
- {
- _LIT(KWarningNote, "The tone could not be played");
- }
- const TDesC& CS60MMFLabToneUtility::GetLabel()
- {
- return KToneLabel;
- }
- void CS60MMFLabToneUtility::Play()
- {
- }
- void CS60MMFLabToneUtility::CancelPlay()
- {
- }
- void CS60MMFLabToneUtility::SetOptionsMenuL(CEikMenuPane* aMenuPane)
- {
- switch (state)
- {
- case EMdaAudioToneUtilityNotReady:
- break;
- case EMdaAudioToneUtilityPrepared:
- break;
- case EMdaAudioToneUtilityPlaying:
- break;
- default:
- break;
- }
- }
- // AUDIO PLAYER UTILITY
- _LIT(KPlayerLabel, "Player Utility");
- _LIT(KPlayerFile, "C:\Data\audio_sample.amr");
- CS60MMFLabPlayerUtility::CS60MMFLabPlayerUtility()
- : iPlayerUtility(NULL), iState(EPlayerNotReady)
- {
- // Do nothing
- }
- CS60MMFLabPlayerUtility* CS60MMFLabPlayerUtility::NewL()
- {
- CS60MMFLabPlayerUtility* self = NewLC();
- CleanupStack::Pop(self);
- return self;
- }
- CS60MMFLabPlayerUtility* CS60MMFLabPlayerUtility::NewLC()
- {
- CS60MMFLabPlayerUtility* self = new (ELeave) CS60MMFLabPlayerUtility();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
- void CS60MMFLabPlayerUtility::ConstructL()
- {
- }
- CS60MMFLabPlayerUtility::~CS60MMFLabPlayerUtility()
- {
- delete iPlayerUtility;
- }
- void CS60MMFLabPlayerUtility::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
- {
- _LIT(KWarnNote, "The audio player utility could not be initialised");
- switch(aError)
- {
- case KErrNone:
- break;
- default:
- {
- CAknWarningNote* warnNote = new (ELeave) CAknWarningNote;
- warnNote->ExecuteLD( KWarnNote );
- break;
- }
- }
- }
- void CS60MMFLabPlayerUtility::MapcPlayComplete(TInt aError)
- {
- _LIT(KWarningNote, "The audio file could not be played");
- if (aError == KErrNone)
- {
- CAknWarningNote* warnNote = new (ELeave) CAknWarningNote;
- warnNote->ExecuteLD( KWarningNote );
- }
- }
- const TDesC& CS60MMFLabPlayerUtility::GetLabel()
- {
- return KPlayerLabel;
- }
- void CS60MMFLabPlayerUtility::Play()
- {
- }
- void CS60MMFLabPlayerUtility::Stop()
- {
- }
- void CS60MMFLabPlayerUtility::SetOptionsMenuL(CEikMenuPane* aMenuPane)
- {
- switch (iState)
- {
- case EPlayerNotReady:
- break;
- case EPlayerReady:
- break;
- case EPlayerPlaying:
- break;
- default:
- break;
- }
- }
- // End of File