1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef VEISIMPLECUTVIDEOVIEW_H |
|
21 #define VEISIMPLECUTVIDEOVIEW_H |
|
22 |
|
23 |
|
24 #include <aknview.h> |
|
25 #include <VedMovie.h> |
|
26 #include <VedCommon.h> |
|
27 #include <aknprogressdialog.h> |
|
28 #include <utility.h> |
|
29 #include <caknmemoryselectiondialog.h> |
|
30 #include "extprogressdialog.h" |
|
31 #include "VeiSimpleCutVideoContainer.h" |
|
32 |
|
33 //class CAknTitlePane; |
|
34 class CPeriodic; |
|
35 class CVeiErrorUI; |
|
36 class CAknMemorySelectionDialog; |
|
37 class CVeiTempMaker; |
|
38 class CVeiNaviPaneControl; |
|
39 |
|
40 |
|
41 /** |
|
42 * CVeiCutVideoView view class. |
|
43 * |
|
44 */ |
|
45 class CVeiSimpleCutVideoView : public CAknView, public MVedMovieObserver, |
|
46 public MVedMovieProcessingObserver, |
|
47 public MProgressDialogCallback, |
|
48 public MExtProgressDialogCallback |
|
49 { |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Default constructor. |
|
54 */ |
|
55 void ConstructL(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CVeiSimpleCutVideoView(); |
|
61 |
|
62 protected: |
|
63 |
|
64 /** |
|
65 * From CAknView, HandleForegroundEventL( TBool aForeground ) |
|
66 * |
|
67 * @param aForeground |
|
68 */ |
|
69 virtual void HandleForegroundEventL( TBool aForeground ); |
|
70 |
|
71 private: |
|
72 |
|
73 /** |
|
74 * From CAknView, DynInitMenuPaneL. |
|
75 * |
|
76 * @param aResourceId resource id |
|
77 * @param aMenuPane menu pane |
|
78 */ |
|
79 void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); |
|
80 |
|
81 /** |
|
82 * From MVedMovieProcessingObserver |
|
83 */ |
|
84 virtual void NotifyMovieProcessingStartedL(CVedMovie& aMovie); |
|
85 virtual void NotifyMovieProcessingProgressed(CVedMovie& aMovie, TInt aPercentage); |
|
86 virtual void NotifyMovieProcessingCompleted(CVedMovie& aMovie, TInt aError); |
|
87 |
|
88 /** |
|
89 * From MVedMovieObserver |
|
90 */ |
|
91 virtual void NotifyVideoClipAdded( CVedMovie& aMovie, TInt aIndex ); |
|
92 virtual void NotifyVideoClipAddingFailed( CVedMovie& aMovie, TInt aError ); |
|
93 virtual void NotifyVideoClipRemoved( CVedMovie& aMovie, TInt aIndex ); |
|
94 virtual void NotifyVideoClipIndicesChanged( CVedMovie& aMovie, TInt aOldIndex, |
|
95 TInt aNewIndex ); |
|
96 virtual void NotifyVideoClipTimingsChanged( CVedMovie& aMovie, |
|
97 TInt aIndex ); |
|
98 virtual void NotifyVideoClipColorEffectChanged( CVedMovie& aMovie, |
|
99 TInt aIndex ); |
|
100 virtual void NotifyVideoClipAudioSettingsChanged( CVedMovie& aMovie, |
|
101 TInt aIndex ); |
|
102 virtual void NotifyStartTransitionEffectChanged( CVedMovie& aMovie ); |
|
103 virtual void NotifyMiddleTransitionEffectChanged( CVedMovie& aMovie, |
|
104 TInt aIndex ); |
|
105 virtual void NotifyEndTransitionEffectChanged( CVedMovie& aMovie ); |
|
106 virtual void NotifyAudioClipAdded( CVedMovie& aMovie, TInt aIndex ); |
|
107 virtual void NotifyAudioClipAddingFailed( CVedMovie& aMovie, TInt aError ); |
|
108 virtual void NotifyAudioClipRemoved( CVedMovie& aMovie, TInt aIndex ); |
|
109 virtual void NotifyAudioClipIndicesChanged( CVedMovie& aMovie, TInt aOldIndex, |
|
110 TInt aNewIndex ); |
|
111 virtual void NotifyAudioClipTimingsChanged( CVedMovie& aMovie, |
|
112 TInt aIndex ); |
|
113 virtual void NotifyMovieReseted( CVedMovie& aMovie ); |
|
114 |
|
115 virtual void NotifyVideoClipGeneratorSettingsChanged(CVedMovie& aMovie, |
|
116 TInt aIndex); |
|
117 |
|
118 virtual void NotifyVideoClipDescriptiveNameChanged(CVedMovie& aMovie, TInt aIndex); |
|
119 virtual void NotifyMovieQualityChanged(CVedMovie& aMovie); |
|
120 |
|
121 virtual void NotifyMovieOutputParametersChanged(CVedMovie& aMovie); |
|
122 virtual void NotifyAudioClipDynamicLevelMarkInserted(CVedMovie& aMovie, |
|
123 TInt aClipIndex, |
|
124 TInt aMarkIndex); |
|
125 virtual void NotifyAudioClipDynamicLevelMarkRemoved(CVedMovie& aMovie, |
|
126 TInt aClipIndex, |
|
127 TInt aMarkIndex); |
|
128 virtual void NotifyVideoClipDynamicLevelMarkInserted(CVedMovie& aMovie, |
|
129 TInt aClipIndex, |
|
130 TInt aMarkIndex); |
|
131 virtual void NotifyVideoClipDynamicLevelMarkRemoved(CVedMovie& aMovie, |
|
132 TInt aClipIndex, |
|
133 TInt aMarkIndex); |
|
134 |
|
135 /** |
|
136 * From MProgressDialogCallback |
|
137 */ |
|
138 void DialogDismissedL(TInt aButtonId); |
|
139 |
|
140 |
|
141 public: |
|
142 /** |
|
143 * |
|
144 * |
|
145 * @return VeiSimpleCutVideoView Uid |
|
146 */ |
|
147 TUid Id() const; |
|
148 |
|
149 /** |
|
150 * Starts temporary clip processing. |
|
151 */ |
|
152 void GenerateEffectedClipL(); |
|
153 |
|
154 /** |
|
155 * From CAknView, HandleCommandL(TInt aCommand); |
|
156 * |
|
157 * @param aCommand |
|
158 */ |
|
159 void HandleCommandL(TInt aCommand); |
|
160 |
|
161 /** |
|
162 * Draws the time label navi. |
|
163 */ |
|
164 void DrawTimeNaviL(); |
|
165 |
|
166 /** |
|
167 * Clears the in and/or out points. |
|
168 * |
|
169 * @param aClearIn whether to clear the in point |
|
170 * @param aClearOut whether to clear the out point |
|
171 */ |
|
172 void ClearInOutL( TBool aClearIn, TBool aClearOut ); |
|
173 |
|
174 /** |
|
175 * Sets the movie and index |
|
176 * |
|
177 * @param aVideoClip movie name |
|
178 * @param aIndex index of the video clip in movie |
|
179 */ |
|
180 void SetVideoClipAndIndex(CVedMovie& aVideoClip, TInt aIndex); |
|
181 |
|
182 /** |
|
183 * Returns the cut out time. |
|
184 * |
|
185 * @return cut out time |
|
186 */ |
|
187 TUint OutPointTime(); |
|
188 |
|
189 /** |
|
190 * Returns the cut in time. |
|
191 * |
|
192 * @return cut in time |
|
193 */ |
|
194 TUint InPointTime(); |
|
195 |
|
196 /** |
|
197 * Changes the CBA (command button array) according to the edit |
|
198 * state. |
|
199 * |
|
200 * @param aState current state |
|
201 */ |
|
202 void UpdateCBAL( TInt aState ); |
|
203 |
|
204 /** |
|
205 * Updates the time label navi. This method is called by the |
|
206 * static callback function. |
|
207 */ |
|
208 void UpdateTimeL(); |
|
209 |
|
210 /** |
|
211 * Starts the navi pane update, that is, the periodic timer. |
|
212 */ |
|
213 void StartNaviPaneUpdateL(); |
|
214 |
|
215 /** |
|
216 * Stops the navi pane update. |
|
217 */ |
|
218 void StopNaviPaneUpdateL(); |
|
219 |
|
220 /** |
|
221 * |
|
222 */ |
|
223 void ShowVolumeLabelL( TInt aVolume ); |
|
224 |
|
225 /** |
|
226 * Mutes the volume. |
|
227 */ |
|
228 void VolumeMuteL(); |
|
229 |
|
230 /** Possible mark states */ |
|
231 enum TMarkState |
|
232 { |
|
233 EMarkStateIn, |
|
234 EMarkStateOut, |
|
235 EMarkStateInOut |
|
236 }; |
|
237 |
|
238 void HandleStatusPaneSizeChange(); |
|
239 |
|
240 TInt AddClipL( const TDesC& aFilename, TBool aStartNow ); |
|
241 |
|
242 /** |
|
243 * No description. |
|
244 * |
|
245 * |
|
246 * @return No description. |
|
247 */ |
|
248 TBool IsEnoughFreeSpaceToSaveL();// const; |
|
249 TTimeIntervalMicroSeconds GetVideoClipCutInTime(); |
|
250 TTimeIntervalMicroSeconds GetVideoClipCutOutTime(); |
|
251 |
|
252 /** |
|
253 * Handles a change to the control's resources. |
|
254 */ |
|
255 void HandleResourceChange( TInt aType ); |
|
256 |
|
257 /** |
|
258 * Get pointer to the movie instance. |
|
259 * |
|
260 * @return CVedMovie* |
|
261 */ |
|
262 const CVedMovie* Movie() const; |
|
263 |
|
264 inline TBool AppIsOnTheWayToDestruction() { return iOnTheWayToDestruction; }; |
|
265 |
|
266 void PrepareForTermination(); |
|
267 |
|
268 inline TVeiSettings Settings() { return iMovieSaveSettings; }; |
|
269 |
|
270 /** |
|
271 * Moves the start or end mark when user drags them. |
|
272 * |
|
273 * @param aPosition position where the mark is moved to |
|
274 * @param aMarkType EStartMark or EEndMark |
|
275 * @return - |
|
276 */ |
|
277 void MoveStartOrEndMarkL(TTimeIntervalMicroSeconds aPosition, CVeiSimpleCutVideoContainer::TCutMark aMarkType); |
|
278 |
|
279 private: |
|
280 /** |
|
281 * Starts playing the clip. If the clip is paused, resumes |
|
282 * playing. |
|
283 */ |
|
284 void PlayPreviewL(); |
|
285 |
|
286 /** |
|
287 * Pauses the playback. |
|
288 */ |
|
289 void PausePreviewL(); |
|
290 |
|
291 /** |
|
292 * Plays the marked section of the clip. |
|
293 */ |
|
294 void PlayMarkedL(); |
|
295 |
|
296 /** |
|
297 * Marks the in point to the current point. |
|
298 */ |
|
299 void MarkInL(); |
|
300 |
|
301 /** |
|
302 * Marks the out point to the current point. |
|
303 */ |
|
304 void MarkOutL(); |
|
305 |
|
306 /** |
|
307 * Static callback function for the periodical timer that updates |
|
308 * the time navi. |
|
309 * |
|
310 * @param aPtr self pointer |
|
311 * |
|
312 * @return dummy value |
|
313 */ |
|
314 static TInt UpdateTimeCallbackL( TAny* aPtr ); |
|
315 |
|
316 TBool SaveL(); |
|
317 void StartTempFileProcessingL(); |
|
318 |
|
319 /** |
|
320 * Shows error note with given message. |
|
321 * |
|
322 * @param aResourceId No description. |
|
323 * @param aError No description. |
|
324 */ |
|
325 void ShowErrorNoteL( const TInt aResourceId, TInt aError = 0 ) const; |
|
326 |
|
327 |
|
328 void StartProgressNoteL(); |
|
329 void StartAnimatedProgressNoteL(); |
|
330 |
|
331 /** |
|
332 * Checks the memory card availability, if MMC is selected as save |
|
333 * store in application settings. An information note is shown in |
|
334 * following situations: |
|
335 * - MMC not inserted |
|
336 * - MMC corrupted (unformatted) |
|
337 * [- MMC is read-only (not implemented)] |
|
338 * |
|
339 * If note is popped up, this function waits until it's dismissed. |
|
340 */ |
|
341 void CheckMemoryCardAvailabilityL(); |
|
342 |
|
343 private: |
|
344 |
|
345 void CloseWaitDialog(); |
|
346 |
|
347 /** |
|
348 * From AknView, DoActivateL. |
|
349 * |
|
350 * @param aPrevViewId previous view id |
|
351 * @param aCustomMessageId custom message id |
|
352 * @param aCustomMessage custom message |
|
353 */ |
|
354 void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, |
|
355 const TDesC8& aCustomMessage); |
|
356 |
|
357 /** |
|
358 * From AknView, DoDeactivate |
|
359 */ |
|
360 void DoDeactivate(); |
|
361 |
|
362 /** Callback function */ |
|
363 static TInt AsyncExit(TAny* aThis); |
|
364 |
|
365 |
|
366 /** |
|
367 * Sets the current file name as title pane text |
|
368 * |
|
369 * @param - |
|
370 * @param . |
|
371 */ |
|
372 void SetTitlePaneTextL (); |
|
373 |
|
374 /** QueryAndSaveL |
|
375 * |
|
376 * Displays Avkon file handling queries and calls |
|
377 * SaveL() |
|
378 * |
|
379 * @param - |
|
380 * @return TInt 1 if the image has been saved, otherwise 0 |
|
381 */ |
|
382 TInt QueryAndSaveL(); |
|
383 |
|
384 TBool IsCutMarkSet(); |
|
385 |
|
386 private: // Data |
|
387 /* cut video container */ |
|
388 CVeiSimpleCutVideoContainer* iContainer; |
|
389 |
|
390 /* index of the video clip in the movie */ |
|
391 TUint iIndex; |
|
392 |
|
393 /* movie */ |
|
394 CVedMovie* iMovie; |
|
395 |
|
396 /** Time updater. */ |
|
397 CPeriodic* iTimeUpdater; |
|
398 |
|
399 /** Progress note. */ |
|
400 CAknProgressDialog* iProgressNote; |
|
401 |
|
402 /** Popup menu state flag */ |
|
403 TBool iPopupMenuOpened; |
|
404 |
|
405 /** Audio muted flag */ |
|
406 TBool iAudioMuted; |
|
407 |
|
408 /** current mark state */ |
|
409 TMarkState iMarkState; |
|
410 |
|
411 /** Error number */ |
|
412 TInt iErrorNmb; |
|
413 |
|
414 /** Error UI */ |
|
415 CVeiErrorUI* iErrorUI; |
|
416 |
|
417 CAknMemorySelectionDialog::TMemory iMemoryInUse; |
|
418 |
|
419 TVeiSettings iMovieSaveSettings; |
|
420 |
|
421 /** |
|
422 * Temporary file name for storing preview clip. |
|
423 */ |
|
424 HBufC* iTempFile; |
|
425 |
|
426 /** |
|
427 * No description. |
|
428 */ |
|
429 HBufC* iSaveToFileName; |
|
430 |
|
431 /** |
|
432 * No description. |
|
433 */ |
|
434 CVeiTempMaker* iTempMaker; |
|
435 |
|
436 |
|
437 CAknWaitDialog* iWaitDialog; |
|
438 |
|
439 /** |
|
440 * Progress dialog. |
|
441 */ |
|
442 CExtProgressDialog* iAnimatedProgressDialog; |
|
443 |
|
444 TBool iSaving; |
|
445 |
|
446 TBool iClosing; |
|
447 |
|
448 TInt iProcessed; |
|
449 |
|
450 /** Callback utility */ |
|
451 CAsyncCallBack* iCallBack; |
|
452 |
|
453 TBool iOnTheWayToDestruction; |
|
454 TBool iSelectionKeyPopup; |
|
455 |
|
456 /** Indicates if the image will be overwritten or not */ |
|
457 TBool iOverWriteFile; |
|
458 |
|
459 /** Indicates if the video has been paused */ |
|
460 TBool iPaused; |
|
461 |
|
462 /** ETrue if the user selects "Save" from menu */ |
|
463 TBool iSaveOnly; |
|
464 |
|
465 /// Own: NaviPaneControl |
|
466 CVeiNaviPaneControl* iCVeiNaviPaneControl; |
|
467 |
|
468 }; |
|
469 |
|
470 #endif |
|
471 |
|
472 // End of File |
|