18 @internalComponent |
18 @internalComponent |
19 */ |
19 */ |
20 |
20 |
21 #include "cmtpplaybackcommand.h" |
21 #include "cmtpplaybackcommand.h" |
22 #include "mtpplaybackcontrolpanic.h" |
22 #include "mtpplaybackcontrolpanic.h" |
23 |
23 #include "OstTraceDefinitions.h" |
24 // Class constants. |
24 #ifdef OST_TRACE_COMPILER_IN_USE |
25 __FLOG_STMT(_LIT8(KComponent,"CMtpPbCmd");) |
25 #include "cmtpplaybackcommandTraces.h" |
|
26 #endif |
|
27 |
26 |
28 |
27 /********************************************* |
29 /********************************************* |
28 class TMTPPbDataVolume |
30 class TMTPPbDataVolume |
29 **********************************************/ |
31 **********************************************/ |
30 TMTPPbDataVolume::TMTPPbDataVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep): |
32 TMTPPbDataVolume::TMTPPbDataVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep): |
31 iMaxVolume(aMax),iMinVolume(aMin), iDefaultVolume(aDefault), iCurrentVolume(aCurrent), iStep(aStep) |
33 iMaxVolume(aMax),iMinVolume(aMin), iDefaultVolume(aDefault), iCurrentVolume(aCurrent), iStep(aStep) |
32 { |
34 { |
|
35 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_TMTPPBDATAVOLUME_ENTRY ); |
33 __ASSERT_DEBUG((aMin < aMax), Panic(EMTPPBArgumentErr)); |
36 __ASSERT_DEBUG((aMin < aMax), Panic(EMTPPBArgumentErr)); |
34 __ASSERT_DEBUG((aMin <= aDefault && aDefault <= aMax), Panic(EMTPPBArgumentErr)); |
37 __ASSERT_DEBUG((aMin <= aDefault && aDefault <= aMax), Panic(EMTPPBArgumentErr)); |
35 __ASSERT_DEBUG((aMin <= aCurrent && aCurrent <= aMax), Panic(EMTPPBArgumentErr)); |
38 __ASSERT_DEBUG((aMin <= aCurrent && aCurrent <= aMax), Panic(EMTPPBArgumentErr)); |
36 __ASSERT_DEBUG((aStep <= (aMax-aMin)), Panic(EMTPPBArgumentErr)); |
39 __ASSERT_DEBUG((aStep <= (aMax-aMin)), Panic(EMTPPBArgumentErr)); |
37 __ASSERT_DEBUG((aStep != 0), Panic(EMTPPBArgumentErr)); |
40 __ASSERT_DEBUG((aStep != 0), Panic(EMTPPBArgumentErr)); |
|
41 OstTraceFunctionExit0( TMTPPBDATAVOLUME_TMTPPBDATAVOLUME_EXIT ); |
38 } |
42 } |
39 |
43 |
40 TMTPPbDataVolume::TMTPPbDataVolume(const TMTPPbDataVolume& aVol): |
44 TMTPPbDataVolume::TMTPPbDataVolume(const TMTPPbDataVolume& aVol): |
41 iMaxVolume(aVol.MaxVolume()), |
45 iMaxVolume(aVol.MaxVolume()), |
42 iMinVolume(aVol.MinVolume()), |
46 iMinVolume(aVol.MinVolume()), |
43 iDefaultVolume(aVol.DefaultVolume()), |
47 iDefaultVolume(aVol.DefaultVolume()), |
44 iCurrentVolume(aVol.CurrentVolume()), |
48 iCurrentVolume(aVol.CurrentVolume()), |
45 iStep(aVol.Step()) |
49 iStep(aVol.Step()) |
46 { |
50 { |
47 |
51 OstTraceFunctionEntry0( DUP1_TMTPPBDATAVOLUME_TMTPPBDATAVOLUME_ENTRY ); |
|
52 |
|
53 OstTraceFunctionExit0( DUP1_TMTPPBDATAVOLUME_TMTPPBDATAVOLUME_EXIT ); |
48 } |
54 } |
49 |
55 |
50 void TMTPPbDataVolume::SetVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep) |
56 void TMTPPbDataVolume::SetVolume(TUint32 aMax, TUint32 aMin, TUint32 aDefault, TUint32 aCurrent, TUint32 aStep) |
51 { |
57 { |
|
58 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_SETVOLUME_ENTRY ); |
52 __ASSERT_DEBUG((aMin < aMax), Panic(EMTPPBArgumentErr)); |
59 __ASSERT_DEBUG((aMin < aMax), Panic(EMTPPBArgumentErr)); |
53 __ASSERT_DEBUG((aMin <= aDefault && aDefault <= aMax), Panic(EMTPPBArgumentErr)); |
60 __ASSERT_DEBUG((aMin <= aDefault && aDefault <= aMax), Panic(EMTPPBArgumentErr)); |
54 __ASSERT_DEBUG((aMin <= aCurrent && aCurrent <= aMax), Panic(EMTPPBArgumentErr)); |
61 __ASSERT_DEBUG((aMin <= aCurrent && aCurrent <= aMax), Panic(EMTPPBArgumentErr)); |
55 __ASSERT_DEBUG((aStep <= (aMax-aMin)), Panic(EMTPPBArgumentErr)); |
62 __ASSERT_DEBUG((aStep <= (aMax-aMin)), Panic(EMTPPBArgumentErr)); |
56 __ASSERT_DEBUG((aStep != 0), Panic(EMTPPBArgumentErr)); |
63 __ASSERT_DEBUG((aStep != 0), Panic(EMTPPBArgumentErr)); |
57 iMaxVolume = aMax; |
64 iMaxVolume = aMax; |
58 iMinVolume = aMin; |
65 iMinVolume = aMin; |
59 iDefaultVolume = aDefault; |
66 iDefaultVolume = aDefault; |
60 iCurrentVolume = aCurrent, |
67 iCurrentVolume = aCurrent, |
61 iStep = aStep; |
68 iStep = aStep; |
|
69 OstTraceFunctionExit0( TMTPPBDATAVOLUME_SETVOLUME_EXIT ); |
62 } |
70 } |
63 |
71 |
64 void TMTPPbDataVolume::operator =(const TMTPPbDataVolume& aVol) |
72 void TMTPPbDataVolume::operator =(const TMTPPbDataVolume& aVol) |
65 { |
73 { |
|
74 OstTraceFunctionEntry0( _ENTRY ); |
66 iMaxVolume = aVol.MaxVolume(); |
75 iMaxVolume = aVol.MaxVolume(); |
67 iMinVolume = aVol.MinVolume(); |
76 iMinVolume = aVol.MinVolume(); |
68 iDefaultVolume = aVol.DefaultVolume(); |
77 iDefaultVolume = aVol.DefaultVolume(); |
69 iCurrentVolume = aVol.CurrentVolume(); |
78 iCurrentVolume = aVol.CurrentVolume(); |
70 iStep = aVol.Step(); |
79 iStep = aVol.Step(); |
|
80 OstTraceFunctionExit0( _EXIT ); |
71 } |
81 } |
72 |
82 |
73 TUint32 TMTPPbDataVolume::MaxVolume() const |
83 TUint32 TMTPPbDataVolume::MaxVolume() const |
74 { |
84 { |
|
85 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_MAXVOLUME_ENTRY ); |
|
86 OstTraceFunctionExit0( TMTPPBDATAVOLUME_MAXVOLUME_EXIT ); |
75 return iMaxVolume; |
87 return iMaxVolume; |
76 } |
88 } |
77 |
89 |
78 TUint32 TMTPPbDataVolume::MinVolume() const |
90 TUint32 TMTPPbDataVolume::MinVolume() const |
79 { |
91 { |
|
92 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_MINVOLUME_ENTRY ); |
|
93 OstTraceFunctionExit0( TMTPPBDATAVOLUME_MINVOLUME_EXIT ); |
80 return iMinVolume; |
94 return iMinVolume; |
81 } |
95 } |
82 |
96 |
83 TUint32 TMTPPbDataVolume::DefaultVolume() const |
97 TUint32 TMTPPbDataVolume::DefaultVolume() const |
84 { |
98 { |
|
99 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_DEFAULTVOLUME_ENTRY ); |
|
100 OstTraceFunctionExit0( TMTPPBDATAVOLUME_DEFAULTVOLUME_EXIT ); |
85 return iDefaultVolume; |
101 return iDefaultVolume; |
86 } |
102 } |
87 |
103 |
88 TUint32 TMTPPbDataVolume::CurrentVolume() const |
104 TUint32 TMTPPbDataVolume::CurrentVolume() const |
89 { |
105 { |
|
106 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_CURRENTVOLUME_ENTRY ); |
|
107 OstTraceFunctionExit0( TMTPPBDATAVOLUME_CURRENTVOLUME_EXIT ); |
90 return iCurrentVolume; |
108 return iCurrentVolume; |
91 } |
109 } |
92 |
110 |
93 TUint32 TMTPPbDataVolume::Step() const |
111 TUint32 TMTPPbDataVolume::Step() const |
94 { |
112 { |
|
113 OstTraceFunctionEntry0( TMTPPBDATAVOLUME_STEP_ENTRY ); |
|
114 OstTraceFunctionExit0( TMTPPBDATAVOLUME_STEP_EXIT ); |
95 return iStep; |
115 return iStep; |
96 } |
116 } |
97 |
117 |
98 /********************************************* |
118 /********************************************* |
99 class CMTPPbCmdParam |
119 class CMTPPbCmdParam |
100 **********************************************/ |
120 **********************************************/ |
101 |
121 |
102 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TMTPPbCategory aCategory, const TDesC& aSuid) |
122 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TMTPPbCategory aCategory, const TDesC& aSuid) |
103 { |
123 { |
|
124 OstTraceFunctionEntry0( CMTPPBCMDPARAM_NEWL_ENTRY ); |
104 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aCategory, aSuid); |
125 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aCategory, aSuid); |
105 CleanupStack::PushL(self); |
126 CleanupStack::PushL(self); |
106 self->ConstructL(aCategory, aSuid); |
127 self->ConstructL(aCategory, aSuid); |
107 CleanupStack::Pop(self); |
128 CleanupStack::Pop(self); |
|
129 OstTraceFunctionExit0( CMTPPBCMDPARAM_NEWL_EXIT ); |
108 return self; |
130 return self; |
109 } |
131 } |
110 |
132 |
111 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TInt32 aValue) |
133 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TInt32 aValue) |
112 { |
134 { |
|
135 OstTraceFunctionEntry0( DUP1_CMTPPBCMDPARAM_NEWL_ENTRY ); |
113 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aValue); |
136 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aValue); |
114 CleanupStack::PushL(self); |
137 CleanupStack::PushL(self); |
115 self->ConstructL(aValue); |
138 self->ConstructL(aValue); |
116 CleanupStack::Pop(self); |
139 CleanupStack::Pop(self); |
|
140 OstTraceFunctionExit0( DUP1_CMTPPBCMDPARAM_NEWL_EXIT ); |
117 return self; |
141 return self; |
118 } |
142 } |
119 |
143 |
120 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TUint32 aValue) |
144 CMTPPbCmdParam* CMTPPbCmdParam::NewL(TUint32 aValue) |
121 { |
145 { |
|
146 OstTraceFunctionEntry0( DUP2_CMTPPBCMDPARAM_NEWL_ENTRY ); |
122 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aValue); |
147 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aValue); |
123 CleanupStack::PushL(self); |
148 CleanupStack::PushL(self); |
124 self->ConstructL(aValue); |
149 self->ConstructL(aValue); |
125 CleanupStack::Pop(self); |
150 CleanupStack::Pop(self); |
|
151 OstTraceFunctionExit0( DUP2_CMTPPBCMDPARAM_NEWL_EXIT ); |
126 return self; |
152 return self; |
127 } |
153 } |
128 |
154 |
129 CMTPPbCmdParam* CMTPPbCmdParam::NewL(const TMTPPbDataVolume& aVolume) |
155 CMTPPbCmdParam* CMTPPbCmdParam::NewL(const TMTPPbDataVolume& aVolume) |
130 { |
156 { |
|
157 OstTraceFunctionEntry0( DUP3_CMTPPBCMDPARAM_NEWL_ENTRY ); |
131 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aVolume); |
158 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(aVolume); |
132 CleanupStack::PushL(self); |
159 CleanupStack::PushL(self); |
133 self->ConstructL(aVolume); |
160 self->ConstructL(aVolume); |
134 CleanupStack::Pop(self); |
161 CleanupStack::Pop(self); |
|
162 OstTraceFunctionExit0( DUP3_CMTPPBCMDPARAM_NEWL_EXIT ); |
135 return self; |
163 return self; |
136 } |
164 } |
137 |
165 |
138 CMTPPbCmdParam* CMTPPbCmdParam::NewL(const CMTPPbCmdParam& aParam) |
166 CMTPPbCmdParam* CMTPPbCmdParam::NewL(const CMTPPbCmdParam& aParam) |
139 { |
167 { |
|
168 OstTraceFunctionEntry0( DUP4_CMTPPBCMDPARAM_NEWL_ENTRY ); |
140 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(); |
169 CMTPPbCmdParam* self = new (ELeave) CMTPPbCmdParam(); |
141 CleanupStack::PushL(self); |
170 CleanupStack::PushL(self); |
142 self->ConstructL(aParam); |
171 self->ConstructL(aParam); |
143 CleanupStack::Pop(self); |
172 CleanupStack::Pop(self); |
|
173 OstTraceFunctionExit0( DUP4_CMTPPBCMDPARAM_NEWL_EXIT ); |
144 return self; |
174 return self; |
145 } |
175 } |
146 |
176 |
147 CMTPPbCmdParam::~CMTPPbCmdParam() |
177 CMTPPbCmdParam::~CMTPPbCmdParam() |
148 { |
178 { |
149 |
179 OstTraceFunctionEntry0( CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
|
180 |
|
181 OstTraceFunctionExit0( CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
150 } |
182 } |
151 |
183 |
152 CMTPPbCmdParam::CMTPPbCmdParam(): |
184 CMTPPbCmdParam::CMTPPbCmdParam(): |
153 CMTPPbParamBase() |
185 CMTPPbParamBase() |
154 { |
186 { |
155 |
187 OstTraceFunctionEntry0( DUP1_CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
|
188 |
|
189 OstTraceFunctionExit0( DUP1_CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
156 } |
190 } |
157 |
191 |
158 CMTPPbCmdParam::CMTPPbCmdParam(TMTPPbCategory aCategory, const TDesC& aSuid): |
192 CMTPPbCmdParam::CMTPPbCmdParam(TMTPPbCategory aCategory, const TDesC& aSuid): |
159 CMTPPbParamBase(aCategory, aSuid) |
193 CMTPPbParamBase(aCategory, aSuid) |
160 { |
194 { |
161 |
195 OstTraceFunctionEntry0( DUP2_CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
|
196 |
|
197 OstTraceFunctionExit0( DUP2_CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
162 } |
198 } |
163 |
199 |
164 CMTPPbCmdParam::CMTPPbCmdParam(TInt32 aValue): |
200 CMTPPbCmdParam::CMTPPbCmdParam(TInt32 aValue): |
165 CMTPPbParamBase(aValue) |
201 CMTPPbParamBase(aValue) |
166 { |
202 { |
167 |
203 OstTraceFunctionEntry0( DUP3_CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
|
204 |
|
205 OstTraceFunctionExit0( DUP3_CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
168 } |
206 } |
169 |
207 |
170 CMTPPbCmdParam::CMTPPbCmdParam(TUint32 aValue): |
208 CMTPPbCmdParam::CMTPPbCmdParam(TUint32 aValue): |
171 CMTPPbParamBase(aValue) |
209 CMTPPbParamBase(aValue) |
172 { |
210 { |
173 |
211 OstTraceFunctionEntry0( DUP4_CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
|
212 |
|
213 OstTraceFunctionExit0( DUP4_CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
174 } |
214 } |
175 |
215 |
176 CMTPPbCmdParam::CMTPPbCmdParam(const TMTPPbDataVolume& /*aVolume*/): |
216 CMTPPbCmdParam::CMTPPbCmdParam(const TMTPPbDataVolume& /*aVolume*/): |
177 CMTPPbParamBase() |
217 CMTPPbParamBase() |
178 { |
218 { |
|
219 OstTraceFunctionEntry0( DUP5_CMTPPBCMDPARAM_CMTPPBCMDPARAM_ENTRY ); |
179 CMTPPbParamBase::SetType(EMTPPbVolumeSet); |
220 CMTPPbParamBase::SetType(EMTPPbVolumeSet); |
|
221 OstTraceFunctionExit0( DUP5_CMTPPBCMDPARAM_CMTPPBCMDPARAM_EXIT ); |
180 } |
222 } |
181 |
223 |
182 void CMTPPbCmdParam::ConstructL(TMTPPbCategory aCategory, const TDesC& aSuid) |
224 void CMTPPbCmdParam::ConstructL(TMTPPbCategory aCategory, const TDesC& aSuid) |
183 { |
225 { |
|
226 OstTraceFunctionEntry0( CMTPPBCMDPARAM_CONSTRUCTL_ENTRY ); |
184 CMTPPbParamBase::ConstructL(aCategory, aSuid); |
227 CMTPPbParamBase::ConstructL(aCategory, aSuid); |
|
228 OstTraceFunctionExit0( CMTPPBCMDPARAM_CONSTRUCTL_EXIT ); |
185 } |
229 } |
186 |
230 |
187 void CMTPPbCmdParam::ConstructL(TInt32 aValue) |
231 void CMTPPbCmdParam::ConstructL(TInt32 aValue) |
188 { |
232 { |
|
233 OstTraceFunctionEntry0( DUP1_CMTPPBCMDPARAM_CONSTRUCTL_ENTRY ); |
189 CMTPPbParamBase::ConstructL(aValue); |
234 CMTPPbParamBase::ConstructL(aValue); |
|
235 OstTraceFunctionExit0( DUP1_CMTPPBCMDPARAM_CONSTRUCTL_EXIT ); |
190 } |
236 } |
191 |
237 |
192 void CMTPPbCmdParam::ConstructL(TUint32 aValue) |
238 void CMTPPbCmdParam::ConstructL(TUint32 aValue) |
193 { |
239 { |
|
240 OstTraceFunctionEntry0( DUP2_CMTPPBCMDPARAM_CONSTRUCTL_ENTRY ); |
194 CMTPPbParamBase::ConstructL(aValue); |
241 CMTPPbParamBase::ConstructL(aValue); |
|
242 OstTraceFunctionExit0( DUP2_CMTPPBCMDPARAM_CONSTRUCTL_EXIT ); |
195 } |
243 } |
196 |
244 |
197 void CMTPPbCmdParam::ConstructL(const TMTPPbDataVolume& aVolume) |
245 void CMTPPbCmdParam::ConstructL(const TMTPPbDataVolume& aVolume) |
198 { |
246 { |
|
247 OstTraceFunctionEntry0( DUP3_CMTPPBCMDPARAM_CONSTRUCTL_ENTRY ); |
199 TMTPPbDataVolume* val = new (ELeave) TMTPPbDataVolume(aVolume); |
248 TMTPPbDataVolume* val = new (ELeave) TMTPPbDataVolume(aVolume); |
200 CMTPPbParamBase::SetData(static_cast<TAny*>(val)); |
249 CMTPPbParamBase::SetData(static_cast<TAny*>(val)); |
|
250 OstTraceFunctionExit0( DUP3_CMTPPBCMDPARAM_CONSTRUCTL_EXIT ); |
201 } |
251 } |
202 |
252 |
203 void CMTPPbCmdParam::ConstructL(const CMTPPbCmdParam& aParam) |
253 void CMTPPbCmdParam::ConstructL(const CMTPPbCmdParam& aParam) |
204 { |
254 { |
|
255 OstTraceFunctionEntry0( DUP4_CMTPPBCMDPARAM_CONSTRUCTL_ENTRY ); |
205 TMTPPbDataType type(aParam.Type()); |
256 TMTPPbDataType type(aParam.Type()); |
206 |
257 |
207 __ASSERT_DEBUG((type > EMTPPbTypeNone && type < EMTPPbTypeEnd), Panic(EMTPPBArgumentErr)); |
258 __ASSERT_DEBUG((type > EMTPPbTypeNone && type < EMTPPbTypeEnd), Panic(EMTPPBArgumentErr)); |
208 __ASSERT_ALWAYS((type > EMTPPbTypeNone && type < EMTPPbTypeEnd), User::Leave(KErrArgument)); |
259 __ASSERT_ALWAYS_OST((type > EMTPPbTypeNone && type < EMTPPbTypeEnd), OstTrace0( TRACE_ERROR, CMTPPBCMDPARAM_CONSTRUCTL, "Error argument" ), User::Leave(KErrArgument)); |
209 |
260 |
210 if(type == EMTPPbVolumeSet) |
261 if(type == EMTPPbVolumeSet) |
211 { |
262 { |
212 TMTPPbDataVolume* val = new (ELeave) TMTPPbDataVolume(aParam.VolumeSetL()); |
263 TMTPPbDataVolume* val = new (ELeave) TMTPPbDataVolume(aParam.VolumeSetL()); |
213 CMTPPbParamBase::SetData(static_cast<TAny*>(val)); |
264 CMTPPbParamBase::SetData(static_cast<TAny*>(val)); |
215 } |
266 } |
216 else |
267 else |
217 { |
268 { |
218 CMTPPbParamBase::ConstructL(aParam); |
269 CMTPPbParamBase::ConstructL(aParam); |
219 } |
270 } |
|
271 OstTraceFunctionExit0( DUP4_CMTPPBCMDPARAM_CONSTRUCTL_EXIT ); |
220 } |
272 } |
221 |
273 |
222 const TMTPPbDataVolume& CMTPPbCmdParam::VolumeSetL() const |
274 const TMTPPbDataVolume& CMTPPbCmdParam::VolumeSetL() const |
223 { |
275 { |
|
276 OstTraceFunctionEntry0( CMTPPBCMDPARAM_VOLUMESETL_ENTRY ); |
224 __ASSERT_DEBUG((CMTPPbParamBase::Type() == EMTPPbVolumeSet), Panic(EMTPPBDataTypeErr)); |
277 __ASSERT_DEBUG((CMTPPbParamBase::Type() == EMTPPbVolumeSet), Panic(EMTPPBDataTypeErr)); |
225 __ASSERT_ALWAYS((CMTPPbParamBase::Type() == EMTPPbVolumeSet), User::Leave(KErrArgument)); |
278 __ASSERT_ALWAYS_OST((CMTPPbParamBase::Type() == EMTPPbVolumeSet), OstTrace0( TRACE_ERROR, CMTPPBCMDPARAM_VOLUMESETL, "Error argument" ), User::Leave(KErrArgument)); |
|
279 OstTraceFunctionExit0( CMTPPBCMDPARAM_VOLUMESETL_EXIT ); |
226 return *static_cast<TMTPPbDataVolume*>(CMTPPbParamBase::GetData()); |
280 return *static_cast<TMTPPbDataVolume*>(CMTPPbParamBase::GetData()); |
227 } |
281 } |
228 |
282 |
229 /********************************************* |
283 /********************************************* |
230 class CMTPPlaybackCommand |
284 class CMTPPlaybackCommand |
231 **********************************************/ |
285 **********************************************/ |
232 CMTPPlaybackCommand* CMTPPlaybackCommand::NewL(TMTPPlaybackCommand aCmd, CMTPPbCmdParam* aParam) |
286 CMTPPlaybackCommand* CMTPPlaybackCommand::NewL(TMTPPlaybackCommand aCmd, CMTPPbCmdParam* aParam) |
233 { |
287 { |
|
288 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_NEWL_ENTRY ); |
234 __ASSERT_DEBUG((aCmd > EPlaybackCmdNone && aCmd < EPlaybackCmdEnd), Panic(EMTPPBArgumentErr)); |
289 __ASSERT_DEBUG((aCmd > EPlaybackCmdNone && aCmd < EPlaybackCmdEnd), Panic(EMTPPBArgumentErr)); |
235 __ASSERT_ALWAYS((aCmd > EPlaybackCmdNone && aCmd < EPlaybackCmdEnd), User::Leave(KErrArgument)); |
290 __ASSERT_ALWAYS_OST((aCmd > EPlaybackCmdNone && aCmd < EPlaybackCmdEnd), OstTrace0( TRACE_ERROR, CMTPPLAYBACKCOMMAND_NEWL, "Error argument" ), User::Leave(KErrArgument)); |
236 |
291 |
237 CMTPPlaybackCommand* self = new (ELeave) CMTPPlaybackCommand(aCmd, aParam); |
292 CMTPPlaybackCommand* self = new (ELeave) CMTPPlaybackCommand(aCmd, aParam); |
238 CleanupStack::PushL(self); |
293 CleanupStack::PushL(self); |
239 self->ConstructL(); |
294 self->ConstructL(); |
240 CleanupStack::Pop(self); |
295 CleanupStack::Pop(self); |
|
296 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_NEWL_EXIT ); |
241 return self; |
297 return self; |
242 } |
298 } |
243 |
299 |
244 CMTPPlaybackCommand* CMTPPlaybackCommand::NewL(const CMTPPlaybackCommand& aCmd) |
300 CMTPPlaybackCommand* CMTPPlaybackCommand::NewL(const CMTPPlaybackCommand& aCmd) |
245 { |
301 { |
|
302 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKCOMMAND_NEWL_ENTRY ); |
246 CMTPPlaybackCommand* self = new (ELeave) CMTPPlaybackCommand(aCmd.PlaybackCommand(), NULL); |
303 CMTPPlaybackCommand* self = new (ELeave) CMTPPlaybackCommand(aCmd.PlaybackCommand(), NULL); |
247 CleanupStack::PushL(self); |
304 CleanupStack::PushL(self); |
248 self->ConstructL(aCmd); |
305 self->ConstructL(aCmd); |
249 CleanupStack::Pop(self); |
306 CleanupStack::Pop(self); |
|
307 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKCOMMAND_NEWL_EXIT ); |
250 return self; |
308 return self; |
251 } |
309 } |
252 |
310 |
253 /** |
311 /** |
254 Destructor. |
312 Destructor. |
255 */ |
313 */ |
256 CMTPPlaybackCommand::~CMTPPlaybackCommand() |
314 CMTPPlaybackCommand::~CMTPPlaybackCommand() |
257 { |
315 { |
258 __FLOG(_L8("~CMTPPlaybackCommand - Entry")); |
316 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_CMTPPLAYBACKCOMMAND_ENTRY ); |
259 delete iParam; |
317 delete iParam; |
260 __FLOG(_L8("~CMTPPlaybackCommand - Exit")); |
318 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_CMTPPLAYBACKCOMMAND_EXIT ); |
261 __FLOG_CLOSE; |
|
262 } |
319 } |
263 |
320 |
264 /** |
321 /** |
265 Constructor. |
322 Constructor. |
266 */ |
323 */ |
267 CMTPPlaybackCommand::CMTPPlaybackCommand(TMTPPlaybackCommand aCmd, |
324 CMTPPlaybackCommand::CMTPPlaybackCommand(TMTPPlaybackCommand aCmd, |
268 CMTPPbCmdParam* aParam): |
325 CMTPPbCmdParam* aParam): |
269 iPbCmd(aCmd),iParam(aParam) |
326 iPbCmd(aCmd),iParam(aParam) |
270 { |
327 { |
|
328 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKCOMMAND_CMTPPLAYBACKCOMMAND_ENTRY ); |
|
329 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKCOMMAND_CMTPPLAYBACKCOMMAND_EXIT ); |
271 } |
330 } |
272 |
331 |
273 /** |
332 /** |
274 Second-phase constructor. |
333 Second-phase constructor. |
275 */ |
334 */ |
276 void CMTPPlaybackCommand::ConstructL() |
335 void CMTPPlaybackCommand::ConstructL() |
277 { |
336 { |
278 __FLOG_OPEN(KMTPSubsystem, KComponent); |
337 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_CONSTRUCTL_ENTRY ); |
279 __FLOG(_L8("CMTPPlaybackCommand: ConstructL - Entry")); |
338 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_CONSTRUCTL_EXIT ); |
280 __FLOG(_L8("CMTPPlaybackCommand: ConstructL - Exit")); |
|
281 } |
339 } |
282 |
340 |
283 /** |
341 /** |
284 Second-phase constructor. |
342 Second-phase constructor. |
285 */ |
343 */ |
286 void CMTPPlaybackCommand::ConstructL(const CMTPPlaybackCommand& aCmd) |
344 void CMTPPlaybackCommand::ConstructL(const CMTPPlaybackCommand& aCmd) |
287 { |
345 { |
288 __FLOG(_L8("CMTPPlaybackCommand: ConstructL - Entry")); |
346 OstTraceFunctionEntry0( DUP1_CMTPPLAYBACKCOMMAND_CONSTRUCTL_ENTRY ); |
289 if(aCmd.HasParam()) |
347 if(aCmd.HasParam()) |
290 { |
348 { |
291 iParam = CMTPPbCmdParam::NewL(aCmd.ParamL()); |
349 iParam = CMTPPbCmdParam::NewL(aCmd.ParamL()); |
292 } |
350 } |
293 __FLOG(_L8("CMTPPlaybackCommand: ConstructL - Exit")); |
351 OstTraceFunctionExit0( DUP1_CMTPPLAYBACKCOMMAND_CONSTRUCTL_EXIT ); |
294 } |
352 } |
295 |
353 |
296 TMTPPlaybackCommand CMTPPlaybackCommand::PlaybackCommand() const |
354 TMTPPlaybackCommand CMTPPlaybackCommand::PlaybackCommand() const |
297 { |
355 { |
|
356 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_PLAYBACKCOMMAND_ENTRY ); |
298 __ASSERT_DEBUG((iPbCmd > EPlaybackCmdNone && iPbCmd < EPlaybackCmdEnd), Panic(EMTPPBArgumentErr)); |
357 __ASSERT_DEBUG((iPbCmd > EPlaybackCmdNone && iPbCmd < EPlaybackCmdEnd), Panic(EMTPPBArgumentErr)); |
|
358 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_PLAYBACKCOMMAND_EXIT ); |
299 return iPbCmd; |
359 return iPbCmd; |
300 } |
360 } |
301 |
361 |
302 TBool CMTPPlaybackCommand::HasParam() const |
362 TBool CMTPPlaybackCommand::HasParam() const |
303 { |
363 { |
|
364 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_HASPARAM_ENTRY ); |
304 TBool result(iParam != NULL); |
365 TBool result(iParam != NULL); |
|
366 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_HASPARAM_EXIT ); |
305 return result; |
367 return result; |
306 } |
368 } |
307 |
369 |
308 const CMTPPbCmdParam& CMTPPlaybackCommand::ParamL() const |
370 const CMTPPbCmdParam& CMTPPlaybackCommand::ParamL() const |
309 { |
371 { |
|
372 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_PARAML_ENTRY ); |
310 __ASSERT_DEBUG((iParam != NULL), Panic(EMTPPBDataNullErr)); |
373 __ASSERT_DEBUG((iParam != NULL), Panic(EMTPPBDataNullErr)); |
311 __ASSERT_ALWAYS((iParam != NULL), User::Leave(KErrArgument)); |
374 __ASSERT_ALWAYS_OST((iParam != NULL), OstTrace0( TRACE_ERROR, CMTPPLAYBACKCOMMAND_PARAML, "Error argument" ), User::Leave(KErrArgument)); |
312 return *iParam; |
375 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_PARAML_EXIT ); |
|
376 return *iParam; |
313 } |
377 } |
314 |
378 |
315 void CMTPPlaybackCommand::SetParam(CMTPPbCmdParam* aParam) |
379 void CMTPPlaybackCommand::SetParam(CMTPPbCmdParam* aParam) |
316 { |
380 { |
|
381 OstTraceFunctionEntry0( CMTPPLAYBACKCOMMAND_SETPARAM_ENTRY ); |
317 delete iParam; |
382 delete iParam; |
318 iParam = aParam; |
383 iParam = aParam; |
319 } |
384 OstTraceFunctionExit0( CMTPPLAYBACKCOMMAND_SETPARAM_EXIT ); |
|
385 } |