videditor/ManualVideoEditor/inc/VeiCutVideoView.h
changeset 9 d87d32eab1a9
parent 0 951a5db380a0
equal deleted inserted replaced
0:951a5db380a0 9:d87d32eab1a9
     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 VEICUTVIDEOVIEW_H
       
    21 #define VEICUTVIDEOVIEW_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 
       
    31 #include "VeiCutVideoContainer.h" 
       
    32 
       
    33 
       
    34 class CVeiCutVideoContainer;
       
    35 class CAknTitlePane;
       
    36 class CAknNavigationDecorator;
       
    37 class CAknNavigationControlContainer;
       
    38 class CPeriodic;
       
    39 class CVeiErrorUI;
       
    40 class CAknMemorySelectionDialog;
       
    41 
       
    42 /**
       
    43  *  CVeiCutVideoView view class.
       
    44  * 
       
    45  */
       
    46 class CVeiCutVideoView: public CAknView, 
       
    47                         public MVedMovieObserver,
       
    48                         public MVedMovieProcessingObserver, 
       
    49                         public MProgressDialogCallback 
       
    50 {
       
    51 public:
       
    52 
       
    53     /**
       
    54      * Default constructor.
       
    55      */
       
    56     void ConstructL();
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     virtual ~CVeiCutVideoView();
       
    62 
       
    63 protected:
       
    64 
       
    65     /** 
       
    66      * From CAknView, HandleForegroundEventL( TBool aForeground )
       
    67      *
       
    68      * @param aForeground
       
    69      */
       
    70     virtual void HandleForegroundEventL( TBool aForeground );
       
    71 
       
    72 private:
       
    73 
       
    74     /**
       
    75      * From CAknView, DynInitMenuPaneL.
       
    76      *
       
    77      * @param aResourceId  resource id
       
    78      * @param aMenuPane  menu pane
       
    79      */
       
    80     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    81 
       
    82     /** 
       
    83      * From MVedMovieProcessingObserver
       
    84      */
       
    85     virtual void NotifyMovieProcessingStartedL( CVedMovie& aMovie );
       
    86     virtual void NotifyMovieProcessingProgressed( CVedMovie& aMovie, 
       
    87                                                   TInt aPercentage );
       
    88     virtual void NotifyMovieProcessingCompleted( CVedMovie& aMovie, 
       
    89                                                  TInt aError );
       
    90 
       
    91     /**
       
    92      * From MVedMovieObserver
       
    93      */
       
    94     virtual void NotifyVideoClipAdded( CVedMovie& aMovie, TInt aIndex );
       
    95     
       
    96     virtual void NotifyVideoClipAddingFailed( CVedMovie& aMovie, TInt aError );
       
    97     
       
    98     virtual void NotifyVideoClipRemoved( CVedMovie& aMovie, TInt aIndex );
       
    99     
       
   100     virtual void NotifyVideoClipIndicesChanged( CVedMovie& aMovie, 
       
   101                                                 TInt aOldIndex, 
       
   102                                                 TInt aNewIndex );
       
   103                                                 
       
   104     virtual void NotifyVideoClipTimingsChanged( CVedMovie& aMovie,
       
   105                                                 TInt aIndex );
       
   106                                                 
       
   107     virtual void NotifyVideoClipColorEffectChanged( CVedMovie& aMovie,
       
   108                                                     TInt aIndex );
       
   109                                                     
       
   110     virtual void NotifyVideoClipAudioSettingsChanged( CVedMovie& aMovie,
       
   111                                                       TInt aIndex );
       
   112                                                       
       
   113     virtual void NotifyStartTransitionEffectChanged( CVedMovie& aMovie );      
       
   114     
       
   115     virtual void NotifyMiddleTransitionEffectChanged( CVedMovie& aMovie, 
       
   116                                                       TInt aIndex );
       
   117                                                       
       
   118     virtual void NotifyEndTransitionEffectChanged( CVedMovie& aMovie );
       
   119     
       
   120     virtual void NotifyAudioClipAdded( CVedMovie& aMovie, TInt aIndex );
       
   121     
       
   122     virtual void NotifyAudioClipAddingFailed( CVedMovie& aMovie, TInt aError );
       
   123     
       
   124     virtual void NotifyAudioClipRemoved( CVedMovie& aMovie, TInt aIndex );
       
   125     
       
   126     virtual void NotifyAudioClipIndicesChanged( CVedMovie& aMovie, 
       
   127                                                 TInt aOldIndex, 
       
   128                                                 TInt aNewIndex );
       
   129                                                 
       
   130     virtual void NotifyAudioClipTimingsChanged( CVedMovie& aMovie,
       
   131                                                 TInt aIndex );
       
   132                                                 
       
   133     virtual void NotifyMovieReseted( CVedMovie& aMovie );
       
   134 
       
   135     virtual void NotifyVideoClipGeneratorSettingsChanged( CVedMovie& aMovie,
       
   136                                                           TInt aIndex );
       
   137 
       
   138     virtual void NotifyVideoClipDescriptiveNameChanged( CVedMovie& aMovie, 
       
   139                                                         TInt aIndex );
       
   140                                                         
       
   141     virtual void NotifyMovieQualityChanged( CVedMovie& aMovie );				
       
   142 
       
   143     virtual void NotifyMovieOutputParametersChanged( CVedMovie& aMovie );
       
   144     
       
   145     virtual void NotifyAudioClipDynamicLevelMarkInserted( CVedMovie& aMovie, 
       
   146                                                           TInt aClipIndex, 
       
   147                                                           TInt aMarkIndex );
       
   148                                                      
       
   149     virtual void NotifyAudioClipDynamicLevelMarkRemoved( CVedMovie& aMovie, 
       
   150                                                          TInt aClipIndex,
       
   151                                                          TInt aMarkIndex );
       
   152                                                     
       
   153     virtual void NotifyVideoClipDynamicLevelMarkInserted( CVedMovie& aMovie, 
       
   154                                                           TInt aClipIndex,
       
   155                                                           TInt aMarkIndex );
       
   156                                                      
       
   157     virtual void NotifyVideoClipDynamicLevelMarkRemoved( CVedMovie& aMovie, 
       
   158                                                          TInt aClipIndex, 
       
   159                                                          TInt aMarkIndex);
       
   160 
       
   161     /**
       
   162      * From MProgressDialogCallback
       
   163      */
       
   164     void DialogDismissedL( TInt aButtonId );
       
   165 
       
   166 
       
   167 public:
       
   168     /**
       
   169      * 
       
   170      * 
       
   171      * @return VeiCutVideoView Uid
       
   172      */
       
   173     TUid Id()const;
       
   174 
       
   175     /**
       
   176      * Starts temporary clip processing.
       
   177      */
       
   178     void GenerateEffectedClipL();
       
   179 
       
   180     /**
       
   181      * From CAknView, HandleCommandL(TInt aCommand);
       
   182      *
       
   183      * @param aCommand
       
   184      */
       
   185     void HandleCommandL( TInt aCommand );
       
   186 
       
   187     /**
       
   188      * Draws the time label navi.
       
   189      */
       
   190     void DrawTimeNaviL();
       
   191 
       
   192     /**
       
   193      * Clears the in and/or out points.
       
   194      *
       
   195      * @param aClearIn  whether to clear the in point
       
   196      * @param aClearOut  whether to clear the out point
       
   197      */
       
   198     void ClearInOutL( TBool aClearIn, TBool aClearOut );
       
   199 
       
   200     /**
       
   201      * Sets the movie and index
       
   202      *
       
   203      * @param aVideoClip	movie name
       
   204      * @param aIndex		index of the video clip in movie
       
   205      */
       
   206     void SetVideoClipAndIndex( CVedMovie& aVideoClip, TInt aIndex );
       
   207 
       
   208     /**
       
   209      * Returns the cut out time.
       
   210      *
       
   211      * @return cut out time
       
   212      */
       
   213     TUint OutPointTime();
       
   214 
       
   215     /**
       
   216      * Returns the  cut in time.
       
   217      *
       
   218      * @return  cut in time
       
   219      */
       
   220     TUint InPointTime();
       
   221 
       
   222     /**
       
   223      * Changes the CBA (command button array) according to the edit
       
   224      * state.
       
   225      *
       
   226      * @param aState  current state
       
   227      */
       
   228     void UpdateCBAL( TInt aState );
       
   229 
       
   230     /**
       
   231      * Updates the time label navi. This method is called by the
       
   232      * static callback function.
       
   233      */
       
   234     void UpdateTimeL();
       
   235 
       
   236     /**
       
   237      * Starts the navi pane update, that is, the periodic timer.	
       
   238      */
       
   239     void StartNaviPaneUpdateL();
       
   240 
       
   241     /**
       
   242      * Stops the navi pane update.
       
   243      */
       
   244     void StopNaviPaneUpdateL();
       
   245 
       
   246     /**
       
   247      * 
       
   248      */
       
   249     void ShowVolumeLabelL( TInt aVolume );
       
   250 
       
   251     /**
       
   252      * Mutes the volume.
       
   253      */
       
   254     void VolumeMuteL();
       
   255 
       
   256     /**
       
   257      * Static callback function for hiding the volume indicator.
       
   258      *
       
   259      * @param aPtr  self pointer
       
   260      *
       
   261      * @return dummy value
       
   262      */
       
   263     static TInt HideVolumeCallbackL( TAny* aPtr );
       
   264 
       
   265     /**
       
   266      * Hides the volume indicator.
       
   267      */
       
   268     void HideVolume();
       
   269 
       
   270     /** Possible mark states */
       
   271     enum TMarkState
       
   272     {
       
   273         EMarkStateIn,
       
   274         EMarkStateOut,
       
   275         EMarkStateInOut
       
   276     };
       
   277 
       
   278     void HandleStatusPaneSizeChange();
       
   279 
       
   280     /**
       
   281      * No description.
       
   282      *
       
   283      * 
       
   284      * @return No description.
       
   285      */
       
   286     TBool IsEnoughFreeSpaceToSaveL(); // const;
       
   287     TTimeIntervalMicroSeconds GetVideoClipCutInTime();
       
   288     TTimeIntervalMicroSeconds GetVideoClipCutOutTime();
       
   289 
       
   290     /** 
       
   291      * Handles a change to the control's resources.
       
   292      */
       
   293     void HandleResourceChange( TInt aType );
       
   294     
       
   295 
       
   296     /**
       
   297     * Moves the start or end mark when user drags them.
       
   298     * 
       
   299     * @param aPosition	position where the mark is moved to
       
   300     * @param aMarkType  EStartMark or EEndMark
       
   301     * @return -
       
   302     */               
       
   303     void MoveStartOrEndMarkL( TTimeIntervalMicroSeconds aPosition, CVeiCutVideoContainer::TCutMark aMarkType );
       
   304 		
       
   305     
       
   306 
       
   307 private:
       
   308     /**
       
   309      * Starts playing the clip. If the clip is paused, resumes 
       
   310      * playing.
       
   311      */
       
   312     void PlayPreviewL();
       
   313 
       
   314     /**
       
   315      * Pauses the playback.
       
   316      */
       
   317     void PausePreviewL();
       
   318 
       
   319     /**
       
   320      * Plays the marked section of the clip.
       
   321      */
       
   322     void PlayMarkedL();
       
   323 
       
   324     /**
       
   325      * Marks the in point to the current point.
       
   326      */
       
   327     void MarkInL();
       
   328 
       
   329     /**
       
   330      * Marks the out point to the current point.
       
   331      */
       
   332     void MarkOutL();
       
   333 
       
   334     /**
       
   335      * Creates the time label navi. 
       
   336      *
       
   337      * @return  time label navi 
       
   338      */
       
   339     CAknNavigationDecorator* CreateTimeLabelNaviL();
       
   340 
       
   341     /**
       
   342      * Static callback function for the periodical timer that updates
       
   343      * the time navi.
       
   344      *
       
   345      * @param aPtr  self pointer
       
   346      *
       
   347      * @return dummy value
       
   348      */
       
   349     static TInt UpdateTimeCallbackL( TAny* aPtr );
       
   350 
       
   351 private:
       
   352 
       
   353     /**
       
   354      * From AknView, DoActivateL.
       
   355      * 
       
   356      * @param aPrevViewId  previous view id
       
   357      * @param aCustomMessageId  custom message id
       
   358      * @param aCustomMessage  custom message
       
   359      */
       
   360     void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   361                      const TDesC8& aCustomMessage );
       
   362 
       
   363     /**
       
   364      * From AknView, DoDeactivate
       
   365      */
       
   366     void DoDeactivate();
       
   367 
       
   368 private:
       
   369     // Data
       
   370     /* cut video container	*/
       
   371     CVeiCutVideoContainer* iContainer;
       
   372 
       
   373     /* index of the video clip in the movie	*/
       
   374     TUint iIndex;
       
   375 
       
   376     /* name of the temp file. possibly effected*/
       
   377     HBufC* iProcessedTempFile;
       
   378 
       
   379     /* movie */
       
   380     CVedMovie* iMovie;
       
   381 
       
   382     /* temp movie. used to create effected clip */
       
   383     CVedMovie* iTempMovie;
       
   384 
       
   385     /** Time updater. */
       
   386     CPeriodic* iTimeUpdater;
       
   387 
       
   388     /** Pointer to the navi pane. */
       
   389     CAknNavigationControlContainer* iNaviPane;
       
   390 
       
   391     /** Time navi. */
       
   392     CAknNavigationDecorator* iTimeNavi;
       
   393 
       
   394     /** Progress note. */
       
   395     CAknProgressDialog* iProgressNote;
       
   396 
       
   397     /** Progress info for the progress note. */
       
   398     CEikProgressInfo* iProgressInfo;
       
   399 
       
   400     /** Volume hiding timer. */
       
   401     CPeriodic* iVolumeHider;
       
   402 
       
   403     /** Volume navi decorator. */
       
   404     CAknNavigationDecorator* iVolumeNavi;
       
   405 
       
   406     /** Popup menu state flag */
       
   407     TBool iPopupMenuOpened;
       
   408 
       
   409     /** Audio muted flag */
       
   410     TBool iAudioMuted;
       
   411 
       
   412     /** current mark state */
       
   413     TMarkState iMarkState;
       
   414 
       
   415     /** Error number */
       
   416     TInt iErrorNmb;
       
   417 
       
   418     /** Error UI */
       
   419     CVeiErrorUI* iErrorUI;
       
   420 
       
   421     CAknMemorySelectionDialog::TMemory iMemoryInUse;
       
   422 
       
   423     TVeiSettings iMovieSaveSettings;
       
   424 
       
   425 
       
   426 #include "veicutvideoview.inl"
       
   427 };
       
   428 
       
   429 #endif 
       
   430 
       
   431 // End of File