phoneengine/audiohandling/inc/cpeaudioinbandtoneplayer.h
changeset 0 5f000ab63145
child 21 92ab7f8d0eab
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  This file contains the header file of the class CPEAudioInbandTonePlayer, that plays DTMF tones 
       
    15 *                using media server
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPEAUDIOINBANDTONEPLAYER_H
       
    21 #define CPEAUDIOINBANDTONEPLAYER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <pevirtualengine.h>
       
    25 #include <e32base.h>
       
    26 #include <mdaaudiotoneplayer.h>
       
    27 #include <ccpdefs.h>
       
    28 
       
    29 // CONSTANTS
       
    30 // None.
       
    31 
       
    32 // MACROS
       
    33 // None.
       
    34 
       
    35 // DATA TYPES
       
    36 // None.
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 // None.
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CPEAudioToneUtility;
       
    43 class CPEAudioData;
       
    44 class CPEAudioFactory;
       
    45 
       
    46 // CLASS DECLARATION
       
    47 
       
    48 /**
       
    49 *  This class is used to play inband tones using media server.
       
    50 *
       
    51 *  @lib audiohandling.lib
       
    52 *  @since Series60_5.0
       
    53 */
       
    54 class CPEAudioInbandTonePlayer 
       
    55     : public CBase, 
       
    56       private MMdaAudioToneObserver
       
    57     {
       
    58     public:  // Constructors and destructor      
       
    59         
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         */
       
    63         static CPEAudioInbandTonePlayer* NewL( 
       
    64             CPEAudioData& aOwner, 
       
    65             RFs& aFsSession,
       
    66             CPEAudioFactory& aFactory );
       
    67         
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71         ~CPEAudioInbandTonePlayer();
       
    72 
       
    73         /**
       
    74         * Plays given tone. Originates from CCP plugin.
       
    75 		* @param aTone inband tone needed to play
       
    76         */
       
    77         void PlayInbandTone( TCCPTone aTone );
       
    78 
       
    79         /**
       
    80         * Cancels playing.
       
    81         */
       
    82         void Cancel();
       
    83 
       
    84         /**
       
    85          * Sets volume.
       
    86          * @since    S60 5.0
       
    87          * @param    aVolume     Volume in 0...10 scale.
       
    88          */
       
    89         void SetVolume( TInt aVolume );
       
    90 
       
    91     private:
       
    92 
       
    93         /**
       
    94         * C++ default constructor.
       
    95         */
       
    96         CPEAudioInbandTonePlayer( 
       
    97             CPEAudioData& aOwner, 
       
    98             RFs& aFsSession );
       
    99 
       
   100         /**
       
   101         * By default Symbian 2nd phase constructor is private.
       
   102         */
       
   103         void ConstructL( CPEAudioFactory& aFactory );
       
   104 
       
   105         /**
       
   106         * Playes current tone.
       
   107 		* @since Series60_2.7
       
   108 		* @param None.
       
   109         * @return None.
       
   110 		*/
       
   111         void PlayCurrentTone();
       
   112 
       
   113 		//From MMdaAudioToneObserver
       
   114         /**
       
   115         * Handles completion of preparation.
       
   116 		* @since Series60_2.7
       
   117 		* @param aError Isn't used.
       
   118         * @return None.
       
   119         */
       
   120         void MatoPrepareComplete( TInt aError );
       
   121 
       
   122 		//From MMdaAudioToneObserver
       
   123         /**
       
   124         * Handles completion of playing.
       
   125 		* @since Series60_2.7
       
   126 		* @param aError Isn't used.
       
   127         * @return None.
       
   128         */
       
   129         void MatoPlayComplete( TInt aError );
       
   130         
       
   131         /**
       
   132          * Calculates media server volume level.
       
   133          * @since   Series S60 5.1
       
   134          * @param   aVolume     Volume level in 0...10 scale.
       
   135          * @return  Volume level in media server scale.
       
   136          */
       
   137         TInt CalculateMediaServerVolume( TInt aVolume ) const;
       
   138         
       
   139         /**
       
   140          * Updates tone player's volume to the current audio volume level.
       
   141          * @since   Series S60 5.1
       
   142          */
       
   143         void UpdateTonePlayerVolume();
       
   144         
       
   145     private:    // Data
       
   146 
       
   147         // Currently playing, NULL or tone sequence.
       
   148         CPEAudioToneUtility* iCurrent;
       
   149 		//Member variable for inband tone
       
   150 		TCCPTone iToneName;
       
   151         // Owner of this object
       
   152         CPEAudioData& iOwner;
       
   153         // Current volume setting.
       
   154 		//NetworkBusy sequence
       
   155         HBufC8* iResourceBusySeq;
       
   156         //NetworkBusy sequence
       
   157         HBufC8* iResourceReorderSeq;
       
   158         //NetworkBusy sequence
       
   159         HBufC8* iResourceCongestionSeq;
       
   160         //NetworkBusy sequence
       
   161         HBufC8* iResourceSpecialSeq;
       
   162         //NetworkBusy sequence
       
   163         HBufC8* iResourceRadioPathSeq;
       
   164         //NetworkBusy sequence
       
   165         HBufC8* iResourceRingGoingSeq;
       
   166         //CallWaiting sequence
       
   167         HBufC8* iResourceCallWaitingSeq;
       
   168         //Ringing type
       
   169         TProfileRingingType iRingingType;
       
   170         //Data call tone sequence
       
   171         HBufC8* iPlayDataSequence;
       
   172         //Data call silent sequence
       
   173         HBufC8* iPlayNoSoundSequence;
       
   174         //Data call beep sequence
       
   175         HBufC8* iPlayBeepSequence;
       
   176         //Handle to a file server session
       
   177         RFs& iFsSession;
       
   178 
       
   179     };
       
   180 
       
   181 #endif      // CPEAUDIOINBANDTONEPLAYER_H
       
   182             
       
   183 // End of File