mmserv/tms/tmsserver/inc/tmsaudioinbandtoneplayer.h
changeset 20 b67dd1fc57c5
parent 19 4a629bc82c5e
child 36 73253677b50a
equal deleted inserted replaced
19:4a629bc82c5e 20:b67dd1fc57c5
    13  *
    13  *
    14  * Description: Telephony Multimedia Service
    14  * Description: Telephony Multimedia Service
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #ifndef CPEAUDIOINBANDTONEPLAYER_H
    18 #ifndef TMSAUDIOINBANDTONEPLAYER_H
    19 #define CPEAUDIOINBANDTONEPLAYER_H
    19 #define TMSAUDIOINBANDTONEPLAYER_H
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 #include <mdaaudiotoneplayer.h>
    22 #include <mdaaudiotoneplayer.h>
       
    23 #include <barsc.h>
       
    24 #include <barsread.h>
    23 #include <ccpdefs.h>
    25 #include <ccpdefs.h>
    24 #include <tms.h>
    26 #include <tms.h>
    25 
    27 
    26 namespace TMS {
    28 namespace TMS {
       
    29 
       
    30 // CONSTANTS
       
    31 const gint KPhoneInbandToneZero = 0;
    27 
    32 
    28 // FORWARD DECLARATIONS
    33 // FORWARD DECLARATIONS
    29 class TMSAudioToneUtility;
    34 class TMSAudioToneUtility;
    30 
    35 
    31 // CLASS DECLARATION
    36 // CLASS DECLARATION
    51 
    56 
    52     /**
    57     /**
    53      * Plays given tone. Originates from CCP plugin.
    58      * Plays given tone. Originates from CCP plugin.
    54      * @param aTone inband tone needed to play
    59      * @param aTone inband tone needed to play
    55      */
    60      */
    56     void PlayInbandTone(TMSInbandToneType aTone);
    61     void PlayInbandTone(TMSInbandToneType tone);
    57 
    62 
    58     /**
    63     /**
    59      * Cancels playing.
    64      * Cancels playing.
    60      */
    65      */
    61     void Cancel();
    66     void Cancel();
    62 
    67 
    63     /**
    68     /**
    64      * Sets volume.
    69      * Sets volume.
    65      * @param    aVolume     Volume in 0...10 scale.
    70      * @param    aVolume     Volume in 0...10 scale.
    66      */
    71      */
    67     void SetVolume(TInt aVolume);
    72     void SetVolume(gint volume);
    68 
    73 
    69 private:
    74 private:
    70 
    75 
    71     /**
    76     /**
    72      * C++ default constructor.
    77      * C++ default constructor.
    77      * By default Symbian 2nd phase constructor is private.
    82      * By default Symbian 2nd phase constructor is private.
    78      */
    83      */
    79     void ConstructL();
    84     void ConstructL();
    80 
    85 
    81     /**
    86     /**
       
    87      * Create inband tone sequences from resources.
       
    88      */
       
    89     void CreateToneSequencesL();
       
    90 
       
    91     /**
    82      * Playes current tone.
    92      * Playes current tone.
    83      * @param None.
    93      * @param None.
    84      * @return None.
    94      * @return None.
    85      */
    95      */
    86     void PlayCurrentTone();
    96     void PlayCurrentTone();
       
    97 
       
    98     /**
       
    99      * Configure tone player utility for current sequence playback.
       
   100      */
       
   101     void SetToneAttributes(const guint pref,
       
   102             const guint priority = KAudioPriorityNetMsg,
       
   103             const gint repeatTimes = KMdaAudioToneRepeatForever,
       
   104             const gint trailSilence = KPhoneInbandToneZero);
       
   105 
       
   106     /**
       
   107      * Allocate tone sequence from resource.
       
   108      */
       
   109     void AllocSeqFromResourceL(const gint resource);
    87 
   110 
    88     //From MMdaAudioToneObserver
   111     //From MMdaAudioToneObserver
    89 
   112 
    90     /**
   113     /**
    91      * Handles completion of preparation.
   114      * Handles completion of preparation.
   105     /**
   128     /**
   106      * Calculates media server volume level.
   129      * Calculates media server volume level.
   107      * @param   aVolume     Volume level in 0...10 scale.
   130      * @param   aVolume     Volume level in 0...10 scale.
   108      * @return  Volume level in media server scale.
   131      * @return  Volume level in media server scale.
   109      */
   132      */
   110     TInt CalculateMediaServerVolume(TInt aVolume) const;
   133     gint CalculateMediaServerVolume(gint volume) const;
   111 
   134 
   112     /**
   135     /**
   113      * Updates tone player's volume to the current audio volume level.
   136      * Updates tone player's volume to the current audio volume level.
   114      */
   137      */
   115     void UpdateTonePlayerVolume();
   138     void UpdateTonePlayerVolume();
   116 
   139 
   117 private:
   140 private:
   118     // Data
   141     // Data
   119 
   142 
   120     // Currently playing, NULL or tone sequence.
   143     // Currently playing, NULL or tone sequence.
   121     TMSAudioToneUtility* iCurrent;
   144     TMSAudioToneUtility* iPlayer;
   122     //Member variable for inband tone
   145     // Member variable for inband tone
   123     TMSInbandToneType iToneName;
   146     TMSInbandToneType iToneName;
   124     //NetworkBusy sequence
   147     // Ringing type
   125     HBufC8* iResourceBusySeq;
   148     // TProfileRingingType iRingingType;
   126     //NetworkBusy sequence
   149     // Handle to a file server session
   127     HBufC8* iResourceReorderSeq;
       
   128     //NetworkBusy sequence
       
   129     HBufC8* iResourceCongestionSeq;
       
   130     //NetworkBusy sequence
       
   131     HBufC8* iResourceSpecialSeq;
       
   132     //NetworkBusy sequence
       
   133     HBufC8* iResourceRadioPathSeq;
       
   134     //NetworkBusy sequence
       
   135     HBufC8* iResourceRingGoingSeq;
       
   136     //CallWaiting sequence
       
   137     HBufC8* iResourceCallWaitingSeq;
       
   138     //Ringing type
       
   139     //       TProfileRingingType iRingingType;
       
   140     //Data call tone sequence
       
   141     HBufC8* iPlayDataSequence;
       
   142     //Data call silent sequence
       
   143     HBufC8* iPlayNoSoundSequence;
       
   144     //Data call beep sequence
       
   145     HBufC8* iPlayBeepSequence;
       
   146     //Handle to a file server session
       
   147     RFs iFsSession;
   150     RFs iFsSession;
       
   151 	// For reading sequence tones from resource file
       
   152     TFileName iFileName;
       
   153     RResourceFile iResourceFile;
       
   154     TResourceReader iReader;
       
   155     // Array of tone pointers
       
   156     RPointerArray<HBufC8> iTones;
       
   157     };
   148 
   158 
   149     };
       
   150 } // namespace TMS
   159 } // namespace TMS
   151 
   160 
   152 #endif      // CPEAUDIOINBANDTONEPLAYER_H
   161 #endif // TMSAUDIOINBANDTONEPLAYER_H
   153 
   162 
   154 // End of File
   163 // End of File