videditor/ManualVideoEditor/inc/VeiCutAudioView.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 VEICUTAUDIOVIEW_H
       
    21 #define VEICUTAUDIOVIEW_H
       
    22 
       
    23 
       
    24 #include <aknview.h>
       
    25 #include <VedMovie.h>
       
    26 #include <VedCommon.h>
       
    27 #include <utility.h>
       
    28 
       
    29 #include "VeiCutAudioContainer.h" 
       
    30 
       
    31 
       
    32 class CVeiCutAudioContainer;
       
    33 class CAknTitlePane;
       
    34 class CAknNavigationDecorator;
       
    35 class CAknNavigationControlContainer;
       
    36 class CPeriodic;
       
    37 class CMdaAudioRecorderUtility;
       
    38 class CMdaAudioType;
       
    39 class TMdaClipLocation;
       
    40 class CVeiErrorUI;
       
    41 
       
    42 /**
       
    43  *  CVeiCutAudioView view class.
       
    44  * 
       
    45  */
       
    46 class CVeiCutAudioView: public CAknView
       
    47 {
       
    48 public:
       
    49     // Constructors and destructor
       
    50 
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      */
       
    54     static CVeiCutAudioView* NewL();
       
    55 
       
    56     /**
       
    57      * Two-phased constructor.
       
    58      */
       
    59     static CVeiCutAudioView* NewLC();
       
    60 
       
    61     /**
       
    62      * Destructor.
       
    63      */
       
    64     virtual ~CVeiCutAudioView();
       
    65 
       
    66 protected:
       
    67 
       
    68     /** 
       
    69      * From CAknView, HandleForegroundEventL( TBool aForeground )
       
    70      *
       
    71      * @param aForeground
       
    72      */
       
    73     virtual void HandleForegroundEventL( TBool aForeground );
       
    74 
       
    75 private:
       
    76     // From CAknView
       
    77 
       
    78     /**
       
    79      * From CAknView, DynInitMenuPaneL.
       
    80      *
       
    81      * @param aResourceId  resource id
       
    82      * @param aMenuPane  menu pane
       
    83      */
       
    84     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
    85 
       
    86 public:
       
    87     /**
       
    88      * From CAknView, Id.
       
    89      *
       
    90      * @return view id.
       
    91      */
       
    92     TUid Id()const;
       
    93 
       
    94 
       
    95     CVeiCutAudioView();
       
    96 
       
    97     /**
       
    98      * Default constructor.
       
    99      */
       
   100     void ConstructL();
       
   101 
       
   102     /**
       
   103      * From CAknView, HandleCommandL(TInt aCommand);
       
   104      *
       
   105      * @param aCommand
       
   106      */
       
   107     void HandleCommandL( TInt aCommand );
       
   108 
       
   109     /**
       
   110      * Draws the time label navi.
       
   111      */
       
   112     void DrawTimeNaviL();
       
   113 
       
   114     /**
       
   115      * Clears the in and/or out points.
       
   116      *
       
   117      * @param aClearIn  whether to clear the in point
       
   118      * @param aClearOut  whether to clear the out point
       
   119      */
       
   120     void ClearInOutL( TBool aClearIn, TBool aClearOut );
       
   121 
       
   122     /**
       
   123      * Sets the movie and index
       
   124      *
       
   125      * @param aVideoClip	movie name
       
   126      * @param aIndex		index of the video clip in movie
       
   127      */
       
   128     void SetVideoClipAndIndex( CVedMovie& aVideoClip, TInt aIndex );
       
   129 
       
   130     /**
       
   131      * Sets the volume
       
   132      *
       
   133      * @param aVolume	Volume level.
       
   134      */
       
   135     void SetVolume( TInt aVolume );
       
   136 
       
   137     /**
       
   138      * Returns the cut out time.
       
   139      *
       
   140      * @return cut out time
       
   141      */
       
   142     TUint OutPointTime();
       
   143 
       
   144     /**
       
   145      * Returns the  cut in time.
       
   146      *
       
   147      * @return  cut in time
       
   148      */
       
   149     TUint InPointTime();
       
   150 
       
   151     /**
       
   152      * Changes the CBA (command button array) according to the edit
       
   153      * state.
       
   154      *
       
   155      * @param aState  current state
       
   156      */
       
   157     void UpdateCBAL( TInt aState );
       
   158 
       
   159     /**
       
   160      * Updates the time label navi. This method is called by the
       
   161      * static callback function.
       
   162      */
       
   163     void UpdateTimeL();
       
   164 
       
   165     /**
       
   166      * Starts the navi pane update, that is, the periodic timer.	
       
   167      */
       
   168     void StartNaviPaneUpdateL();
       
   169 
       
   170     /**
       
   171      * Stops the navi pane update.
       
   172      */
       
   173     void StopNaviPaneUpdateL();
       
   174 
       
   175     /**
       
   176      * Adjusts the volume up.
       
   177      */
       
   178     void VolumeUpL();
       
   179 
       
   180     /**
       
   181      * Adjusts the volume down.
       
   182      */
       
   183     void VolumeDownL();
       
   184 
       
   185     /**
       
   186      * Mutes the volume.
       
   187      */
       
   188     void VolumeMuteL();
       
   189 
       
   190     /**
       
   191      * Static callback function for hiding the volume indicator.
       
   192      *
       
   193      * @param aPtr  self pointer
       
   194      *
       
   195      * @return dummy value
       
   196      */
       
   197     static TInt HideVolumeCallbackL( TAny* aPtr );
       
   198 
       
   199     /**
       
   200      * Hides the volume indicator.
       
   201      */
       
   202     void HideVolume();
       
   203 
       
   204     /**
       
   205      * Gets visualization values.
       
   206      */
       
   207     void GetAudioVisualizationL();
       
   208 
       
   209     /**
       
   210      * Cancels visualization process.
       
   211      */
       
   212     void CancelVisualizationL();
       
   213 
       
   214     /** Possible mark states */
       
   215     enum TMarkState
       
   216     {
       
   217         EMarkStateIn,
       
   218         EMarkStateOut,
       
   219         EMarkStateInOut
       
   220     };
       
   221     
       
   222     /**
       
   223      *  
       
   224      */
       
   225     void HandleStatusPaneSizeChange();
       
   226 
       
   227     /** Callback function */
       
   228     static TInt AsyncOpenAudioFile( TAny* aThis );
       
   229 
       
   230     /** 
       
   231      * Handles a change to the control's resources.
       
   232      */
       
   233     void HandleResourceChange( TInt aType );
       
   234 
       
   235     /**
       
   236     * Moves the start or end mark when user drags them.
       
   237     * 
       
   238     * @param aPosition	position where the mark is moved to
       
   239     * @param aMarkType  EStartMark or EEndMark
       
   240     * @return -
       
   241     */               
       
   242     void MoveStartOrEndMarkL( TTimeIntervalMicroSeconds aPosition, CVeiCutAudioContainer::TCutMark aMarkType );
       
   243 		
       
   244 private:
       
   245     /**
       
   246      * Starts playing the clip. If the clip is paused, resumes 
       
   247      * playing.
       
   248      */
       
   249     void PlayPreviewL();
       
   250 
       
   251     /**
       
   252      * Pauses the playback.
       
   253      */
       
   254     void PausePreviewL();
       
   255 
       
   256     /**
       
   257      * Plays the marked section of the clip.
       
   258      */
       
   259     void PlayMarkedL();
       
   260 
       
   261     /**
       
   262      * Marks the in point to the current point.
       
   263      */
       
   264     void MarkInL();
       
   265 
       
   266     /**
       
   267      * Marks the out point to the current point.
       
   268      */
       
   269     void MarkOutL();
       
   270 
       
   271     /**
       
   272      * Creates the time label navi. 
       
   273      *
       
   274      * @return  time label navi 
       
   275      */
       
   276     CAknNavigationDecorator* CreateTimeLabelNaviL();
       
   277 
       
   278     /**
       
   279      * Static callback function for the periodical timer that updates
       
   280      * the time navi.
       
   281      *
       
   282      * @param aPtr  self pointer
       
   283      *
       
   284      * @return dummy value
       
   285      */
       
   286     static TInt UpdateTimeCallbackL( TAny* aPtr );
       
   287 
       
   288     /**
       
   289      * start processing the input file
       
   290      */
       
   291     void OpenAudioFileL();
       
   292 
       
   293 private:
       
   294 
       
   295     /**
       
   296      * From AknView, DoActivateL.
       
   297      * 
       
   298      * @param aPrevViewId  previous view id
       
   299      * @param aCustomMessageId  custom message id
       
   300      * @param aCustomMessage  custom message
       
   301      */
       
   302     void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId,
       
   303                      const TDesC8& aCustomMessage );
       
   304 
       
   305     /**
       
   306      * From AknView, DoDeactivate
       
   307      */
       
   308     void DoDeactivate();
       
   309 
       
   310 private:
       
   311     // Data
       
   312     /* cut video container	*/
       
   313     CVeiCutAudioContainer* iContainer;
       
   314 
       
   315     /* index of the video clip in the movie	*/
       
   316     TUint iIndex;
       
   317 
       
   318     /* movie */
       
   319     CVedMovie* iMovie;
       
   320 
       
   321     /** Time updater. */
       
   322     CPeriodic* iTimeUpdater;
       
   323 
       
   324     /** Pointer to the navi pane. */
       
   325     CAknNavigationControlContainer* iNaviPane;
       
   326 
       
   327     /** Time navi. */
       
   328     CAknNavigationDecorator* iTimeNavi;
       
   329 
       
   330     /** Volume hiding timer. */
       
   331     CPeriodic* iVolumeHider;
       
   332 
       
   333     /** Volume navi decorator. */
       
   334     CAknNavigationDecorator* iVolumeNavi;
       
   335 
       
   336     /** Popup menu state flag */
       
   337     TBool iPopupMenuOpened;
       
   338 
       
   339     /** Audio muted flag */
       
   340     TBool iAudioMuted;
       
   341 
       
   342     /** play marked flag */
       
   343     TBool iPlayMarked;
       
   344 
       
   345     /** current mark state */
       
   346     TMarkState iMarkState;
       
   347 
       
   348     /** Error number */
       
   349     TInt iErrorNmb;
       
   350 
       
   351     TTimeIntervalMicroSeconds iOriginalCutInTime;
       
   352     /** Error UI */
       
   353     CVeiErrorUI* iErrorUI;
       
   354 
       
   355     /** Callback utility */
       
   356     CAsyncCallBack* iCallBack;
       
   357 };
       
   358 
       
   359 #endif 
       
   360 
       
   361 // End of File