34
|
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: CMpxVideoPlayerAppUiEngine
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
36
|
18 |
// Version : %version: 5 %
|
34
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
#ifndef CMPXVIDEOPLAYERAPPUIENGINE_H
|
|
23 |
#define CMPXVIDEOPLAYERAPPUIENGINE_H
|
|
24 |
|
|
25 |
#include <e32base.h>
|
|
26 |
#include <mpxplaybackutility.h>
|
|
27 |
#include <mpxviewutility.h>
|
|
28 |
#include <mpxcollectionutility.h>
|
|
29 |
#include <mpxmessage2.h>
|
|
30 |
#include <mpxcollectionplaylist.h>
|
|
31 |
#include <mediarecognizer.h>
|
|
32 |
#include <mpxplaybackobserver.h>
|
|
33 |
#include <mpxviewactivationobserver.h>
|
|
34 |
#include <mpxcollectionobserver.h>
|
|
35 |
#include <mpxcollectionuihelperobserver.h>
|
|
36 |
|
|
37 |
class CMPXCommonUiHelper;
|
|
38 |
class MMPXCollectionUiHelper;
|
|
39 |
class CVideoPlaylistUtility;
|
|
40 |
class QMpxVideoPlaybackWrapper;
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Application UI class.
|
|
44 |
*
|
|
45 |
* @lib mpxvideoplayer.exe
|
|
46 |
* @since MpxVideoPlayer 0.1
|
|
47 |
*/
|
|
48 |
class CMpxVideoPlayerAppUiEngine : public CBase,
|
|
49 |
public MMPXPlaybackObserver,
|
|
50 |
public MMPXViewActivationObserver,
|
|
51 |
public MMPXCollectionObserver ,
|
|
52 |
public MMPXCHelperEmbeddedOpenObserver
|
|
53 |
{
|
|
54 |
public: // Constructors and destructor
|
|
55 |
static CMpxVideoPlayerAppUiEngine* NewL( QMpxVideoPlaybackWrapper* aWrapper );
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Destructor.
|
|
59 |
*/
|
|
60 |
virtual ~CMpxVideoPlayerAppUiEngine();
|
|
61 |
|
|
62 |
public:
|
|
63 |
/*
|
|
64 |
* Retrieve the playback utility pointer
|
|
65 |
*/
|
|
66 |
inline MMPXPlaybackUtility* PlaybackUtility();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Opens the specified file in response to a corresponding message.
|
|
70 |
*
|
|
71 |
* @param aFile File to be opened.
|
|
72 |
*/
|
36
|
73 |
void OpenFileL( const TDesC& aFileName );
|
|
74 |
|
34
|
75 |
/**
|
|
76 |
* Opens the specified file in response to a corresponding message.
|
|
77 |
*
|
|
78 |
* @param aFile File to be opened.
|
36
|
79 |
*/
|
|
80 |
void OpenFileL( RFile& aFile );
|
34
|
81 |
|
|
82 |
/**
|
|
83 |
* Opens the specified mpx media object.
|
|
84 |
*
|
|
85 |
* @param aMedia Media to be opened.
|
|
86 |
*/
|
|
87 |
void OpenMediaL( const CMPXMedia& aMedia );
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Handle playback message
|
|
91 |
*
|
|
92 |
* @param aMessage playback message
|
|
93 |
*/
|
|
94 |
void DoHandlePlaybackMessageL( const CMPXMessage& aMessage );
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Handle Player Changed Playback Message
|
|
98 |
*/
|
|
99 |
void HandlePlaybackPlayerChangedL();
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Sets mpx components ready for application shutdown
|
|
103 |
*/
|
|
104 |
void PrepareCloseMpxL();
|
|
105 |
|
|
106 |
/**
|
|
107 |
* Handle media properties.
|
|
108 |
*/
|
|
109 |
void DoHandelCollectionMediaL( const CMPXMedia& aMedia );
|
|
110 |
|
|
111 |
/*
|
|
112 |
* Handle embedded playback message
|
|
113 |
* @param aMessageUid message identification uid
|
|
114 |
* @param aMessageParameters aiw generic parameters
|
|
115 |
*/
|
|
116 |
TBool HandleMessageL( TUid aMessageUid,
|
|
117 |
const TDesC8& aMessageParameters );
|
|
118 |
|
|
119 |
/**
|
|
120 |
* From MMPXPlaybackObserver
|
|
121 |
* Handle playback message
|
|
122 |
*
|
|
123 |
* @since 3.1
|
|
124 |
* @param aMessage playback message
|
|
125 |
* @param aErr system error code.
|
|
126 |
*/
|
|
127 |
void HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError );
|
|
128 |
|
|
129 |
/**
|
|
130 |
* From MMPXViewActivationObserver
|
|
131 |
* Handle view activation.
|
|
132 |
*
|
|
133 |
* @since 3.1
|
|
134 |
* @param aCurrentViewType Current view type Uid.
|
|
135 |
* @param aPreviousViewType Previous view type Uid.
|
|
136 |
*/
|
|
137 |
void HandleViewActivation( const TUid& aCurrentViewType, const TUid& aPreviousViewType );
|
|
138 |
|
|
139 |
|
|
140 |
/**
|
|
141 |
* From MPXCollectionObserver
|
|
142 |
* @since S60 3.2.3
|
|
143 |
* @param aMessage collection message, ownership not transferred.
|
|
144 |
* Please check aMsg is not NULL before using it. If aErr is not
|
|
145 |
* KErrNone, plugin might still call back with more info in the aMsg.
|
|
146 |
* @param aErr system error code
|
|
147 |
*/
|
|
148 |
void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/ );
|
|
149 |
|
|
150 |
/**
|
|
151 |
* From MMPXCollectionObserver
|
|
152 |
* Handle media properties.
|
|
153 |
*
|
|
154 |
* @since 3.1
|
|
155 |
* @param aMedia media properties.
|
|
156 |
* @param aError Error code.
|
|
157 |
*/
|
|
158 |
void HandleCollectionMediaL( const CMPXMedia& aMedia, TInt aError );
|
|
159 |
|
|
160 |
/**
|
|
161 |
* From MMPXCollectionObserver
|
|
162 |
* Handles the collection entries being opened.
|
|
163 |
*
|
|
164 |
* @since 3.1
|
|
165 |
* @param aEntries Collection entries opened.
|
|
166 |
* @param aIndex Focused entry.
|
|
167 |
* @param aComplete ETrue no more entries. EFalse more entries
|
|
168 |
* expected.
|
|
169 |
* @param aError Error code.
|
|
170 |
*/
|
|
171 |
void HandleOpenL( const CMPXMedia& aEntries,
|
|
172 |
TInt aIndex,
|
|
173 |
TBool aComplete,
|
|
174 |
TInt aError );
|
|
175 |
|
|
176 |
/**
|
|
177 |
* From MMPXCollectionObserver
|
|
178 |
* Handles the item being opened.
|
|
179 |
*
|
|
180 |
* @since 3.1
|
|
181 |
* @param aPlaylist Collection playlist, owner ship is transfered.
|
|
182 |
* @param aError Error code.
|
|
183 |
*/
|
|
184 |
void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, TInt aError);
|
|
185 |
|
|
186 |
// from base class MMPXCHelperEmbeddedOpenObserver
|
|
187 |
/**
|
|
188 |
* From MMPXCHelperEmbeddedOpenObserver
|
|
189 |
* Handles errors from opening in embedded mode
|
|
190 |
*
|
|
191 |
* @since 3.1
|
|
192 |
* @param aErr Error code
|
|
193 |
* @param aCategory Type of item to be opened.
|
|
194 |
*/
|
|
195 |
void HandleEmbeddedOpenL( TInt aErr, TMPXGeneralCategory aCategory );
|
36
|
196 |
|
35
|
197 |
/*
|
|
198 |
* Late initializatoin of members that can be delayed
|
|
199 |
* to help improve startup time
|
|
200 |
* @since 10.1
|
|
201 |
*/
|
|
202 |
void LateInitL();
|
34
|
203 |
|
|
204 |
private:
|
|
205 |
/**
|
|
206 |
* Constructor
|
|
207 |
*/
|
|
208 |
CMpxVideoPlayerAppUiEngine( QMpxVideoPlaybackWrapper* aWrapper );
|
|
209 |
|
|
210 |
/**
|
|
211 |
* By default Symbian 2nd phase constructor is private.
|
|
212 |
*/
|
|
213 |
void ConstructL();
|
|
214 |
|
|
215 |
|
|
216 |
void HandleMultiLinksFileL( const TDesC& aFileName,
|
|
217 |
CMediaRecognizer::TMediaType aMediaType );
|
|
218 |
|
|
219 |
void HandleMultiLinksFileL( RFile& aFile,
|
|
220 |
CMediaRecognizer::TMediaType aMediaType );
|
|
221 |
|
|
222 |
void DoHandleMultiLinksFileL( CVideoPlaylistUtility* aPlaylistUtil,
|
|
223 |
TBool aSingleLink,
|
|
224 |
TBool aLocalFile );
|
|
225 |
|
|
226 |
/**
|
|
227 |
* Handles the Url descriptor
|
|
228 |
*
|
|
229 |
* @param aUrl - the ulr to be handled
|
|
230 |
*/
|
|
231 |
void HandleUrlDesL(const TDesC& aUrl);
|
|
232 |
|
36
|
233 |
/**
|
|
234 |
* Handle collection message
|
|
235 |
*
|
|
236 |
* @param aMessage collection message
|
|
237 |
*/
|
34
|
238 |
void DoHandleCollectionMessageL( CMPXMessage* aMessage );
|
|
239 |
|
36
|
240 |
void CreatePlaybackUtilityL();
|
34
|
241 |
|
|
242 |
void CreateCollectionUtilityMemberVariablesL();
|
36
|
243 |
|
34
|
244 |
/*
|
|
245 |
* used to send media info to plugin
|
|
246 |
*/
|
|
247 |
void UpdatePbPluginMediaL();
|
|
248 |
|
|
249 |
void ActivateVideoPlaybackView();
|
|
250 |
|
|
251 |
private: // data
|
|
252 |
|
|
253 |
//
|
|
254 |
// Owned Utilities
|
|
255 |
//
|
|
256 |
MMPXPlaybackUtility* iPlaybackUtility;
|
|
257 |
MMPXCollectionUtility* iCollectionUtility;
|
|
258 |
MMPXCollectionUiHelper* iCollectionUiHelper; // own
|
|
259 |
|
|
260 |
TUid iVideoCollectionId;
|
|
261 |
|
|
262 |
CMediaRecognizer* iRecognizer; // own
|
|
263 |
|
|
264 |
TInt iAccessPointId;
|
|
265 |
TBool iMultilinkPlaylist;
|
|
266 |
TBool iSeekable;
|
|
267 |
TBool iUpdateSeekInfo;
|
|
268 |
|
|
269 |
QMpxVideoPlaybackWrapper* iPlaybackWrapper;
|
|
270 |
};
|
|
271 |
|
|
272 |
//
|
|
273 |
// Inline methods
|
|
274 |
//
|
|
275 |
inline
|
|
276 |
MMPXPlaybackUtility* CMpxVideoPlayerAppUiEngine::PlaybackUtility()
|
|
277 |
{
|
|
278 |
return iPlaybackUtility;
|
|
279 |
}
|
|
280 |
|
|
281 |
#endif // CMPXVIDEOPLAYERAPPUIENGINE_H
|