S60MMFLabUtility.cpp
上传用户:laixiong
上传日期:2007-03-11
资源大小:2994k
文件大小:4k
源码类别:

Symbian

开发平台:

C/C++

  1. // Copyright (c) 2006 Nokia Corporation.
  2. #include "S60MMFLabUtility.h"
  3. #include "s60mmflab.hrh"
  4. #include <MdaAudioTonePlayer.h>
  5. #include <eikmenup.h>
  6. #include <aknnotewrappers.h>
  7. // TONE UTILITY
  8. _LIT(KToneLabel, "Tone Utility...");
  9. CS60MMFLabToneUtility::CS60MMFLabToneUtility()
  10.     : iToneUtility(NULL)
  11.     {
  12.     // Do nothing
  13.     }
  14. CS60MMFLabToneUtility* CS60MMFLabToneUtility::NewL()
  15.     {
  16.     CS60MMFLabToneUtility* self = NewLC();
  17.     CleanupStack::Pop(self);  
  18.     return self;
  19.     }
  20. CS60MMFLabToneUtility* CS60MMFLabToneUtility::NewLC()
  21.     {
  22.     CS60MMFLabToneUtility* self = new (ELeave) CS60MMFLabToneUtility();
  23.     CleanupStack::PushL(self);
  24.     self->ConstructL();
  25.     return self;
  26.     }
  27. void CS60MMFLabToneUtility::ConstructL()
  28.     {
  29.     const TInt KFrequency = 1000; // Hz
  30.     const TTimeIntervalMicroSeconds KDuration =
  31.         TTimeIntervalMicroSeconds(6000000); // 6 seconds
  32.     }
  33. CS60MMFLabToneUtility::~CS60MMFLabToneUtility()
  34.     {
  35.     delete iToneUtility;
  36.     }
  37. void CS60MMFLabToneUtility::MatoPrepareComplete(TInt aError)
  38. {
  39. _LIT(KWarningNote, "The tone utility could not be configured");
  40. }
  41. void CS60MMFLabToneUtility::MatoPlayComplete(TInt aError)
  42. {
  43. _LIT(KWarningNote, "The tone could not be played");
  44. }
  45. const TDesC& CS60MMFLabToneUtility::GetLabel()
  46. {
  47.     return KToneLabel;
  48. }
  49. void CS60MMFLabToneUtility::Play()
  50.     {
  51.     }
  52. void CS60MMFLabToneUtility::CancelPlay()
  53.     {
  54.     }
  55. void CS60MMFLabToneUtility::SetOptionsMenuL(CEikMenuPane* aMenuPane)
  56.     {
  57.     switch (state)
  58.         {
  59.         case EMdaAudioToneUtilityNotReady:
  60.          break;
  61.         
  62.     case EMdaAudioToneUtilityPrepared:
  63.         break;
  64.         
  65.     case EMdaAudioToneUtilityPlaying:
  66.         break;
  67.         
  68.     default:
  69.         break;
  70.         }
  71.     }
  72. // AUDIO PLAYER UTILITY
  73. _LIT(KPlayerLabel, "Player Utility");
  74. _LIT(KPlayerFile, "C:\Data\audio_sample.amr");
  75. CS60MMFLabPlayerUtility::CS60MMFLabPlayerUtility()
  76. : iPlayerUtility(NULL), iState(EPlayerNotReady)
  77.     {
  78.     // Do nothing
  79.     }
  80. CS60MMFLabPlayerUtility* CS60MMFLabPlayerUtility::NewL()
  81.     {
  82.     CS60MMFLabPlayerUtility* self = NewLC();
  83.     CleanupStack::Pop(self);  
  84.     return self;
  85.     }
  86. CS60MMFLabPlayerUtility* CS60MMFLabPlayerUtility::NewLC()
  87.     {
  88.     CS60MMFLabPlayerUtility* self = new (ELeave) CS60MMFLabPlayerUtility();
  89.     CleanupStack::PushL(self);
  90.     self->ConstructL();
  91.     return self;
  92.     }
  93. void CS60MMFLabPlayerUtility::ConstructL()
  94.     {
  95.     }
  96. CS60MMFLabPlayerUtility::~CS60MMFLabPlayerUtility()
  97.     {
  98.     delete iPlayerUtility;
  99.     }
  100. void CS60MMFLabPlayerUtility::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
  101. {
  102. _LIT(KWarnNote, "The audio player utility could not be initialised");
  103.     switch(aError)
  104.         {
  105.         case KErrNone:
  106.             break;
  107.             
  108.         default:
  109.         {
  110.         CAknWarningNote* warnNote = new (ELeave) CAknWarningNote;
  111.         warnNote->ExecuteLD( KWarnNote );
  112.         break;
  113.         }
  114.         }
  115. }
  116. void CS60MMFLabPlayerUtility::MapcPlayComplete(TInt aError)
  117. {
  118. _LIT(KWarningNote, "The audio file could not be played");
  119. if (aError == KErrNone)
  120.         {
  121.         CAknWarningNote* warnNote = new (ELeave) CAknWarningNote;
  122.         warnNote->ExecuteLD( KWarningNote );
  123.         }        
  124. }
  125. const TDesC& CS60MMFLabPlayerUtility::GetLabel()
  126. {
  127.     return KPlayerLabel;
  128. }
  129. void CS60MMFLabPlayerUtility::Play()
  130.     {
  131.     }
  132. void CS60MMFLabPlayerUtility::Stop()
  133.     {
  134.     }
  135. void CS60MMFLabPlayerUtility::SetOptionsMenuL(CEikMenuPane* aMenuPane)
  136.     {
  137.     switch (iState)
  138.         {
  139.     case EPlayerNotReady:
  140.         break;
  141.         
  142.     case EPlayerReady:
  143.         break;
  144.         
  145.     case EPlayerPlaying:
  146.         break;
  147.         
  148. default:
  149.         break;
  150.         }
  151.     }
  152.     
  153. // End of File