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