videoeditorengine/audioeditorengine/inc/AudObservers.h
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     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 
       
    21 
       
    22 #ifndef __AUDOBSERVERS_H__
       
    23 #define __AUDOBSERVERS_H__
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 //#include "AudSong.h"
       
    28 //#include "AudClip.h"
       
    29 //#include "AudClipInfo.h"
       
    30 #include "AudCommon.h"
       
    31 
       
    32 class CAudSong;
       
    33 class CAudClip;
       
    34 class CAudClipInfo;
       
    35 
       
    36 /**
       
    37  * Observer for movie processing operations. 
       
    38  */
       
    39 class MAudSongProcessingObserver
       
    40     {
       
    41 public:
       
    42     /**
       
    43      * Called to notify that a new audio processing operation has been started. 
       
    44      *
       
    45      * @param aSong  song
       
    46      */
       
    47     virtual void NotifyAudioProcessingStartedL(CAudSong& aSong) = 0;
       
    48 
       
    49     /**
       
    50      * Called to inform about the current progress of the audio processing operation.
       
    51      *
       
    52      * @param aSong       song
       
    53      * @param aPercentage  percentage of the operation completed, must be 
       
    54        *                     in range 0..100
       
    55      */
       
    56     virtual void NotifyAudioProcessingProgressed(CAudSong& aSong, TInt aPercentage) = 0;
       
    57 
       
    58     /**
       
    59     * Called to notify that the song processing operation has been completed. 
       
    60     * 
       
    61     * @param aSong  song
       
    62     * @param aError  error code why the operation was completed. 
       
    63     *                <code>KErrNone</code> if the operation was completed 
       
    64     *                successfully.
       
    65     */
       
    66     virtual void NotifyAudioProcessingCompleted(CAudSong& aSong, TInt aError) = 0;
       
    67     
       
    68     };
       
    69 
       
    70 /**
       
    71 * Observer for audio visualization processes. 
       
    72 */
       
    73 class MAudVisualizationObserver
       
    74     {
       
    75 public:
       
    76         
       
    77     /**
       
    78     * Called to notify that audio _clip_ visualization process has been completed. 
       
    79     * The receiver is responsible for releasing the memory in 
       
    80     * <code>aVisualization</code> if <code>aError = KErrNone</code>
       
    81     * Note: if aError != KErrNone, aVisualization = NULL and aSize = 0;
       
    82     * 
       
    83     * @param aClipInfo        audio clip info
       
    84     * @param aError            <code>KErrNone</code> if visualization was
       
    85     *                        completed successfully; one of the system wide
       
    86     *                        error codes if generating visualization failed
       
    87     * @param aVisualization    pointer to TInt8 visualization array 
       
    88     * @param aSize                size of the visualization array
       
    89     */
       
    90     virtual void NotifyClipInfoVisualizationCompleted(const CAudClipInfo& aClipInfo, 
       
    91         TInt aError, 
       
    92         TInt8* aVisualization,
       
    93         TInt aSize) = 0;
       
    94     
       
    95 
       
    96     /**
       
    97     * Called to notify that audio _clip_ visualization process has been started. 
       
    98     * 
       
    99     * @param aClipInfo            clip info
       
   100     * @param aError                <code>KErrNone</code> if visualization was
       
   101     *                            started successfully; one of the system wide
       
   102     *                            error codes if generating visualization failed
       
   103     */
       
   104     virtual void NotifyClipInfoVisualizationStarted(const CAudClipInfo& aClipInfo, 
       
   105         TInt aError) = 0;
       
   106 
       
   107 
       
   108     /**
       
   109      * Called to inform about the current progress of the audio clip visualization.
       
   110      *
       
   111      * @param aClipInfo    clip info
       
   112      * @param aPercentage  percentage of the operation completed, must be 
       
   113        *                     in range 0..100
       
   114      */
       
   115     virtual void NotifyClipInfoVisualizationProgressed(const CAudClipInfo& aClipInfo, 
       
   116         TInt aPercentage) = 0;
       
   117 
       
   118 
       
   119     };
       
   120 
       
   121 
       
   122 /**
       
   123  * Observer for song events. 
       
   124  * <p>
       
   125  * Note that every change operation that is made to a song or the clips it consists of 
       
   126  * results in a maximum of one notification method called (that is, more than one 
       
   127  * notification method is never called as a result of a single change). For example,
       
   128  * changing the index of a clip results in the <code>NotifyClipIndicesChanged()</code>
       
   129  * method being called once. The <code>NotifyClipTimingsChanged()</code> method is not 
       
   130  * called even if the timings of several clips may have changed as a result. See the
       
   131  * descriptions of the notification methods for more detailed information.
       
   132  *
       
   133  * @see  CAudSong
       
   134  */
       
   135 class MAudSongObserver 
       
   136     {
       
   137 public:
       
   138 
       
   139     /**
       
   140      * Called to notify that a new audio clip has been successfully
       
   141      * added to the song. Note that the indices and the start and end times
       
   142      * of the audio clips after the new clip have also changed as a result.
       
   143      * Note that the transitions may also have changed. 
       
   144      *
       
   145      * @param aSong            song
       
   146      * @param aClip            new audio clip
       
   147      * @param aIndex        index of the new audio clip on a track
       
   148      * @param aTrackIndex    track index of the new clip
       
   149      *
       
   150      */
       
   151     virtual void NotifyClipAdded(CAudSong& aSong, CAudClip& aClip, TInt aIndex, TInt aTrackIndex) = 0;
       
   152 
       
   153     /**
       
   154      * Called to notify that adding a new audio clip to the song has failed.
       
   155      *
       
   156      * Possible error codes:
       
   157      *    - <code>KErrNotFound</code> if there is no file with the specified name
       
   158      *    in the specified directory (but the directory exists)
       
   159      *    - <code>KErrPathNotFound</code> if the specified directory
       
   160      *    does not exist
       
   161      *    - <code>KErrUnknown</code> if the specified file is of unknown format
       
   162      *    - <code>KErrNotSupported</code> if the format of the file is recognized but
       
   163      *    adding it to the song is not supported (e.g., it is of different codec
       
   164      *    or format than the other clips)
       
   165      *
       
   166      * @param aSong   song
       
   167      * @param aError  one of the system wide error codes
       
   168      */
       
   169     virtual void NotifyClipAddingFailed(CAudSong& aSong, TInt aError,  TInt aTrackIndex) = 0;
       
   170 
       
   171     /**
       
   172      * Called to notify that an audio clip has been removed from the song.
       
   173      * Note that the indices and the start and end times of the audio clips after 
       
   174      * the removed clip have also changed as a result. Note that the 
       
   175      * transitions may also have changed.
       
   176      *
       
   177      * @param aSong            song
       
   178      * @param aIndex        index of the removed clip (on a track)
       
   179      * @param aTrackIndex    track index
       
   180      */
       
   181     virtual void NotifyClipRemoved(CAudSong& aSong, TInt aIndex, TInt aTrackIndex) = 0;
       
   182     
       
   183     /**
       
   184      * Called to notify that the timings of the clip has changed.
       
   185      * Note that the start and end times of the audio clips 
       
   186      * after the changed clip have also changed.
       
   187      *
       
   188      * @param aSong  song
       
   189      * @param aClip  changed clip
       
   190      */
       
   191     virtual void NotifyClipTimingsChanged(CAudSong& aSong,
       
   192         CAudClip& aClip) = 0;
       
   193     
       
   194 
       
   195     /**
       
   196      * Called to notify that the index of the clip has changed.
       
   197      *
       
   198      * @param aSong            song
       
   199      * @param aOldIndex        old index on a track
       
   200      * @param aNewIndex        new index on a track
       
   201      * @param aTrackIndex    track index
       
   202      */
       
   203     virtual void NotifyClipIndicesChanged(CAudSong& aSong, TInt aOldIndex, 
       
   204         TInt aNewIndex, TInt aTrackIndex) = 0;
       
   205     
       
   206     /**
       
   207      * Called to notify that the song has been reseted.
       
   208      *
       
   209      * @param aSong  song
       
   210      */
       
   211     virtual void NotifySongReseted(CAudSong& aSong) = 0;
       
   212 
       
   213 
       
   214     /**
       
   215      * Called to notify that a clip has been reseted.
       
   216      *
       
   217      * @param aClip  clip
       
   218      */
       
   219     virtual void NotifyClipReseted(CAudClip& aClip) = 0;
       
   220 
       
   221     
       
   222     /**
       
   223      * Called to notify that a new dynamic level mark has been successfully
       
   224      * added to a _clip_.
       
   225      *
       
   226      * @param aClip  clip
       
   227      * @param aMark  new level mark
       
   228      * @param aIndex index of the new level mark
       
   229      */
       
   230     virtual void NotifyDynamicLevelMarkInserted(CAudClip& aClip, 
       
   231         TAudDynamicLevelMark& aMark, 
       
   232         TInt aIndex) = 0;
       
   233 
       
   234     
       
   235     /**
       
   236      * Called to notify that a dynamic level mark has been removed from a _clip_.
       
   237      * Note that indices of dynamic level marks has also changed as a result
       
   238      *
       
   239      * @param aClip   clip
       
   240      * @param aIndex  index of the removed mark
       
   241      */
       
   242     virtual void NotifyDynamicLevelMarkRemoved(CAudClip& aClip, TInt aIndex) = 0;
       
   243 
       
   244 
       
   245 
       
   246     };
       
   247 
       
   248 
       
   249 
       
   250 
       
   251 /**
       
   252  * Observer for notifying that audio clip info
       
   253  * is ready for reading.
       
   254  *
       
   255  * @see  CAudClipInfo
       
   256  */
       
   257 class MAudClipInfoObserver
       
   258     {
       
   259 public:
       
   260     /**
       
   261      * Called to notify that audio clip info is ready
       
   262      * for reading.
       
   263      *
       
   264      * Possible error codes:
       
   265      *    - <code>KErrNotFound</code> if there is no file with the specified name
       
   266      *    in the specified directory (but the directory exists)
       
   267      *    - <code>KErrPathNotFound</code> if the specified directory
       
   268      *    does not exist
       
   269      *    - <code>KErrUnknown</code> if the specified file is of unknown type
       
   270      *
       
   271      * @param aInfo   audio clip info
       
   272      * @param aError  <code>KErrNone</code> if info is ready
       
   273      *                for reading; one of the system wide
       
   274      *                error codes if reading file failed
       
   275      */
       
   276     virtual void NotifyClipInfoReady(CAudClipInfo& aInfo, 
       
   277                                           TInt aError) = 0;
       
   278     };
       
   279     
       
   280 class MAudTimeEstimateObserver
       
   281     {
       
   282 public:
       
   283     /**
       
   284      * Called to notify that time estimate is ready
       
   285      * for reading.
       
   286      *
       
   287      *
       
   288      * @param aTimeEstimate   time estimate in microseconds
       
   289      */
       
   290     
       
   291     virtual void NotifyTimeEstimateReady(TInt64 aTimeEstimate) = 0;
       
   292 
       
   293     };
       
   294 #endif