|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef IRQMMFADAPTER_H_ |
|
18 #define IRQMMFADAPTER_H_ |
|
19 |
|
20 #include <videoplayer2.h> |
|
21 #include <MMFMetadataEventConfigConstants.h> |
|
22 #include "irqplayeradapterinterface.h" |
|
23 |
|
24 class IRQMetaData; |
|
25 |
|
26 /** |
|
27 * This class wraps the MMF interface CVideoPlayerUtility |
|
28 */ |
|
29 class IRQMMFAdapter : public IRQPlayerAdapterInterface, |
|
30 public MVideoPlayerUtilityObserver, |
|
31 public MVideoLoadingObserver |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 IRQMMFAdapter(); |
|
37 ~IRQMMFAdapter(); |
|
38 |
|
39 // IRQPlayerAdapterInterface methods |
|
40 void playStation(const QString &aUrl, int aApId); // Play specific url via certain access point id |
|
41 void stop(); // Stop Playback |
|
42 void setVolume(int aVolume); // Set volume to player |
|
43 int getVolume(); // Get current volume from player |
|
44 void* getPlayerInstance(); // Get audio player instance for stereo effect |
|
45 |
|
46 // Callback functions, MVideoPlayerUtilityObserver methods |
|
47 void MvpuoOpenComplete(TInt aError); // Opening url completed |
|
48 void MvpuoPlayComplete(TInt aError); // Playback completed, never called |
|
49 void MvpuoEvent(const TMMFEvent& aEvent); // Events from player |
|
50 void MvpuoPrepareComplete(TInt aError); // Preparation for playback completed. |
|
51 void MvpuoFrameReady(CFbsBitmap& aFrame,TInt aError); // For video playback only. |
|
52 |
|
53 // Callback functions, MVideoLoadingObserver methods |
|
54 void MvloLoadingStarted(); // Buffering started |
|
55 void MvloLoadingComplete(); // Buffering completed. |
|
56 |
|
57 private: |
|
58 void playL(const QString &aUrl, int aApId); // Play a station |
|
59 void getRefreshedMetaDataL(TInt aIndex); // Get refreshed data from player |
|
60 void createPlayerL(); // Created player |
|
61 void destroyPlayer(); // Destroy player |
|
62 void setMetadataEventConfig(); // Enable meta data event |
|
63 static TInt isPrepareCompleted(TAny* aPointer); // Periodic called function |
|
64 void checkPrepare(); // Check if preparation completed |
|
65 |
|
66 private: |
|
67 CVideoPlayerUtility2* iVideoPlayer; |
|
68 IRQMetaData* iQMetaData; // Saving meta data |
|
69 /* |
|
70 * Sometimes the station server is on without encoder. In this case, |
|
71 * MvpuoPrepareComplete is not called after MvpuoOpenComplete. Need to stop playback |
|
72 * in this case. So start a timer to check if the preparation is complete. |
|
73 */ |
|
74 CPeriodic* iPrepareTimer; |
|
75 QString iLastArtistSongName; |
|
76 }; |
|
77 |
|
78 #endif /* IRQMMFADAPTER_H_ */ |