|
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: Implementation of VideoPlayerEngine |
|
15 * |
|
16 */ |
|
17 |
|
18 // Version : %version: 20 % |
|
19 |
|
20 #ifndef VIDEOPLAYERENGINE_H |
|
21 #define VIDEOPLAYERENGINE_H |
|
22 |
|
23 #include <qobject.h> |
|
24 #include <mpxviewpluginqt.h> |
|
25 |
|
26 #include <f32file.h> |
|
27 |
|
28 #include "mpxhbvideocommondefs.h" |
|
29 #include "videoplayerappexport.h" |
|
30 |
|
31 //FORWARD CLASS DECLARATION |
|
32 |
|
33 class MpxViewPlugin; |
|
34 class VideoServices; |
|
35 class VideoPlaybackWrapper; |
|
36 |
|
37 /** |
|
38 * VideoPlayerEngine |
|
39 * |
|
40 */ |
|
41 class VIDEOPLAYERAPP_DLL_EXPORT VideoPlayerEngine : public QObject |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 /** |
|
47 * Constructor |
|
48 */ |
|
49 VideoPlayerEngine( bool isService = false ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~VideoPlayerEngine(); |
|
55 |
|
56 public: |
|
57 void initialize(); |
|
58 void playMedia( QString filePath ); |
|
59 void playURI( QString uri ); |
|
60 void playMedia( RFile file ); |
|
61 void setEmbedded(); |
|
62 signals: |
|
63 void applicationReady(); |
|
64 |
|
65 public slots: |
|
66 void handleCommand( int commandCode ); |
|
67 void viewReadySlot(); |
|
68 |
|
69 private slots: |
|
70 void handleQuit(); |
|
71 void serviceQuit(); |
|
72 |
|
73 private: |
|
74 void activateView( MpxHbVideoCommon::MpxHbVideoViewType viewType ); |
|
75 |
|
76 void connectView(); |
|
77 void disconnectView(); |
|
78 |
|
79 void switchView(); |
|
80 |
|
81 void loadPluginAndCreateView( MpxHbVideoCommon::MpxHbVideoViewType viewType ); |
|
82 |
|
83 void doDelayedLoad(); |
|
84 |
|
85 void createMissingViews(); |
|
86 |
|
87 void createPlaybackView(); |
|
88 |
|
89 void setCurrentView(); |
|
90 |
|
91 bool isPlayServiceInvoked(); |
|
92 |
|
93 bool shouldExit(); |
|
94 |
|
95 bool shouldActivateCollectionView(); |
|
96 |
|
97 void handlePlaybackFailure(int errorCode); |
|
98 |
|
99 private: |
|
100 bool mIsService; |
|
101 bool mEmbedded; |
|
102 bool mDelayedLoadDone; |
|
103 bool mIsPlayService; |
|
104 |
|
105 MpxViewPlugin* mCurrentViewPlugin; |
|
106 MpxViewPlugin* mPlaybackViewPlugin; |
|
107 MpxViewPlugin* mCollectionViewPlugin; |
|
108 MpxViewPlugin* mFileDetailsViewPlugin; |
|
109 |
|
110 |
|
111 VideoPlaybackWrapper *mPlaybackWrapper; |
|
112 |
|
113 VideoServices* mVideoServices; |
|
114 |
|
115 }; |
|
116 |
|
117 #endif // VIDEOPLAYERENGINE_H |
|
118 |
|
119 // EOF |