mmserv/tms/tmscallserver/inc/tmscsdevsound.h
branchRCL_3
changeset 19 095bea5f582e
parent 17 60e492b28869
child 20 0ac9a5310753
--- a/mmserv/tms/tmscallserver/inc/tmscsdevsound.h	Thu Aug 19 10:26:11 2010 +0300
+++ b/mmserv/tms/tmscallserver/inc/tmscsdevsound.h	Tue Aug 31 15:43:02 2010 +0300
@@ -19,11 +19,12 @@
 #define TMSCSDEVSOUND_H
 
 #include <sounddevice.h>
-#include <tms.h>
+#include "tmstimer.h"
 
 namespace TMS {
 
 // FORWARD DECLARATIONS
+class TMSTimer;
 class TMSCSDevSoundObserver;
 
 /**
@@ -31,7 +32,8 @@
  *
  */
 NONSHARABLE_CLASS(TMSCSDevSound) : public CBase,
-                                   public MDevSoundObserver
+                                   public MDevSoundObserver,
+                                   public TMSTimerObserver
     {
 public:
 
@@ -46,12 +48,12 @@
      * methods. If the stream is already active or being activated, call to
      * this will result in no action.
      */
-    virtual void Activate();
+    virtual void Activate(const gint retrytime);
 
     /**
      * Deactivates an active DevSound stream.
      */
-    virtual void Deactivate();
+    virtual void Deactivate(gboolean reset = TRUE);
 
     /*
      * Returns DevSound instance associated with the stream.
@@ -106,12 +108,20 @@
      */
     void DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) {}
 
+    /*
+     * From TMSTimerObserver.
+     * Called upon timer timeout event.
+     */
+    void TimerEvent();
+
 protected:
 
     TMSCSDevSound(TMSCSDevSoundObserver& observer);
-    void ConstructL(const TMSStreamType strmtype);
+    void ConstructL(const TMSStreamType strmtype, const gint retrytime);
     void InitializeL();
     void NotifyEvent(gint error);
+    void StartTimer();
+    void CancelTimer();
 
 private:
 
@@ -148,6 +158,15 @@
     gint iPreference;
     gint iPriority;
     TMMFState iMode;
+
+    /*
+     * For retry timer
+     */
+    gint iInitRetryTime;
+    gint iStartRetryTime;
+    TMSTimer* iTimer;
+    gint iPeriodic;
+    gint iElapsedTime;
     };
 
 } //namespace TMS