videoeditorengine/audioeditorengine/codecs/mp3/inc/ProcMP3FrameHandler.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 #ifndef __CPROCMP3FRAMEHANDLER_H__
       
    21 #define __CPROCMP3FRAMEHANDLER_H__
       
    22 
       
    23 /*-- System Headers. --*/
       
    24 #include <e32base.h>
       
    25 
       
    26 /*-- Project Headers. --*/
       
    27 #include "AudCommon.h"
       
    28 #include "ProcFrameHandler.h"
       
    29 #include "ProcInFileHandler.h"
       
    30 
       
    31 #include "MP3API.h"
       
    32 
       
    33 /**
       
    34  * Frame handler class for accessing MP3 data elements.
       
    35  *
       
    36  * @author  Juha Ojanperä
       
    37  */
       
    38 class CProcMP3FrameHandler : public CProcFrameHandler 
       
    39     {
       
    40 public:
       
    41 
       
    42     
       
    43     /*
       
    44     * Constructors & destructor
       
    45     */
       
    46     static CProcMP3FrameHandler* NewL();
       
    47     static CProcMP3FrameHandler* NewLC();
       
    48 
       
    49     ~CProcMP3FrameHandler();
       
    50 
       
    51 
       
    52     // From base class CProcFrameHandler ---------->
       
    53     TBool ManipulateGainL(const HBufC8* aFrameIn, HBufC8*& aFrameOut, TInt8 aGain);
       
    54     TBool GetGainL(const HBufC8* aFrame, RArray<TInt>& aGains, TInt& aMaxGain) const;
       
    55     TBool GetNormalizingMargin(const HBufC8* aFrame, TInt8& aMargin) const;
       
    56     TBool IsMixingAvailable() const;
       
    57     // <--------------------------------------------
       
    58     
       
    59     
       
    60 
       
    61 private:
       
    62 
       
    63     // ConstructL
       
    64     void ConstructL();
       
    65     
       
    66     // c++ constructor
       
    67     CProcMP3FrameHandler();
       
    68     
       
    69     // internal function for reading MP3 gains
       
    70     TBool GetMP3Gains(const HBufC8* aFrame, RArray<TInt>& aGains, TInt& aMaxGain, TBitStream& aBs) const;
       
    71 
       
    72 private:
       
    73 
       
    74     // a handle to MP3 editing class in MP3AACManipLib
       
    75     CMp3Edit* iMp3Edit;
       
    76     
       
    77     // a flag to indicate whether MP3 decoder is initialized
       
    78     mutable TBool decInitialized;
       
    79     
       
    80     // a handle to CMPAudDec
       
    81     CMPAudDec *iMpAud;
       
    82     TMpTransportHandle *iTHandle;
       
    83     
       
    84 
       
    85     friend class CProcMP3InFileHandler;
       
    86 
       
    87     };
       
    88 
       
    89 #endif /*-- __CPROCMP3FRAMEHANDLER_H__ --*/