|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : CCESoundPlayer.h 00004 * Part of : Content Listing Framework Sample Application 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 00017 #ifndef __CCESOUNDPLAYER_H__ 00018 #define __CCESOUNDPLAYER_H__ 00019 00020 // INCLUDES 00021 #include <e32base.h> 00022 #include <MdaAudioSamplePlayer.h> 00023 00024 #include "CLFExample.hrh" 00025 00026 // CLASS DECLARATION 00027 00028 /** 00029 * Sound player for CLF Example Application. 00030 * Plays audio files in the application. 00031 */ 00032 class CCESoundPlayer 00033 : public CBase, 00034 public MMdaAudioPlayerCallback 00035 { 00036 public: // Constructors and destructor 00037 00038 /** 00039 * Creates and returns a new instance of this class. 00040 * @return Pointer to the CCESoundPlayer object 00041 */ 00042 static CCESoundPlayer* NewL(); 00043 00044 /** 00045 * Creates and returns a new instance of this class. The returned 00046 * object is left on the cleanup stack. 00047 * @return Pointer to the CCESoundPlayer object 00048 */ 00049 static CCESoundPlayer* NewLC(); 00050 00051 /** 00052 * Destructor. 00053 */ 00054 virtual ~CCESoundPlayer(); 00055 00056 private: // Constructors 00057 /** 00058 * C++ default constructor. 00059 */ 00060 CCESoundPlayer(); 00061 00062 /** 00063 * Symbian 2nd phase constructor. 00064 */ 00065 void ConstructL(); 00066 00067 protected: // Functions from base classes 00068 00069 /** 00070 * From MMdaAudioPlayerCallback. Defines client behaviour 00071 * when opening and initialization of an audio sample has 00072 * completed. 00073 */ 00074 void MapcInitComplete( TInt aError, 00075 const TTimeIntervalMicroSeconds& aDuration ); 00076 00077 /** 00078 * From MMdaAudioPlayerCallback. Defines client behaviour 00079 * when playback of an audio sample has completed. 00080 */ 00081 void MapcPlayComplete( TInt aError ); 00082 00083 public: // New functions 00084 00085 /** 00086 * Open music file and start music playback. 00087 * @param aFileName Path and file name of the audio file 00088 */ 00089 void StartPlaybackL( const TDesC& aFileName ); 00090 00091 /** 00092 * Stop music playback. 00093 */ 00094 void StopPlayback(); 00095 00096 /** 00097 * Get the state of the audio player. 00098 * @return State of the audio player 00099 */ 00100 TCEPlayerState PlayerState(); 00101 00102 private: // Data 00103 00104 // Audio player utility (owned) 00105 CMdaAudioPlayerUtility* iMdaAudioPlayerUtility; 00106 00107 // State of the audio player 00108 TCEPlayerState iPlayerState; 00109 00110 // For waiting the audio player initialization to complete 00111 CActiveSchedulerWait iWait; 00112 00113 }; 00114 00115 #endif // __CCESOUNDPLAYER_H__ 00116 00117 // End of File
|
© Nokia 2009 |