internetradio2.0/settingsinc/ircodecmanager.h
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Maintains the set of supported codecs 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_IRCODECMANAGER_H
       
    20 #define C_IRCODECMANAGER_H
       
    21 
       
    22 #include <sounddevice.h>
       
    23 
       
    24 /**
       
    25  *  Maintains the list of supported codecs in a terminal.
       
    26  * 
       
    27  *
       
    28  */
       
    29 NONSHARABLE_CLASS( CIRCodecManager ): public CBase, public MDevSoundObserver
       
    30     {
       
    31 public:
       
    32     /**
       
    33      * Two-phased constructor.
       
    34      * @return Instance of CIRCodecManager
       
    35      */
       
    36     static CIRCodecManager* NewL();
       
    37 
       
    38     /**
       
    39      * Two-phased constructor.
       
    40      * @return Instance of CIRCodecManager
       
    41      */
       
    42     static CIRCodecManager* NewLC();
       
    43     
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~CIRCodecManager();
       
    48 
       
    49     /**
       
    50      * Tells if the codec provided as argument is supported by the terminal 
       
    51      * and by Internet Radio.
       
    52      * 
       
    53      * @param aCodec The codec that's support is tested.
       
    54      * @return ETrue if the codec is supported, EFalse if not.
       
    55      */
       
    56     TBool IsSupportedCodec( TFourCC aCodec ) const;
       
    57     
       
    58 private:
       
    59     /**
       
    60      * C++ Default constructor.
       
    61      */
       
    62     CIRCodecManager();
       
    63 
       
    64     /**
       
    65      * Second phase constructor
       
    66      */
       
    67     void ConstructL();
       
    68 
       
    69 private: // From MDevSoundObserver
       
    70     /**
       
    71      * @see MDevSoundObserver::InitializeComplete
       
    72      */
       
    73     void InitializeComplete(TInt aError);
       
    74     
       
    75     /**
       
    76      * @see MDevSoundObserver::ToneFinished
       
    77      */
       
    78     void ToneFinished(TInt aError);
       
    79     
       
    80     /**
       
    81      * @see MDevSoundObserver::BufferToBeFilled
       
    82      */
       
    83     void BufferToBeFilled(CMMFBuffer* aBuffer);
       
    84 
       
    85     /**
       
    86      * @see MDevSoundObserver::PlayError
       
    87      */
       
    88     void PlayError(TInt aError);
       
    89 
       
    90     /**
       
    91      * @see MDevSoundObserver::BufferToBeEmptied
       
    92      */
       
    93     void BufferToBeEmptied(CMMFBuffer* aBuffer);
       
    94 
       
    95     /**
       
    96      * @see MDevSoundObserver::RecordError
       
    97      */
       
    98     void RecordError(TInt aError);
       
    99 
       
   100     /**
       
   101      * @see MDevSoundObserver::ConvertError
       
   102      */
       
   103     void ConvertError(TInt aError);
       
   104 
       
   105     /**
       
   106      * @see MDevSoundObserver::DeviceMessage
       
   107      */
       
   108     void DeviceMessage(TUid aMessageType, const TDesC8& aMsg);
       
   109 
       
   110 private:
       
   111     /**
       
   112      * Initialises the set of supported codecs.
       
   113      */
       
   114     void LoadSupportedCodecsL();
       
   115 
       
   116     /**
       
   117      * Checks that the codec is in the set of Internet Radio's supported codecs
       
   118      * and verifies that DevSound can be initialised with the codec.
       
   119      * 
       
   120      * @param aCodec The codec to be tested.
       
   121      * @return ETrue if the codec is really supported, EFalse otherwise.
       
   122      */
       
   123     TBool VerifySupportL( TFourCC aCodec );
       
   124 
       
   125 private: 
       
   126     /**
       
   127      * The set of codecs that are supported.
       
   128      * Owned.
       
   129      */
       
   130     RArray<TFourCC> iSupportedDataTypes;
       
   131     
       
   132     };
       
   133 #endif // C_IRCODECMANAGER_H