21 #include "cspdevsound.h" |
21 #include "cspdevsound.h" |
22 #include "mcspdevsoundobserver.h" |
22 #include "mcspdevsoundobserver.h" |
23 |
23 |
24 using namespace TMS; |
24 using namespace TMS; |
25 |
25 |
26 // --------------------------------------------------------------------------- |
26 // ----------------------------------------------------------------------------- |
27 // CSPDevSound |
27 // TMSCSPDevSound |
28 // --------------------------------------------------------------------------- |
28 // ----------------------------------------------------------------------------- |
29 // |
29 // |
30 CSPDevSound::CSPDevSound(MCSPDevSoundObserver& aObserver) : |
30 TMSCSPDevSound::TMSCSPDevSound(TMSCSPDevSoundObserver& aObserver) : |
31 iObserver(aObserver) |
31 iObserver(aObserver) |
32 { |
32 { |
33 } |
33 } |
34 |
34 |
35 // --------------------------------------------------------------------------- |
35 // ----------------------------------------------------------------------------- |
36 // ConstructL |
36 // ConstructL |
37 // --------------------------------------------------------------------------- |
37 // ----------------------------------------------------------------------------- |
38 // |
38 // |
39 void CSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference, |
39 void TMSCSPDevSound::ConstructL(TMMFState aMode, gint aAudioPreference, |
40 gint aAudioPriority) |
40 gint aAudioPriority) |
41 { |
41 { |
42 TMMFPrioritySettings audioPriority; |
42 TMMFPrioritySettings audioPriority; |
43 TFourCC modemFourCC; |
43 TFourCC modemFourCC; |
44 modemFourCC.Set(KS60FourCCCodeModem); |
44 modemFourCC.Set(KS60FourCCCodeModem); |
56 audioPriority.iState = aMode; |
56 audioPriority.iState = aMode; |
57 iDevSound->SetPrioritySettings(audioPriority); |
57 iDevSound->SetPrioritySettings(audioPriority); |
58 } |
58 } |
59 } |
59 } |
60 |
60 |
61 // --------------------------------------------------------------------------- |
61 // ----------------------------------------------------------------------------- |
62 // From class MDevSoundObserver |
62 // From class MDevSoundObserver |
63 // Not implemented |
63 // Not implemented |
64 // --------------------------------------------------------------------------- |
64 // ----------------------------------------------------------------------------- |
65 // |
65 // |
66 CSPDevSound::~CSPDevSound() |
66 TMSCSPDevSound::~TMSCSPDevSound() |
67 { |
67 { |
68 delete iDevSound; |
68 delete iDevSound; |
69 } |
69 } |
70 |
70 |
71 // --------------------------------------------------------------------------- |
71 // ----------------------------------------------------------------------------- |
72 // Tries to activate the audio stream if not active or activating |
72 // Tries to activate the audio stream if not active or activating |
73 // --------------------------------------------------------------------------- |
73 // ----------------------------------------------------------------------------- |
74 // |
74 // |
75 void CSPDevSound::Activate() |
75 void TMSCSPDevSound::Activate() |
76 { |
76 { |
77 if (!IsActive() && !IsActivationOngoing()) |
77 if (!IsActive() && !IsActivationOngoing()) |
78 { |
78 { |
79 iActivationOngoing = ETrue; |
79 iActivationOngoing = ETrue; |
80 gint err = KErrNone; |
80 gint err = KErrNone; |
81 TRAP(err, DoActivateL()); |
81 TRAP(err, DoActivateL()); |
82 } |
82 } |
83 } |
83 } |
84 |
84 |
85 // --------------------------------------------------------------------------- |
85 // ----------------------------------------------------------------------------- |
86 // Deactivates the audio device. |
86 // Deactivates the audio device. |
87 // --------------------------------------------------------------------------- |
87 // ----------------------------------------------------------------------------- |
88 // |
88 // |
89 void CSPDevSound::Deactivate() |
89 void TMSCSPDevSound::Deactivate() |
90 { |
90 { |
91 if (iDevSound && (IsActive() || IsActivationOngoing())) |
91 if (iDevSound && (IsActive() || IsActivationOngoing())) |
92 { |
92 { |
93 iDevSound->Stop(); |
93 iDevSound->Stop(); |
94 iActive = EFalse; |
94 iActive = EFalse; |
95 iActivationOngoing = EFalse; |
95 iActivationOngoing = EFalse; |
96 } |
96 } |
97 } |
97 } |
98 |
98 |
99 // --------------------------------------------------------------------------- |
99 // ----------------------------------------------------------------------------- |
100 // ActivationOngoing |
100 // ActivationOngoing |
101 // --------------------------------------------------------------------------- |
101 // ----------------------------------------------------------------------------- |
102 // |
102 // |
103 TBool CSPDevSound::IsActivationOngoing() const |
103 TBool TMSCSPDevSound::IsActivationOngoing() const |
104 { |
104 { |
105 return iActivationOngoing; |
105 return iActivationOngoing; |
106 } |
106 } |
107 |
107 |
108 // --------------------------------------------------------------------------- |
108 // ----------------------------------------------------------------------------- |
109 // IsActive |
109 // IsActive |
110 // --------------------------------------------------------------------------- |
110 // ----------------------------------------------------------------------------- |
111 // |
111 // |
112 TBool CSPDevSound::IsActive() const |
112 TBool TMSCSPDevSound::IsActive() const |
113 { |
113 { |
114 return iActive; |
114 return iActive; |
115 } |
115 } |
116 |
116 |
117 // --------------------------------------------------------------------------- |
117 // ----------------------------------------------------------------------------- |
118 // DevSound |
118 // DevSound |
119 // --------------------------------------------------------------------------- |
119 // ----------------------------------------------------------------------------- |
120 // |
120 // |
121 CMMFDevSound& CSPDevSound::DevSound() |
121 CMMFDevSound& TMSCSPDevSound::DevSound() |
122 { |
122 { |
123 return *iDevSound; |
123 return *iDevSound; |
124 } |
124 } |
125 |
125 |
126 // --------------------------------------------------------------------------- |
126 // ----------------------------------------------------------------------------- |
127 // From class MDevSoundObserver |
127 // From class MDevSoundObserver |
128 // Not implemented |
128 // Not implemented |
129 // --------------------------------------------------------------------------- |
129 // ----------------------------------------------------------------------------- |
130 // |
130 // |
131 void CSPDevSound::InitializeComplete(TInt aError) |
131 void TMSCSPDevSound::InitializeComplete(TInt aError) |
132 { |
132 { |
133 if (iStreamType == KAudioPrefCSCallDownlink) |
133 if (iStreamType == KAudioPrefCSCallDownlink) |
134 { |
134 { |
135 iObserver.DownlinkInitCompleted(aError); |
135 iObserver.DownlinkInitCompleted(aError); |
136 } |
136 } |
138 { |
138 { |
139 iObserver.UplinkInitCompleted(aError); |
139 iObserver.UplinkInitCompleted(aError); |
140 } |
140 } |
141 } |
141 } |
142 |
142 |
143 // --------------------------------------------------------------------------- |
143 // ----------------------------------------------------------------------------- |
144 // From class MDevSoundObserver |
144 // From class MDevSoundObserver |
145 // Not implemented |
145 // Not implemented |
146 // --------------------------------------------------------------------------- |
146 // ----------------------------------------------------------------------------- |
147 // |
147 // |
148 void CSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) |
148 void TMSCSPDevSound::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) |
149 { |
149 { |
150 } |
150 } |
151 |
151 |
152 // --------------------------------------------------------------------------- |
152 // ----------------------------------------------------------------------------- |
153 // From class MDevSoundObserver |
153 // From class MDevSoundObserver |
154 // Not implemented |
154 // Not implemented |
155 // --------------------------------------------------------------------------- |
155 // ----------------------------------------------------------------------------- |
156 // |
156 // |
157 void CSPDevSound::PlayError(TInt /*aError*/) |
157 void TMSCSPDevSound::PlayError(TInt /*aError*/) |
158 { |
158 { |
159 } |
159 } |
160 |
160 |
161 // --------------------------------------------------------------------------- |
161 // ----------------------------------------------------------------------------- |
162 // From class MDevSoundObserver |
162 // From class MDevSoundObserver |
163 // Not implemented |
163 // Not implemented |
164 // --------------------------------------------------------------------------- |
164 // ----------------------------------------------------------------------------- |
165 // |
165 // |
166 void CSPDevSound::ToneFinished(TInt /*aError*/) |
166 void TMSCSPDevSound::ToneFinished(TInt /*aError*/) |
167 { |
167 { |
168 } |
168 } |
169 |
169 |
170 // --------------------------------------------------------------------------- |
170 // ----------------------------------------------------------------------------- |
171 // From class MDevSoundObserver |
171 // From class MDevSoundObserver |
172 // Not implemented |
172 // Not implemented |
173 // --------------------------------------------------------------------------- |
173 // ----------------------------------------------------------------------------- |
174 // |
174 // |
175 void CSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) |
175 void TMSCSPDevSound::BufferToBeEmptied(CMMFBuffer* /*aBuffer*/) |
176 { |
176 { |
177 } |
177 } |
178 |
178 |
179 // --------------------------------------------------------------------------- |
179 // ----------------------------------------------------------------------------- |
180 // From class MDevSoundObserver |
180 // From class MDevSoundObserver |
181 // Not implemented |
181 // Not implemented |
182 // --------------------------------------------------------------------------- |
182 // ----------------------------------------------------------------------------- |
183 // |
183 // |
184 void CSPDevSound::RecordError(TInt /*aError*/) |
184 void TMSCSPDevSound::RecordError(TInt /*aError*/) |
185 { |
185 { |
186 } |
186 } |
187 |
187 |
188 // --------------------------------------------------------------------------- |
188 // ----------------------------------------------------------------------------- |
189 // From class MDevSoundObserver |
189 // From class MDevSoundObserver |
190 // Not implemented |
190 // Not implemented |
191 // --------------------------------------------------------------------------- |
191 // ----------------------------------------------------------------------------- |
192 // |
192 // |
193 void CSPDevSound::ConvertError(TInt /*aError*/) |
193 void TMSCSPDevSound::ConvertError(TInt /*aError*/) |
194 { |
194 { |
195 } |
195 } |
196 |
196 |
197 // --------------------------------------------------------------------------- |
197 // ----------------------------------------------------------------------------- |
198 // From class MDevSoundObserver |
198 // From class MDevSoundObserver |
199 // Not implemented |
199 // Not implemented |
200 // --------------------------------------------------------------------------- |
200 // ----------------------------------------------------------------------------- |
201 // |
201 // |
202 void CSPDevSound::DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/) |
202 void TMSCSPDevSound::DeviceMessage(TUid /*aMessageType*/, |
|
203 const TDesC8& /*aMsg*/) |
203 { |
204 { |
204 } |
205 } |
205 |
206 |
206 // End of File |
207 // End of File |