26 |
26 |
27 // ----------------------------------------------------------------------------- |
27 // ----------------------------------------------------------------------------- |
28 // Static constructor |
28 // Static constructor |
29 // ----------------------------------------------------------------------------- |
29 // ----------------------------------------------------------------------------- |
30 // |
30 // |
31 CSDownlink* CSDownlink::NewL(MCSPDevSoundObserver& aObserver) |
31 TMSCSDownlink* TMSCSDownlink::NewL(TMSCSPDevSoundObserver& aObserver) |
32 { |
32 { |
33 CSDownlink* self = new (ELeave) CSDownlink(aObserver); |
33 TMSCSDownlink* self = new (ELeave) TMSCSDownlink(aObserver); |
34 CleanupStack::PushL(self); |
34 CleanupStack::PushL(self); |
35 self->ConstructL(); |
35 self->ConstructL(); |
36 CleanupStack::Pop(self); |
36 CleanupStack::Pop(self); |
37 return self; |
37 return self; |
38 } |
38 } |
39 |
39 |
40 // ----------------------------------------------------------------------------- |
40 // ----------------------------------------------------------------------------- |
41 // Destructor. |
41 // Destructor. |
42 // ----------------------------------------------------------------------------- |
42 // ----------------------------------------------------------------------------- |
43 // |
43 // |
44 CSDownlink::~CSDownlink() |
44 TMSCSDownlink::~TMSCSDownlink() |
45 { |
45 { |
46 } |
46 } |
47 |
47 |
48 // ----------------------------------------------------------------------------- |
48 // ----------------------------------------------------------------------------- |
49 // Sets volume |
49 // Sets volume |
50 // ----------------------------------------------------------------------------- |
50 // ----------------------------------------------------------------------------- |
51 // |
51 // |
52 void CSDownlink::SetVolume(gint aVolume) |
52 void TMSCSDownlink::SetVolume(gint aVolume) |
53 { |
53 { |
54 if (iDevSound) |
54 if (iDevSound) |
55 { |
55 { |
56 gint maxVolume(iDevSound->MaxVolume()); |
56 gint maxVolume(iDevSound->MaxVolume()); |
57 maxVolume = (maxVolume > 0) ? maxVolume : KDefaultMaxVolume; |
57 maxVolume = (maxVolume > 0) ? maxVolume : KDefaultMaxVolume; |
91 // ----------------------------------------------------------------------------- |
91 // ----------------------------------------------------------------------------- |
92 // From class MDevSoundObserver |
92 // From class MDevSoundObserver |
93 // Downlink stream has been activated successfully. |
93 // Downlink stream has been activated successfully. |
94 // ----------------------------------------------------------------------------- |
94 // ----------------------------------------------------------------------------- |
95 // |
95 // |
96 void CSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) |
96 void TMSCSDownlink::BufferToBeFilled(CMMFBuffer* /*aBuffer*/) |
97 { |
97 { |
98 //CSPLOGSTRING( CSPINT, "CSDownlink:: activated" ); |
98 //CSPLOGSTRING( CSPINT, "TMSCSDownlink:: activated" ); |
99 // We dont react to devsound messages unless we are activating. |
99 // We dont react to devsound messages unless we are activating. |
100 if (IsActivationOngoing()) |
100 if (IsActivationOngoing()) |
101 { |
101 { |
102 iActive = ETrue; |
102 iActive = ETrue; |
103 iActivationOngoing = EFalse; |
103 iActivationOngoing = EFalse; |
108 // ----------------------------------------------------------------------------- |
108 // ----------------------------------------------------------------------------- |
109 // From class MDevSoundObserver |
109 // From class MDevSoundObserver |
110 // Downlink stream activation failed |
110 // Downlink stream activation failed |
111 // ----------------------------------------------------------------------------- |
111 // ----------------------------------------------------------------------------- |
112 // |
112 // |
113 void CSDownlink::PlayError(TInt aError) |
113 void TMSCSDownlink::PlayError(TInt aError) |
114 { |
114 { |
115 //CSPLOGSTRING( CSPINT, "CSDownlink::PlayError" ); |
115 //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError" ); |
116 |
116 |
117 // We dont react to devsound messages unless we are activating. |
117 // We dont react to devsound messages unless we are activating. |
118 if (IsActivationOngoing()) |
118 if (IsActivationOngoing()) |
119 { |
119 { |
120 //CSPLOGSTRING( CSPINT, "CSDownlink::PlayError activation failed" ); |
120 //CSPLOGSTRING( CSPINT, "TMSCSDownlink::PlayError activation failed" ); |
121 if (aError == KErrAccessDenied) |
121 if (aError == KErrAccessDenied) |
122 { |
122 { |
123 iActivationOngoing = EFalse; |
123 iActivationOngoing = EFalse; |
124 iObserver.DownlinkActivationFailed(); |
124 iObserver.DownlinkActivationFailed(); |
125 } |
125 } |
129 // ----------------------------------------------------------------------------- |
129 // ----------------------------------------------------------------------------- |
130 // From class CSPDevsound |
130 // From class CSPDevsound |
131 // Tries to activate Downlink stream. |
131 // Tries to activate Downlink stream. |
132 // ----------------------------------------------------------------------------- |
132 // ----------------------------------------------------------------------------- |
133 // |
133 // |
134 void CSDownlink::DoActivateL() |
134 void TMSCSDownlink::DoActivateL() |
135 { |
135 { |
136 if (iDevSound) |
136 if (iDevSound) |
137 { |
137 { |
138 iDevSound->PlayInitL(); |
138 iDevSound->PlayInitL(); |
139 } |
139 } |
141 |
141 |
142 // ----------------------------------------------------------------------------- |
142 // ----------------------------------------------------------------------------- |
143 // Constructor |
143 // Constructor |
144 // ----------------------------------------------------------------------------- |
144 // ----------------------------------------------------------------------------- |
145 // |
145 // |
146 CSDownlink::CSDownlink(MCSPDevSoundObserver& aObserver) : |
146 TMSCSDownlink::TMSCSDownlink(TMSCSPDevSoundObserver& aObserver) : |
147 CSPDevSound(aObserver) |
147 TMSCSPDevSound(aObserver) |
148 { |
148 { |
149 } |
149 } |
150 |
150 |
151 // ----------------------------------------------------------------------------- |
151 // ----------------------------------------------------------------------------- |
152 // Second phase constructor |
152 // Second phase constructor |
153 // ----------------------------------------------------------------------------- |
153 // ----------------------------------------------------------------------------- |
154 // |
154 // |
155 void CSDownlink::ConstructL() |
155 void TMSCSDownlink::ConstructL() |
156 { |
156 { |
157 CSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink, |
157 TMSCSPDevSound::ConstructL(EMMFStatePlaying, KAudioPrefCSCallDownlink, |
158 KAudioPriorityCSCallDownlink); |
158 KAudioPriorityCSCallDownlink); |
159 |
159 |
160 if (iDevSound) |
160 if (iDevSound) |
161 { |
161 { |
162 iDevSound->SetVolume(KDefaultVolume); |
162 iDevSound->SetVolume(KDefaultVolume); |