88 mServiceView->setEngine(engine); |
88 mServiceView->setEngine(engine); |
89 } |
89 } |
90 |
90 |
91 } |
91 } |
92 |
92 |
93 // ---------------------------------------------------------------------------- |
93 // ------------------------------------------------------------------------------------------------- |
94 // engine() |
94 // engine() |
95 // ---------------------------------------------------------------------------- |
95 // ------------------------------------------------------------------------------------------------- |
96 // |
96 // |
97 QVideoPlayerEngine* VideoServices::engine() |
97 VideoPlayerEngine* VideoServices::engine() |
98 { |
98 { |
99 MPX_DEBUG(_L("VideoServices::engine")); |
99 MPX_DEBUG(_L("VideoServices::engine")); |
100 |
100 |
101 return mEngine; |
101 return mEngine; |
102 } |
102 } |
103 |
103 |
104 // ---------------------------------------------------------------------------- |
104 // ------------------------------------------------------------------------------------------------- |
105 // VideoServices() |
105 // VideoServices() |
106 // ---------------------------------------------------------------------------- |
106 // ------------------------------------------------------------------------------------------------- |
107 // |
107 // |
108 VideoServices::VideoServices( QVideoPlayerEngine* engine ) |
108 VideoServices::VideoServices( VideoPlayerEngine* engine ) |
109 : mReferenceCount( 0 ) |
109 : mReferenceCount( 0 ) |
110 , mEngine( engine ) |
110 , mEngine( engine ) |
111 , mCurrentService( VideoServices::ENoService ) |
111 , mCurrentService( VideoServices::ENoService ) |
112 , mFetchSelected( false ) |
112 , mFetchSelected( false ) |
113 { |
113 { |
114 MPX_ENTER_EXIT(_L("VideoServices::VideoServices()")); |
114 MPX_ENTER_EXIT(_L("VideoServices::VideoServices()")); |
115 |
115 |
116 mServicePlay = new VideoServicePlay(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IVideoView")); //New service, new interface |
116 // New service, new interface |
117 mServiceView = new VideoServiceView(this, engine, QLatin1String("videoplayer.com.nokia.symbian.IFileView")); //New service, new interface |
117 mServicePlay = new VideoServicePlay( this, engine, |
118 mServiceUriFetch = new VideoServiceUriFetch(this, QLatin1String("videoplayer.com.nokia.symbian.IVideoFetch")); //New service, new interface |
118 QLatin1String("videoplayer.com.nokia.symbian.IVideoView") ); |
119 mServiceBrowse = new VideoServiceBrowse( this, QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse")); //New service, new interface |
119 |
120 |
120 // New service, new interface |
121 mServicePlayDeprecatedNewService = new VideoServicePlay(this, engine, QLatin1String("videoplayer.IVideoView")); //New service, old interface |
121 mServiceView = new VideoServiceView( this, engine, |
122 mServicePlayDeprecatedOldService = new VideoServicePlay(this, engine, QLatin1String("com.nokia.Videos.IVideoView")); //Old service, old interface |
122 QLatin1String("videoplayer.com.nokia.symbian.IFileView") ); |
123 |
123 |
124 mServiceViewDeprecatedNewService = new VideoServiceView(this, engine, QLatin1String("videoplayer.IFileView")); //New service, old interface |
124 // New service, new interface |
125 mServiceViewDeprecatedOldService = new VideoServiceView(this, engine, QLatin1String("com.nokia.Videos.IFileView")); //Old service, old interface |
125 mServiceUriFetch = new VideoServiceUriFetch( this, |
126 |
126 QLatin1String("videoplayer.com.nokia.symbian.IVideoFetch") ); |
127 mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch(this, QLatin1String("videoplayer.IVideoFetch")); //New service, old interface |
127 |
128 mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch(this, QLatin1String("com.nokia.Videos.IVideoFetch")); //Old service, old interface |
128 // New service, new interface |
129 |
129 mServiceBrowse = new VideoServiceBrowse( this, |
130 mServiceBrowseDeprecatedNewService = new VideoServiceBrowse(this, QLatin1String("videoplayer.IVideoBrowse")); //New service, old interface |
130 QLatin1String("videoplayer.com.nokia.symbian.IVideoBrowse") ); |
131 mServiceBrowseDeprecatedOldService = new VideoServiceBrowse(this, QLatin1String("com.nokia.Videos.IVideoBrowse")); //Old service, old interface |
131 |
132 } |
132 // New service, old interface |
133 |
133 mServicePlayDeprecatedNewService = new VideoServicePlay( this, engine, |
134 // ---------------------------------------------------------------------------- |
134 QLatin1String("videoplayer.IVideoView") ); |
|
135 |
|
136 // Old service, old interface |
|
137 mServicePlayDeprecatedOldService = new VideoServicePlay( this, engine, |
|
138 QLatin1String("com.nokia.Videos.IVideoView") ); |
|
139 |
|
140 // New service, old interface |
|
141 mServiceViewDeprecatedNewService = new VideoServiceView( this, engine, |
|
142 QLatin1String("videoplayer.IFileView") ); |
|
143 |
|
144 // Old service, old interface |
|
145 mServiceViewDeprecatedOldService = new VideoServiceView( this, engine, |
|
146 QLatin1String("com.nokia.Videos.IFileView") ); |
|
147 |
|
148 // New service, old interface |
|
149 mServiceUriFetchDeprecatedNewService = new VideoServiceUriFetch( this, |
|
150 QLatin1String("videoplayer.IVideoFetch") ); |
|
151 |
|
152 // Old service, old interface |
|
153 mServiceUriFetchDeprecatedOldService = new VideoServiceUriFetch( this, |
|
154 QLatin1String("com.nokia.Videos.IVideoFetch") ); |
|
155 |
|
156 // New service, old interface |
|
157 mServiceBrowseDeprecatedNewService = new VideoServiceBrowse( this, |
|
158 QLatin1String("videoplayer.IVideoBrowse")) ; |
|
159 |
|
160 // Old service, old interface |
|
161 mServiceBrowseDeprecatedOldService = new VideoServiceBrowse( this, |
|
162 QLatin1String("com.nokia.Videos.IVideoBrowse") ); |
|
163 } |
|
164 |
|
165 // ------------------------------------------------------------------------------------------------- |
135 // ~VideoServices() |
166 // ~VideoServices() |
136 // ---------------------------------------------------------------------------- |
167 // ------------------------------------------------------------------------------------------------- |
137 // |
168 // |
138 VideoServices::~VideoServices() |
169 VideoServices::~VideoServices() |
139 { |
170 { |
140 MPX_ENTER_EXIT(_L("VideoServices::~VideoServices()")); |
171 MPX_ENTER_EXIT(_L("VideoServices::~VideoServices()")); |
141 |
172 |
151 delete mServiceUriFetchDeprecatedNewService; |
182 delete mServiceUriFetchDeprecatedNewService; |
152 delete mServiceBrowseDeprecatedOldService; |
183 delete mServiceBrowseDeprecatedOldService; |
153 delete mServiceUriFetchDeprecatedOldService; |
184 delete mServiceUriFetchDeprecatedOldService; |
154 } |
185 } |
155 |
186 |
156 // ---------------------------------------------------------------------------- |
187 // ------------------------------------------------------------------------------------------------- |
157 // currentService() |
188 // currentService() |
158 // ---------------------------------------------------------------------------- |
189 // ------------------------------------------------------------------------------------------------- |
159 // |
190 // |
160 VideoServices::TVideoService VideoServices::currentService() |
191 VideoServices::TVideoService VideoServices::currentService() |
161 { |
192 { |
162 MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService ); |
193 MPX_DEBUG(_L("VideoServices::currentService() ret %d"), mCurrentService ); |
163 |
194 |
164 return mCurrentService; |
195 return mCurrentService; |
165 } |
196 } |
166 |
197 |
167 // ---------------------------------------------------------------------------- |
198 // ------------------------------------------------------------------------------------------------- |
168 // getBrowseCategory() |
199 // getBrowseCategory() |
169 // ---------------------------------------------------------------------------- |
200 // ------------------------------------------------------------------------------------------------- |
170 // |
201 // |
171 int VideoServices::getBrowseCategory() const |
202 int VideoServices::getBrowseCategory() const |
172 { |
203 { |
173 MPX_DEBUG(_L("VideoServices::getBrowseCategory()")); |
204 MPX_DEBUG(_L("VideoServices::getBrowseCategory()")); |
174 |
205 |
175 int category = 0; |
206 int category = 0; |
176 |
207 |
177 if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) |
208 if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
178 { |
209 { |
179 category = mServiceBrowse->getBrowseCategory(); |
210 category = mServiceBrowse->getBrowseCategory(); |
180 } |
211 } |
181 else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) |
212 else if ( mServiceBrowseDeprecatedNewService && |
182 { |
213 mServiceBrowseDeprecatedOldService && |
183 if (mServiceBrowseDeprecatedNewService->isActive()) |
214 ! ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
184 { |
215 { |
185 category = mServiceBrowseDeprecatedNewService->getBrowseCategory(); |
216 if ( mServiceBrowseDeprecatedNewService->isActive() ) |
|
217 { |
|
218 category = mServiceBrowseDeprecatedNewService->getBrowseCategory(); |
186 } |
219 } |
187 else |
220 else |
188 { |
221 { |
189 category = mServiceBrowseDeprecatedOldService->getBrowseCategory(); |
222 category = mServiceBrowseDeprecatedOldService->getBrowseCategory(); |
190 } |
223 } |
191 } |
224 } |
192 |
225 |
193 return category; |
226 return category; |
194 } |
227 } |
195 |
228 |
196 // ---------------------------------------------------------------------------- |
229 // ------------------------------------------------------------------------------------------------- |
197 // setCurrentService() |
230 // setCurrentService() |
198 // ---------------------------------------------------------------------------- |
231 // ------------------------------------------------------------------------------------------------- |
199 // |
232 // |
200 void VideoServices::setCurrentService(VideoServices::TVideoService service) |
233 void VideoServices::setCurrentService(VideoServices::TVideoService service) |
201 { |
234 { |
202 MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service ); |
235 MPX_DEBUG(_L("VideoServices::setCurrentService(%d)"), service ); |
203 |
236 |
204 mCurrentService = service; |
237 mCurrentService = service; |
205 } |
238 } |
206 |
239 |
207 // ---------------------------------------------------------------------------- |
240 // ------------------------------------------------------------------------------------------------- |
208 // contextTitle() |
241 // contextTitle() |
209 // ---------------------------------------------------------------------------- |
242 // ------------------------------------------------------------------------------------------------- |
210 // |
243 // |
211 QString VideoServices::contextTitle() const |
244 QString VideoServices::contextTitle() const |
212 { |
245 { |
213 MPX_DEBUG(_L("VideoServices::contextTitle()") ); |
246 MPX_DEBUG(_L("VideoServices::contextTitle()") ); |
214 |
247 |
215 QString title; |
248 QString title; |
216 |
249 |
217 if (mCurrentService == VideoServices::EUriFetcher) |
250 if ( mCurrentService == VideoServices::EUriFetcher ) |
218 { |
251 { |
219 if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) |
252 if ( mServiceUriFetch && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
220 { |
253 { |
221 title = mServiceUriFetch->contextTitle(); |
254 title = mServiceUriFetch->contextTitle(); |
222 } |
255 } |
223 else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) |
256 else if ( mServiceUriFetchDeprecatedNewService && |
224 { |
257 mServiceUriFetchDeprecatedOldService && |
225 if(mServiceUriFetchDeprecatedNewService->isActive()) |
258 ! ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
226 { |
259 { |
227 title = mServiceUriFetchDeprecatedNewService->contextTitle(); |
260 |
228 } |
261 if ( mServiceUriFetchDeprecatedNewService->isActive() ) |
229 else |
262 { |
230 { |
263 title = mServiceUriFetchDeprecatedNewService->contextTitle(); |
231 title = mServiceUriFetchDeprecatedOldService->contextTitle(); |
264 } |
232 } |
265 else |
233 } |
266 { |
234 } |
267 title = mServiceUriFetchDeprecatedOldService->contextTitle(); |
235 else if (mCurrentService == VideoServices::EBrowse) |
268 } |
236 { |
269 } |
237 if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) |
270 } |
238 { |
271 else if ( mCurrentService == VideoServices::EBrowse ) |
239 title = mServiceBrowse->contextTitle(); |
272 { |
240 } |
273 if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
241 else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) |
274 { |
242 { |
275 title = mServiceBrowse->contextTitle(); |
243 if (mServiceBrowseDeprecatedNewService->isActive()) |
276 } |
244 { |
277 else if ( mServiceBrowseDeprecatedNewService && |
245 title = mServiceBrowseDeprecatedNewService->contextTitle(); |
278 mServiceBrowseDeprecatedOldService && |
246 } |
279 ! ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
247 else |
280 { |
248 { |
281 if ( mServiceBrowseDeprecatedNewService->isActive() ) |
249 title = mServiceBrowseDeprecatedOldService->contextTitle(); |
282 { |
250 } |
283 title = mServiceBrowseDeprecatedNewService->contextTitle(); |
251 } |
284 } |
|
285 else |
|
286 { |
|
287 title = mServiceBrowseDeprecatedOldService->contextTitle(); |
|
288 } |
|
289 } |
252 } |
290 } |
253 |
291 |
254 return title; |
292 return title; |
255 } |
293 } |
256 |
294 |
257 // ---------------------------------------------------------------------------- |
295 // ------------------------------------------------------------------------------------------------- |
258 // sortRole() |
296 // sortRole() |
259 // ---------------------------------------------------------------------------- |
297 // ------------------------------------------------------------------------------------------------- |
260 // |
298 // |
261 int VideoServices::sortRole() const |
299 int VideoServices::sortRole() const |
262 { |
300 { |
263 MPX_ENTER_EXIT(_L("VideoServices::sortType()")); |
301 MPX_ENTER_EXIT(_L("VideoServices::sortType()")); |
264 |
302 |
265 int sortRole = 0; |
303 int sortRole = 0; |
266 |
304 |
267 if (mCurrentService == EBrowse) |
305 if ( mCurrentService == EBrowse ) |
268 { |
306 { |
269 if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) |
307 if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
270 { |
308 { |
271 sortRole = mServiceBrowse->sortRole(); |
309 sortRole = mServiceBrowse->sortRole(); |
272 } |
310 } |
273 else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) |
311 else if ( mServiceBrowseDeprecatedNewService && |
274 { |
312 mServiceBrowseDeprecatedOldService && |
275 if (mServiceBrowseDeprecatedNewService->isActive()) |
313 ! ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
276 { |
314 { |
277 sortRole = mServiceBrowseDeprecatedNewService->sortRole(); |
315 if ( mServiceBrowseDeprecatedNewService->isActive() ) |
278 } |
316 { |
279 else |
317 sortRole = mServiceBrowseDeprecatedNewService->sortRole(); |
280 { |
318 } |
281 sortRole = mServiceBrowseDeprecatedOldService->sortRole(); |
319 else |
282 } |
320 { |
283 } |
321 sortRole = mServiceBrowseDeprecatedOldService->sortRole(); |
|
322 } |
|
323 } |
284 } |
324 } |
285 |
325 |
286 return sortRole; |
326 return sortRole; |
287 } |
327 } |
288 |
328 |
289 // ---------------------------------------------------------------------------- |
329 // ------------------------------------------------------------------------------------------------- |
290 // itemSelected() |
330 // itemSelected() |
291 // ---------------------------------------------------------------------------- |
331 // ------------------------------------------------------------------------------------------------- |
292 // |
332 // |
293 void VideoServices::itemSelected(const QString& item) |
333 void VideoServices::itemSelected(const QString& item) |
294 { |
334 { |
295 MPX_ENTER_EXIT(_L("VideoServices::itemSelected()"), |
335 MPX_ENTER_EXIT(_L("VideoServices::itemSelected()"), |
296 _L("item = %s"), item.data() ); |
336 _L("item = %s"), item.data() ); |
297 |
337 |
298 QStringList list; |
338 QStringList list; |
299 list.append( item ); |
339 list.append( item ); |
300 |
340 |
301 if(mServiceUriFetch && (XQServiceUtil::interfaceName().contains("symbian"))) |
341 if( mServiceUriFetch && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
302 { |
342 { |
303 mServiceUriFetch->complete( list ); |
343 mServiceUriFetch->complete( list ); |
304 } |
344 } |
305 else if (mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService) |
345 else if ( mServiceUriFetchDeprecatedNewService && mServiceUriFetchDeprecatedOldService ) |
306 { |
346 { |
307 if (mServiceUriFetchDeprecatedNewService->isActive()) |
347 if ( mServiceUriFetchDeprecatedNewService->isActive() ) |
308 { |
348 { |
309 mServiceUriFetchDeprecatedNewService->complete( list ); |
349 mServiceUriFetchDeprecatedNewService->complete( list ); |
310 } |
350 } |
311 else |
351 else |
312 { |
352 { |
313 mServiceUriFetchDeprecatedOldService->complete( list ); |
353 mServiceUriFetchDeprecatedOldService->complete( list ); |
314 } |
354 } |
315 } |
355 } |
|
356 |
316 mFetchSelected = true; |
357 mFetchSelected = true; |
317 } |
358 } |
318 |
359 |
319 // ---------------------------------------------------------------------------- |
360 // ------------------------------------------------------------------------------------------------- |
320 // browsingEnded() |
361 // browsingEnded() |
321 // ---------------------------------------------------------------------------- |
362 // ------------------------------------------------------------------------------------------------- |
322 // |
363 // |
323 void VideoServices::browsingEnded() |
364 void VideoServices::browsingEnded() |
324 { |
365 { |
325 MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()")); |
366 MPX_ENTER_EXIT(_L("VideoServices::browsingEnded()")); |
326 |
367 |
327 if ( mServiceBrowse && (XQServiceUtil::interfaceName().contains("symbian"))) |
368 if ( mServiceBrowse && ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
328 { |
369 { |
329 mServiceBrowse->complete(); |
370 mServiceBrowse->complete(); |
330 } |
371 } |
331 else if ( mServiceBrowseDeprecatedNewService && mServiceBrowseDeprecatedOldService && !(XQServiceUtil::interfaceName().contains("symbian"))) |
372 else if ( mServiceBrowseDeprecatedNewService && |
332 { |
373 mServiceBrowseDeprecatedOldService && |
333 if (mServiceBrowseDeprecatedNewService->isActive()) |
374 ! ( XQServiceUtil::interfaceName().contains("symbian") ) ) |
334 { |
375 { |
335 mServiceBrowseDeprecatedNewService->complete(); |
376 if ( mServiceBrowseDeprecatedNewService->isActive() ) |
|
377 { |
|
378 mServiceBrowseDeprecatedNewService->complete(); |
336 } |
379 } |
337 else |
380 else |
338 { |
381 { |
339 mServiceBrowseDeprecatedOldService->complete(); |
382 mServiceBrowseDeprecatedOldService->complete(); |
340 } |
383 } |
341 } |
384 } |
342 } |
385 } |
343 |
386 |
344 // End of file |
387 // End of file |