mmserv/tms/tmscallserver/inc/tmscsdevsound.h
branchRCL_3
changeset 19 095bea5f582e
parent 17 60e492b28869
child 20 0ac9a5310753
equal deleted inserted replaced
18:a36789189b53 19:095bea5f582e
    17 
    17 
    18 #ifndef TMSCSDEVSOUND_H
    18 #ifndef TMSCSDEVSOUND_H
    19 #define TMSCSDEVSOUND_H
    19 #define TMSCSDEVSOUND_H
    20 
    20 
    21 #include <sounddevice.h>
    21 #include <sounddevice.h>
    22 #include <tms.h>
    22 #include "tmstimer.h"
    23 
    23 
    24 namespace TMS {
    24 namespace TMS {
    25 
    25 
    26 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
       
    27 class TMSTimer;
    27 class TMSCSDevSoundObserver;
    28 class TMSCSDevSoundObserver;
    28 
    29 
    29 /**
    30 /**
    30  *  Wrapper for CMMFDevSound
    31  *  Wrapper for CMMFDevSound
    31  *
    32  *
    32  */
    33  */
    33 NONSHARABLE_CLASS(TMSCSDevSound) : public CBase,
    34 NONSHARABLE_CLASS(TMSCSDevSound) : public CBase,
    34                                    public MDevSoundObserver
    35                                    public MDevSoundObserver,
       
    36                                    public TMSTimerObserver
    35     {
    37     {
    36 public:
    38 public:
    37 
    39 
    38     /**
    40     /**
    39      * Destructor.
    41      * Destructor.
    44      * Activates the DevSound stream.
    46      * Activates the DevSound stream.
    45      * Stream activation status is indicated by TMSCSDevSoundObserver callback
    47      * Stream activation status is indicated by TMSCSDevSoundObserver callback
    46      * methods. If the stream is already active or being activated, call to
    48      * methods. If the stream is already active or being activated, call to
    47      * this will result in no action.
    49      * this will result in no action.
    48      */
    50      */
    49     virtual void Activate();
    51     virtual void Activate(const gint retrytime);
    50 
    52 
    51     /**
    53     /**
    52      * Deactivates an active DevSound stream.
    54      * Deactivates an active DevSound stream.
    53      */
    55      */
    54     virtual void Deactivate();
    56     virtual void Deactivate(gboolean reset = TRUE);
    55 
    57 
    56     /*
    58     /*
    57      * Returns DevSound instance associated with the stream.
    59      * Returns DevSound instance associated with the stream.
    58      */
    60      */
    59     CMMFDevSound& DevSound();
    61     CMMFDevSound& DevSound();
   104      * From MDevSoundObserver
   106      * From MDevSoundObserver
   105      * Empty implementation
   107      * Empty implementation
   106      */
   108      */
   107     void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {}
   109     void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {}
   108 
   110 
       
   111     /*
       
   112      * From TMSTimerObserver.
       
   113      * Called upon timer timeout event.
       
   114      */
       
   115     void TimerEvent();
       
   116 
   109 protected:
   117 protected:
   110 
   118 
   111     TMSCSDevSound(TMSCSDevSoundObserver& observer);
   119     TMSCSDevSound(TMSCSDevSoundObserver& observer);
   112     void ConstructL(const TMSStreamType strmtype);
   120     void ConstructL(const TMSStreamType strmtype, const gint retrytime);
   113     void InitializeL();
   121     void InitializeL();
   114     void NotifyEvent(gint error);
   122     void NotifyEvent(gint error);
       
   123     void StartTimer();
       
   124     void CancelTimer();
   115 
   125 
   116 private:
   126 private:
   117 
   127 
   118     /**
   128     /**
   119      * Derived class has to activate the stream here.
   129      * Derived class has to activate the stream here.
   146 
   156 
   147     TMSStreamType iStreamType;
   157     TMSStreamType iStreamType;
   148     gint iPreference;
   158     gint iPreference;
   149     gint iPriority;
   159     gint iPriority;
   150     TMMFState iMode;
   160     TMMFState iMode;
       
   161 
       
   162     /*
       
   163      * For retry timer
       
   164      */
       
   165     gint iInitRetryTime;
       
   166     gint iStartRetryTime;
       
   167     TMSTimer* iTimer;
       
   168     gint iPeriodic;
       
   169     gint iElapsedTime;
   151     };
   170     };
   152 
   171 
   153 } //namespace TMS
   172 } //namespace TMS
   154 
   173 
   155 #endif //TMSCSDEVSOUND_H
   174 #endif //TMSCSDEVSOUND_H