17 |
17 |
18 |
18 |
19 #include <RadioPlayerUtility.h> |
19 #include <RadioPlayerUtility.h> |
20 #include "RadioPlayerUtilityBody.h" |
20 #include "RadioPlayerUtilityBody.h" |
21 #include "RadioSession.h" |
21 #include "RadioSession.h" |
22 #include "trace.h" |
|
23 |
22 |
24 // ======== MEMBER FUNCTIONS ======== |
23 // ======== MEMBER FUNCTIONS ======== |
25 |
24 |
26 // ----------------------------------------------------------------------------- |
25 // ----------------------------------------------------------------------------- |
27 // CRadioPlayerUtility::NewL |
26 // CRadioPlayerUtility::NewL |
30 // |
29 // |
31 CRadioPlayerUtility* CRadioPlayerUtility::NewL( |
30 CRadioPlayerUtility* CRadioPlayerUtility::NewL( |
32 RRadioSession& aRadioSession, |
31 RRadioSession& aRadioSession, |
33 MRadioPlayerObserver& aObserver) |
32 MRadioPlayerObserver& aObserver) |
34 { |
33 { |
35 FUNC_LOG; |
|
36 CRadioPlayerUtility* self = new(ELeave) CRadioPlayerUtility; |
34 CRadioPlayerUtility* self = new(ELeave) CRadioPlayerUtility; |
37 CleanupStack::PushL(self); |
35 CleanupStack::PushL(self); |
38 self->iBody = CRadioPlayerUtility::CBody::NewL(aRadioSession, aObserver); |
36 self->iBody = CRadioPlayerUtility::CBody::NewL(aRadioSession, aObserver); |
39 CleanupStack::Pop(); |
37 CleanupStack::Pop(); |
40 return self; |
38 return self; |
45 // Destructor |
43 // Destructor |
46 // ----------------------------------------------------------------------------- |
44 // ----------------------------------------------------------------------------- |
47 // |
45 // |
48 EXPORT_C CRadioPlayerUtility::~CRadioPlayerUtility() |
46 EXPORT_C CRadioPlayerUtility::~CRadioPlayerUtility() |
49 { |
47 { |
50 FUNC_LOG; |
|
51 delete iBody; |
48 delete iBody; |
52 } |
49 } |
53 |
50 |
54 // ----------------------------------------------------------------------------- |
51 // ----------------------------------------------------------------------------- |
55 // CRadioPlayerUtility::CRadioPlayerUtility |
52 // CRadioPlayerUtility::CRadioPlayerUtility |
56 // (other items were commented in a header). |
53 // (other items were commented in a header). |
57 // ----------------------------------------------------------------------------- |
54 // ----------------------------------------------------------------------------- |
58 // |
55 // |
59 CRadioPlayerUtility::CRadioPlayerUtility() |
56 CRadioPlayerUtility::CRadioPlayerUtility() |
60 { |
57 { |
61 FUNC_LOG; |
|
62 } |
58 } |
63 |
59 |
64 // ----------------------------------------------------------------------------- |
60 // ----------------------------------------------------------------------------- |
65 // CRadioPlayerUtility::PlayerState |
61 // CRadioPlayerUtility::PlayerState |
66 // (other items were commented in a header). |
62 // (other items were commented in a header). |
67 // ----------------------------------------------------------------------------- |
63 // ----------------------------------------------------------------------------- |
68 // |
64 // |
69 EXPORT_C TPlayerState CRadioPlayerUtility::PlayerState() const |
65 EXPORT_C TPlayerState CRadioPlayerUtility::PlayerState() const |
70 { |
66 { |
71 FUNC_LOG; |
|
72 TPlayerState playerState; |
67 TPlayerState playerState; |
73 ASSERT(iBody); |
68 ASSERT(iBody); |
74 iBody->PlayerState(playerState); |
69 iBody->PlayerState(playerState); |
75 |
70 |
76 return playerState; |
71 return playerState; |
121 // (other items were commented in a header). |
113 // (other items were commented in a header). |
122 // ----------------------------------------------------------------------------- |
114 // ----------------------------------------------------------------------------- |
123 // |
115 // |
124 EXPORT_C TInt CRadioPlayerUtility::Mute(TBool aMute) |
116 EXPORT_C TInt CRadioPlayerUtility::Mute(TBool aMute) |
125 { |
117 { |
126 FUNC_LOG; |
|
127 ASSERT(iBody); |
118 ASSERT(iBody); |
128 return iBody->Mute(aMute); |
119 return iBody->Mute(aMute); |
129 } |
120 } |
130 |
121 |
131 // ----------------------------------------------------------------------------- |
122 // ----------------------------------------------------------------------------- |
148 // (other items were commented in a header). |
138 // (other items were commented in a header). |
149 // ----------------------------------------------------------------------------- |
139 // ----------------------------------------------------------------------------- |
150 // |
140 // |
151 EXPORT_C TInt CRadioPlayerUtility::SetVolume(TInt aVolume) |
141 EXPORT_C TInt CRadioPlayerUtility::SetVolume(TInt aVolume) |
152 { |
142 { |
153 FUNC_LOG; |
|
154 ASSERT(iBody); |
143 ASSERT(iBody); |
155 return iBody->SetVolume(aVolume); |
144 return iBody->SetVolume(aVolume); |
156 } |
145 } |
157 |
146 |
158 // ----------------------------------------------------------------------------- |
147 // ----------------------------------------------------------------------------- |
161 // (other items were commented in a header). |
150 // (other items were commented in a header). |
162 // ----------------------------------------------------------------------------- |
151 // ----------------------------------------------------------------------------- |
163 // |
152 // |
164 EXPORT_C TInt CRadioPlayerUtility::GetVolume(TInt& aVolume) const |
153 EXPORT_C TInt CRadioPlayerUtility::GetVolume(TInt& aVolume) const |
165 { |
154 { |
166 FUNC_LOG; |
|
167 ASSERT(iBody); |
155 ASSERT(iBody); |
168 return iBody->GetVolume(aVolume); |
156 return iBody->GetVolume(aVolume); |
169 } |
157 } |
170 |
158 |
171 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
175 // ----------------------------------------------------------------------------- |
163 // ----------------------------------------------------------------------------- |
176 // |
164 // |
177 EXPORT_C TInt CRadioPlayerUtility::SetVolumeRamp( |
165 EXPORT_C TInt CRadioPlayerUtility::SetVolumeRamp( |
178 const TTimeIntervalMicroSeconds& aRampInterval) |
166 const TTimeIntervalMicroSeconds& aRampInterval) |
179 { |
167 { |
180 FUNC_LOG; |
|
181 ASSERT(iBody); |
168 ASSERT(iBody); |
182 return iBody->SetVolumeRamp(aRampInterval); |
169 return iBody->SetVolumeRamp(aRampInterval); |
183 } |
170 } |
184 |
171 |
185 // ----------------------------------------------------------------------------- |
172 // ----------------------------------------------------------------------------- |
189 // ----------------------------------------------------------------------------- |
176 // ----------------------------------------------------------------------------- |
190 // |
177 // |
191 EXPORT_C TInt CRadioPlayerUtility::GetMaxVolume( |
178 EXPORT_C TInt CRadioPlayerUtility::GetMaxVolume( |
192 TInt& aMaxVolume ) const |
179 TInt& aMaxVolume ) const |
193 { |
180 { |
194 FUNC_LOG; |
|
195 ASSERT(iBody); |
181 ASSERT(iBody); |
196 return iBody->GetMaxVolume(aMaxVolume); |
182 return iBody->GetMaxVolume(aMaxVolume); |
197 } |
183 } |
198 |
184 |
199 // ----------------------------------------------------------------------------- |
185 // ----------------------------------------------------------------------------- |
204 // |
190 // |
205 EXPORT_C TInt CRadioPlayerUtility::SetBalance( |
191 EXPORT_C TInt CRadioPlayerUtility::SetBalance( |
206 TInt aLeftPercentage, |
192 TInt aLeftPercentage, |
207 TInt aRightPercentage ) |
193 TInt aRightPercentage ) |
208 { |
194 { |
209 FUNC_LOG; |
|
210 ASSERT(iBody); |
195 ASSERT(iBody); |
211 return iBody->SetBalance(aLeftPercentage, aRightPercentage); |
196 return iBody->SetBalance(aLeftPercentage, aRightPercentage); |
212 } |
197 } |
213 |
198 |
214 // ----------------------------------------------------------------------------- |
199 // ----------------------------------------------------------------------------- |
219 // |
204 // |
220 EXPORT_C TInt CRadioPlayerUtility::GetBalance( |
205 EXPORT_C TInt CRadioPlayerUtility::GetBalance( |
221 TInt& aLeftPercentage, |
206 TInt& aLeftPercentage, |
222 TInt& aRightPercentage ) const |
207 TInt& aRightPercentage ) const |
223 { |
208 { |
224 FUNC_LOG; |
|
225 ASSERT(iBody); |
209 ASSERT(iBody); |
226 return iBody->GetBalance(aLeftPercentage, aRightPercentage); |
210 return iBody->GetBalance(aLeftPercentage, aRightPercentage); |
227 } |
211 } |
228 |
212 |
229 // ----------------------------------------------------------------------------- |
213 // ----------------------------------------------------------------------------- |