msg_plat/messaging_media_resolver_api/inc/MsgAudioInfo.h
changeset 0 72b543305e3a
child 5 4697dfb2d7ad
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005 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:  
       
    15 *           Messaging Audio info class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __MSGAUDIOINFO_H
       
    22 #define __MSGAUDIOINFO_H
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <e32std.h>
       
    27 
       
    28 #include <mdaaudiosampleplayer.h> // MMdaAudioPlayerCallback & CMdaAudioPlayerUtility
       
    29 #include <msgmediainfo.h>
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // FORWARD DECLARATIONS
       
    36 
       
    37 class RFile;
       
    38 class TDataType;
       
    39 
       
    40 // DATA TYPES
       
    41 
       
    42 // FUNCTION PROTOTYPES
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 * Messaging Audio Info class.
       
    48 *
       
    49 * @lib MsgMedia.lib
       
    50 * @since 3.1
       
    51 */
       
    52 NONSHARABLE_CLASS( CMsgAudioInfo ) : public CMsgMediaInfo,
       
    53                                      public MMdaAudioPlayerCallback
       
    54     {
       
    55 
       
    56     public:  // New methods
       
    57 
       
    58         /**
       
    59         * Factory method that creates this object.
       
    60         *
       
    61         * @param    aFile       IN File handle to create info class from.
       
    62         * @param    aMimeType   IN Mime type of the file.
       
    63         * @return   pointer to instance
       
    64         */
       
    65         IMPORT_C static CMsgAudioInfo* NewL(
       
    66             RFile& aFile, 
       
    67             TDataType& aMimeType );
       
    68 
       
    69         /**
       
    70         * Destructor
       
    71         */
       
    72         virtual ~CMsgAudioInfo();
       
    73 
       
    74     protected:
       
    75 
       
    76         /**
       
    77         * Constructor.
       
    78         *
       
    79         * @param    aMimeType   IN Mime type of the file.
       
    80         */
       
    81         CMsgAudioInfo( TDataType& aMimeType );
       
    82 
       
    83         /**
       
    84         * 2nd phase constructor.
       
    85         *
       
    86         * @param    aFile       IN File handle to create info class from.
       
    87         */
       
    88         void ConstructL( RFile& aFile );
       
    89 
       
    90         /**
       
    91         * Opens the audio file and gets info (e.g. duration).
       
    92         * Called from ConstructL.
       
    93         *
       
    94         * @param    aFile       IN File handle to create info class from.
       
    95         */
       
    96         void ResolveAudioInfoL( RFile& aFile );
       
    97 
       
    98     protected: // From base classes
       
    99 
       
   100         /**
       
   101         * From CActive
       
   102         */
       
   103     	void DoCancel();
       
   104         
       
   105         /**
       
   106         * From CActive
       
   107         */
       
   108     	void RunL();
       
   109 
       
   110         /**
       
   111         * From MMdaAudioPlayerCallback
       
   112         */
       
   113         virtual void MapcInitComplete(
       
   114             TInt aError, 
       
   115             const TTimeIntervalMicroSeconds& aDuration );
       
   116 
       
   117         /**
       
   118         * From MMdaAudioPlayerCallback
       
   119         */
       
   120         virtual void MapcPlayComplete( TInt aError );
       
   121 
       
   122 
       
   123     protected: // data
       
   124 
       
   125         CMdaAudioPlayerUtility* iAudioUtil;
       
   126         enum TMsgAudioState
       
   127             {
       
   128             EAudioStateIdle = 0,
       
   129             EAudioStateReady
       
   130             };
       
   131         TInt iState;
       
   132     };
       
   133 
       
   134 #endif // __MSGAUDIOINFO_H