|
1 /* |
|
2 * Copyright (c) 2006 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: AO for performing rendering commands |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_UPNPAVRENDERINGACTIVE_H |
|
24 #define C_UPNPAVRENDERINGACTIVE_H |
|
25 |
|
26 #include <e32std.h> |
|
27 #include <e32base.h> |
|
28 #include "upnpavrenderingsessionobserver.h" |
|
29 |
|
30 class RUPnPAVControllerClient; |
|
31 class CUpnpItem; |
|
32 //class CUPnPAVRenderingSessionImpl; |
|
33 |
|
34 /** |
|
35 * ?one_line_short_description |
|
36 * |
|
37 * ?more_complete_description |
|
38 * |
|
39 * @lib upnpavcontrollerclient.lib |
|
40 * @since S60 v3.1 |
|
41 */ |
|
42 class CUPnPAVRenderingActive : public CActive |
|
43 { |
|
44 |
|
45 private: |
|
46 |
|
47 /** |
|
48 * Enumeration to define the action |
|
49 */ |
|
50 enum TPendingOperation |
|
51 { |
|
52 ENone = 0, |
|
53 ESetURI, |
|
54 ESetNextURI, |
|
55 EPlay, |
|
56 EStop, |
|
57 EPause, |
|
58 ESetVolume, |
|
59 EGetVolume, |
|
60 ESetMute, |
|
61 EGetMute, |
|
62 EPositionInfo, |
|
63 EStartMediaServer |
|
64 }; |
|
65 |
|
66 public: |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. |
|
70 * |
|
71 * @param aServer session handle |
|
72 * @param aId session id |
|
73 * @return an instance |
|
74 */ |
|
75 static CUPnPAVRenderingActive* NewL( |
|
76 RUPnPAVControllerClient& aServer, TInt aId ); |
|
77 |
|
78 /** |
|
79 * Destructor |
|
80 */ |
|
81 virtual ~CUPnPAVRenderingActive(); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * Constructor |
|
87 */ |
|
88 CUPnPAVRenderingActive( RUPnPAVControllerClient& aServer, TInt aId ); |
|
89 |
|
90 /** |
|
91 * 2nd phase construct |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 protected: // From CActive |
|
96 |
|
97 /** |
|
98 * See e32base.h |
|
99 */ |
|
100 void RunL(); |
|
101 |
|
102 /** |
|
103 * See e32base.h |
|
104 */ |
|
105 void DoCancel(); |
|
106 |
|
107 /** |
|
108 * See e32base.h |
|
109 */ |
|
110 TInt RunError( TInt aError ); |
|
111 |
|
112 public: // New functions |
|
113 |
|
114 /** |
|
115 * Sets Media observer instance |
|
116 * |
|
117 * @since Series 60 3.1 |
|
118 * @param aInstance MUPnPAVMediaObserver instance of the class that |
|
119 * implements the IF |
|
120 * @return TInt status |
|
121 */ |
|
122 void SetObserver( MUPnPAVRenderingSessionObserver& aObserver ); |
|
123 |
|
124 /** |
|
125 * See upnpavrenderingsession.h |
|
126 */ |
|
127 void RemoveObserver(); |
|
128 |
|
129 /** |
|
130 * See upnpavrenderingsession.h |
|
131 */ |
|
132 MUPnPAVRenderingSessionObserver* Observer() const; |
|
133 |
|
134 /** |
|
135 * See upnpavrenderingsession.h |
|
136 */ |
|
137 void ReserveLocalMSServicesL(); |
|
138 |
|
139 /** |
|
140 * See upnpavrenderingsession.h |
|
141 */ |
|
142 void CancelReserveLocalMSServicesL(); |
|
143 |
|
144 /** |
|
145 * See upnpavrenderingsession.h |
|
146 */ |
|
147 void ReleaseLocalMSServicesL(); |
|
148 |
|
149 /** |
|
150 * See upnpavrenderingsession.h |
|
151 */ |
|
152 void SetURIL( const TDesC8& aURI, const CUpnpItem& aItem ); |
|
153 |
|
154 /** |
|
155 * See upnpavrenderingsession.h |
|
156 */ |
|
157 void SetNextURIL( const TDesC8& aURI, const CUpnpItem& aItem ); |
|
158 |
|
159 /** |
|
160 * See upnpavrenderingsession.h |
|
161 */ |
|
162 void PlayL(); |
|
163 |
|
164 /** |
|
165 * See upnpavrenderingsession.h |
|
166 */ |
|
167 void StopL(); |
|
168 |
|
169 /** |
|
170 * See upnpavrenderingsession.h |
|
171 */ |
|
172 void PauseL(); |
|
173 |
|
174 /** |
|
175 * See upnpavrenderingsession.h |
|
176 */ |
|
177 void SetVolumeL( TInt aVolumeLevel ); |
|
178 |
|
179 /** |
|
180 * See upnpavrenderingsession.h |
|
181 */ |
|
182 void GetVolumeL(); |
|
183 |
|
184 /** |
|
185 * See upnpavrenderingsession.h |
|
186 */ |
|
187 void SetMuteL( TBool aMute ); |
|
188 |
|
189 /** |
|
190 * See upnpavrenderingsession.h |
|
191 */ |
|
192 void GetMuteL(); |
|
193 |
|
194 /** |
|
195 * See upnpavrenderingsession.h |
|
196 */ |
|
197 void GetPositionInfoL(); |
|
198 |
|
199 private: |
|
200 |
|
201 /** |
|
202 * Reset method |
|
203 */ |
|
204 void ResetL(); |
|
205 |
|
206 /** |
|
207 * Set uri response handling |
|
208 */ |
|
209 void SetURICompleteL(); |
|
210 |
|
211 /** |
|
212 * Set next uri response handling |
|
213 */ |
|
214 void SetNextURICompleteL(); |
|
215 |
|
216 /** |
|
217 * Play response handling |
|
218 */ |
|
219 void PlayCompleteL(); |
|
220 |
|
221 /** |
|
222 * Stop response handling |
|
223 */ |
|
224 void StopCompleteL(); |
|
225 |
|
226 /** |
|
227 * Pause response handling |
|
228 */ |
|
229 void PauseCompleteL(); |
|
230 |
|
231 /** |
|
232 * Set volume response handling |
|
233 */ |
|
234 void SetVolumeCompleteL(); |
|
235 |
|
236 /** |
|
237 * Get volume response handling |
|
238 */ |
|
239 void GetVolumeCompleteL(); |
|
240 |
|
241 /** |
|
242 * Set mute response handling |
|
243 */ |
|
244 void SetMuteCompleteL(); |
|
245 |
|
246 /** |
|
247 * Get mute response handling |
|
248 */ |
|
249 void GetMuteCompleteL(); |
|
250 |
|
251 /** |
|
252 * Get position info response handling |
|
253 */ |
|
254 void PositionInfoCompleteL(); |
|
255 |
|
256 /** |
|
257 * Start media server response handling |
|
258 */ |
|
259 void StartMediaServerCompleteL(); |
|
260 |
|
261 private: |
|
262 |
|
263 RUPnPAVControllerClient& iServer; |
|
264 |
|
265 TInt iId; |
|
266 |
|
267 // Buffer to pass data to server |
|
268 HBufC8* iBuffer; // owned |
|
269 TPtr8 iBufferPtr; |
|
270 |
|
271 HBufC8* iBuffer2; // owned |
|
272 TPtr8 iBufferPtr2; |
|
273 |
|
274 TInt iRespBufSize; |
|
275 TPckg<TInt> iRespBufSizePkg; |
|
276 |
|
277 TBool iMediaServerResourceReserved; |
|
278 |
|
279 TPendingOperation iPendingOperation; |
|
280 |
|
281 MUPnPAVRenderingSessionObserver* iObserver; // Not owned |
|
282 |
|
283 }; |
|
284 |
|
285 #endif // C_UPNPAVRENDERINGACTIVE_H |