camerauis/cameraapp/generic/inc/audioplayer/camtoneplayerwrapper.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Wrapper for Tone Player Utility
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CAM_TONEPLAYERWRAPPER_H
       
    20 #define CAM_TONEPLAYERWRAPPER_H
       
    21 
       
    22 // ===========================================================================
       
    23 // Includes
       
    24 #include <mdaaudiotoneplayer.h>   // for MMdaAudioToneObserver
       
    25 
       
    26 
       
    27 // ===========================================================================
       
    28 // Forward declarations
       
    29 class MCamPlayerObserver;
       
    30 
       
    31 // ===========================================================================
       
    32 // Class definitions
       
    33 
       
    34 /**
       
    35 * Tone Player Wrapper class
       
    36 *
       
    37 */
       
    38 class CCamTonePlayerWrapper : public CBase,
       
    39                               public MMdaAudioToneObserver
       
    40   {
       
    41   // =======================================================
       
    42   // methods
       
    43 
       
    44   // -------------------------------------------------------
       
    45   // constructors and destructor
       
    46   public: 
       
    47 
       
    48     static CCamTonePlayerWrapper* NewL( MCamPlayerObserver& aObserver );
       
    49     virtual ~CCamTonePlayerWrapper();
       
    50 
       
    51   // -------------------------------------------------------
       
    52   // from MMdaAudioToneObserver
       
    53   public: 
       
    54   
       
    55     virtual void MatoPrepareComplete( TInt aStatus );
       
    56     virtual void MatoPlayComplete   ( TInt aStatus );
       
    57   
       
    58   // -------------------------------------------------------
       
    59   // new public
       
    60   public: 
       
    61 
       
    62     void PlayTone( TInt    aToneInHz, 
       
    63                    TInt    aLengthInUs, 
       
    64                    TReal32 aVolumeInPercent,
       
    65                    TBool   aCallback );
       
    66 
       
    67     void CancelPlay();
       
    68 
       
    69   // -------------------------------------------------------
       
    70   // new private
       
    71   private: 
       
    72 
       
    73     void InitL();
       
    74     void NotifyPlayComplete( TInt aStatus );
       
    75 
       
    76   // -------------------------------------------------------
       
    77   // private constructors
       
    78   private: 
       
    79 
       
    80     void ConstructL();
       
    81     CCamTonePlayerWrapper( MCamPlayerObserver& aObserver );
       
    82 
       
    83   // =======================================================
       
    84   // data
       
    85   private: 
       
    86 
       
    87     enum TCamTonePlayerWrapperState
       
    88       {
       
    89       EIdle         = 0,
       
    90       EInitializing = 1,
       
    91       EPlaying      = 2
       
    92       };
       
    93 
       
    94     MCamPlayerObserver&        iObserver;
       
    95     CMdaAudioToneUtility*      iTone;
       
    96     TCamTonePlayerWrapperState iState;
       
    97 
       
    98     TBool                      iCallback;
       
    99 
       
   100   // =======================================================
       
   101   };
       
   102 
       
   103 #ifdef _DEBUG
       
   104     static const TUint16* KCamTonePlayerWrapperStateNames[] = 
       
   105       {
       
   106       (const TUint16*)_S16("EIdle"),
       
   107       (const TUint16*)_S16("EInitializing"),
       
   108       (const TUint16*)_S16("EPlaying")
       
   109       };
       
   110 #endif // _DEBUG
       
   111 
       
   112 
       
   113 #endif // CAM_TONEPLAYERWRAPPER_H
       
   114 
       
   115 // ===========================================================================
       
   116 // end of file