camerauis/cameraapp/generic/inc/CamSoundPlayer.h
branchRCL_3
changeset 20 38fb6f7eacd5
parent 0 1ddebce53859
equal deleted inserted replaced
18:51dda465e618 20:38fb6f7eacd5
    18 
    18 
    19 #ifndef CAMSOUNDPLAYER_H
    19 #ifndef CAMSOUNDPLAYER_H
    20 #define CAMSOUNDPLAYER_H
    20 #define CAMSOUNDPLAYER_H
    21 
    21 
    22 //  INCLUDES
    22 //  INCLUDES
    23 #include <MdaAudioTonePlayer.h>
       
    24 #include <MdaAudioSamplePlayer.h>
    23 #include <MdaAudioSamplePlayer.h>
    25 #include "Cam.hrh" // For TCamSoundId
    24 #include "Cam.hrh" // For TCamSoundId
    26 
    25 
    27 // CONSTANTS
    26 // CONSTANTS
    28 
    27 
    57 *  This class is used to play sounds and tones for the Camera app
    56 *  This class is used to play sounds and tones for the Camera app
    58 *
    57 *
    59 *  @since 2.8
    58 *  @since 2.8
    60 */
    59 */
    61 class CCamSoundPlayer : public CBase,
    60 class CCamSoundPlayer : public CBase,
    62                         public MMdaAudioPlayerCallback,
    61                         public MMdaAudioPlayerCallback
    63                         public MMdaAudioToneObserver
       
    64     {
    62     {
    65     public:  // Constructors and destructor
    63     public:  // Constructors and destructor
    66         
    64         
    67         /**
    65         /**
    68         * Two-phased constructor.
    66         * Two-phased constructor.
    89         * @param aSound The sound to play
    87         * @param aSound The sound to play
    90         * @param aEnableCallback Whether to call back when play complete
    88         * @param aEnableCallback Whether to call back when play complete
    91         */
    89         */
    92         void PlaySound( TCamSoundId aSound, TBool aEnableCallback );
    90         void PlaySound( TCamSoundId aSound, TBool aEnableCallback );
    93 
    91 
    94         /**
    92       
    95         * Initiates the playing of the specified tone
       
    96         * @since 2.8
       
    97         * @param aToneHz The frequency of the tone to play in Hertz
       
    98         * @param aLenMicSec The length of tone to play in microseconds
       
    99         * @param aVolume The volume of the tone, range 0.0 to 1.0
       
   100         * @param aEnableCallback Whether to be called back when playback complete
       
   101         */
       
   102         void PlayTone( TInt aToneHz, TInt aLenMicSec, TReal32 aVolume, TBool aEnableCallback );
       
   103 
       
   104         /**
    93         /**
   105         * Called to disable certain key press clicks
    94         * Called to disable certain key press clicks
   106         * @since 2.8 
    95         * @since 2.8 
   107         */
    96         */
   108         void DisableSelectionKeySoundL();
    97         void DisableSelectionKeySoundL();
   125         * is has stopped
   114         * is has stopped
   126         * @since 2.8 
   115         * @since 2.8 
   127         */
   116         */
   128         void EnableAllKeySounds();
   117         void EnableAllKeySounds();
   129         
   118         
   130         /**
       
   131         * Cancels any outstanding tone player activity
       
   132         * @since 3.0
       
   133         */
       
   134         void CancelTonePlayer();
       
   135 
   119 
   136     public: // Functions from base classes
   120     public: // Functions from base classes
   137         /**
   121         /**
   138         * From MMdaAudioPlayerCallback.
   122         * From MMdaAudioPlayerCallback.
   139         * @since 2.8
   123         * @since 2.8
   144         /**
   128         /**
   145         * From MMdaAudioPlayerCallback.
   129         * From MMdaAudioPlayerCallback.
   146         * @since 2.8
   130         * @since 2.8
   147         */
   131         */
   148         void MapcPlayComplete( TInt aError );
   132         void MapcPlayComplete( TInt aError );
   149 
       
   150         /**
       
   151         * From MMdaAudioToneObserver.
       
   152         * @since 2.8
       
   153         */
       
   154         void MatoPrepareComplete( TInt aError );
       
   155 
       
   156         /**
       
   157         * From MMdaAudioToneObserver.
       
   158         * @since 2.8
       
   159         */
       
   160         void MatoPlayComplete( TInt aError );
       
   161         
   133         
   162     private:
   134     private:
   163 
   135 
   164         /**
   136         /**
   165         * C++ default constructor.
   137         * C++ default constructor.
   179         * @param aFile The file to open
   151         * @param aFile The file to open
   180         * @param aEnableCallback Whether to call back when play complete
   152         * @param aEnableCallback Whether to call back when play complete
   181         */
   153         */
   182         void StartPlaySound( const TDesC& aFile, const TBool aEnableCallback );
   154         void StartPlaySound( const TDesC& aFile, const TBool aEnableCallback );
   183 
   155 
   184         /**
       
   185         * Starts procedure to play audio Tone (and RNG) files. Internal function
       
   186         * @since 2.8 
       
   187         * @param aFile The file to open
       
   188         * @param aEnableCallback Whether to call back when play complete
       
   189         */
       
   190         void StartPlayTone( const TDesC& aFile, const TBool aEnableCallback );
       
   191 
       
   192     public:     // Data
   156     public:     // Data
   193 
   157 
   194         // Audio player utility for WAV sounds (eg Video Recording)
   158         // Audio player utility for WAV sounds (eg Video Recording)
   195         CMdaAudioPlayerUtility* iAudioPlayer;
   159         CMdaAudioPlayerUtility* iAudioPlayer;
   196 
       
   197         // Tone player for TONES (eg Video recording when in call)
       
   198         CMdaAudioToneUtility* iTonePlayer;
       
   199 
   160 
   200         // Key sound system for Self-timer sound and camera shutter.
   161         // Key sound system for Self-timer sound and camera shutter.
   201         CAknKeySoundSystem* iKeySoundSystem;
   162         CAknKeySoundSystem* iKeySoundSystem;
   202 
   163 
   203         // Observer to notify when playback completes
   164         // Observer to notify when playback completes
   216         TBool iSelectionKeySilent;
   177         TBool iSelectionKeySilent;
   217 
   178 
   218         // Whether all keys have been silenced
   179         // Whether all keys have been silenced
   219         TBool iAllKeysSilent;        
   180         TBool iAllKeysSilent;        
   220 
   181 
   221         // Whether a tone is currently playing
       
   222         TBool iTonePlayInProgress;
       
   223         };
   182         };
   224 
   183 
   225 #endif      // CAMSOUNDPLAYER_H   
   184 #endif      // CAMSOUNDPLAYER_H   
   226             
   185             
   227 // End of File
   186 // End of File