|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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 testplaybackplugin interface |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef _CTESTPLAYBACKPLUGIN_H_ |
|
19 #define _CTESTPLAYBACKPLUGIN_H_ |
|
20 |
|
21 // |
|
22 // INCLUDES |
|
23 // |
|
24 #include <mpxplaybackplugin.h> |
|
25 #include <mpxplaybackpluginversion2.h> |
|
26 |
|
27 |
|
28 // |
|
29 // CLASS DECLARATION |
|
30 // |
|
31 |
|
32 /* |
|
33 * CTestPlaybackPlugin class |
|
34 * |
|
35 */ |
|
36 |
|
37 NONSHARABLE_CLASS( CTestPlaybackPlugin ) : public CMPXPlaybackPluginVersion2 |
|
38 { |
|
39 public: |
|
40 // |
|
41 // Constructors and destructor |
|
42 // |
|
43 |
|
44 /* |
|
45 * Two-phased constructor. |
|
46 * @param aInitParams, initialization parameter |
|
47 * @return a pointer to the created instance |
|
48 */ |
|
49 static CTestPlaybackPlugin* NewL(TAny* aInitParams); |
|
50 |
|
51 /* |
|
52 * Destructor |
|
53 * Destroy the object and release all memory objects |
|
54 */ |
|
55 ~CTestPlaybackPlugin(); |
|
56 |
|
57 /* |
|
58 * Returns the current file handle iFile |
|
59 */ |
|
60 RFile GetFileHandle(); |
|
61 |
|
62 /** |
|
63 * Initializes a file for playback. |
|
64 * |
|
65 * @since S60 9.2 |
|
66 * @param aUri URI of the item |
|
67 * @param aType the mime type of the item |
|
68 * @param aAccessPoint the access point |
|
69 */ |
|
70 void InitStreamingL(const TDesC& aUri, const TDesC8& aType, TInt aAccessPoint); |
|
71 |
|
72 /** |
|
73 * Initializes a file handle for playback. |
|
74 * |
|
75 * @since S60 9.2 |
|
76 * @param aFile file handle of a file |
|
77 * @param aAccessPoint the access point |
|
78 */ |
|
79 void InitStreamingL(RFile& aFile, TInt aAccessPoint); |
|
80 |
|
81 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
82 /** |
|
83 * Initializes a file handle for playback. |
|
84 * |
|
85 * @since S60 9.2 |
|
86 * @param aFile 64 bit file handle of a file |
|
87 * @param aAccessPoint the access point |
|
88 */ |
|
89 void InitStreaming64L(RFile64& aFile, TInt aAccessPoint); |
|
90 |
|
91 /** |
|
92 * Initializes a song for playback. |
|
93 * |
|
94 * @since S60 9.2 |
|
95 * @param aFile 64 bit file handle of a song |
|
96 */ |
|
97 void Initialise64L(RFile64& aSong); |
|
98 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API |
|
99 |
|
100 private: |
|
101 // |
|
102 // CMPXPlaybackPlugin Implementation |
|
103 // |
|
104 |
|
105 /* |
|
106 * Set observer |
|
107 * |
|
108 * @param aObs observer |
|
109 */ |
|
110 void SetObserver( MMPXPlaybackPluginObserver& aObs ); |
|
111 |
|
112 /* |
|
113 * Initializes a clip for playback |
|
114 * @param aSong the song path |
|
115 */ |
|
116 void InitialiseL( const TDesC& aSong ); |
|
117 |
|
118 /* |
|
119 * Initializes a song for playback |
|
120 * @param aFile file handle of a song |
|
121 */ |
|
122 void InitialiseL( RFile& aFile ); |
|
123 |
|
124 /* |
|
125 * Executes a command on the selected song |
|
126 * @param aCmd a command |
|
127 * @param aData, data |
|
128 */ |
|
129 void CommandL( CMPXCommand& aCmd ); |
|
130 |
|
131 // Supposedly being deprecated |
|
132 // We're forced to implement this as its declared as a |
|
133 // pure virtual function by the MPX framework |
|
134 void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0); |
|
135 |
|
136 /* |
|
137 * Sets a property of the plugin |
|
138 * @param aProperty a property |
|
139 * @param aValue the value of the setting |
|
140 */ |
|
141 void SetL( TMPXPlaybackProperty aProperty , TInt aValue ); |
|
142 |
|
143 /* |
|
144 * Gets a property of the plugin (async) |
|
145 * @param aProperty a property |
|
146 */ |
|
147 void PropertyL( TMPXPlaybackProperty aProperty ) const; |
|
148 |
|
149 /* |
|
150 * Gets a list of sub players |
|
151 * @return a list of names of sub players |
|
152 */ |
|
153 void SubPlayerNamesL(); |
|
154 |
|
155 /* |
|
156 * Select a sub player |
|
157 * @param aIndex index to the sub player |
|
158 */ |
|
159 void SelectSubPlayerL( TInt aIndex ); |
|
160 |
|
161 /* |
|
162 * Returns current sub player name |
|
163 * @return friendly name of the current the sub player |
|
164 */ |
|
165 const TDesC& SubPlayerName(); |
|
166 |
|
167 /* |
|
168 * Current sub player index |
|
169 * @return index to the sub player |
|
170 */ |
|
171 TInt SubPlayerIndex() const; |
|
172 |
|
173 /* |
|
174 * Media properties of the current file (async) |
|
175 * @param aAttrs attributes requested |
|
176 */ |
|
177 void MediaL( const TArray<TMPXAttribute>& aAttrs ); |
|
178 |
|
179 /* |
|
180 * Cancel async request |
|
181 */ |
|
182 void CancelRequest(); |
|
183 |
|
184 private: |
|
185 /* |
|
186 * C++ default constructor |
|
187 */ |
|
188 CTestPlaybackPlugin(); |
|
189 |
|
190 /* |
|
191 * the second phase constructor ConstructL to safely construct things |
|
192 * that can leave |
|
193 */ |
|
194 void ConstructL(); |
|
195 |
|
196 private: |
|
197 |
|
198 HBufC* iClipName; |
|
199 RFs iFs; |
|
200 RFile iFile; |
|
201 }; |
|
202 |
|
203 #endif |