devsound/a3fdevsound/inc/a3ffourcclookup.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 //a3ffourcclookup.h
       
     2 
       
     3 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 // All rights reserved.
       
     5 // This component and the accompanying materials are made available
       
     6 // under the terms of "Eclipse Public License v1.0"
       
     7 // which accompanies this distribution, and is available
       
     8 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 //
       
    10 // Initial Contributors:
       
    11 // Nokia Corporation - initial contribution.
       
    12 //
       
    13 // Contributors:
       
    14 //
       
    15 // Description:
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology 
       
    21 */
       
    22 
       
    23  
       
    24 #ifndef A3FFOURCCLOOKUP_H
       
    25 #define A3FFOURCCLOOKUP_H
       
    26 
       
    27 //INCLUDES
       
    28 #include <ecom/ecom.h>
       
    29 #include <mmf/common/mmfutilities.h>
       
    30 #include <e32hashtab.h> 
       
    31 #include <a3f/a3fbase.h>
       
    32 
       
    33 //CLASS DECLARATION
       
    34 /*
       
    35 CFourCCConvertor class
       
    36 This is a class used to load the format Uids and fourCC codes in to Cache Table.
       
    37 This class is used for resolution of the fourCC code corresponding to format UID and vice-versa.
       
    38 */ 
       
    39 class CFourCCConvertor : public CBase
       
    40 	{
       
    41 public: 
       
    42 	/*
       
    43 	Create a Single instance of a class.If the instance is already created, It
       
    44 	returns that instance.
       
    45 	*/
       
    46 	IMPORT_C static CFourCCConvertor* NewL();
       
    47 	
       
    48 	/*
       
    49 	This method is used to find fourCC code corresponding to format Uid from cache table.
       
    50 	@param TUid aFormat a unique format Uid.
       
    51 	@param TFourCC &aFourCC The unique FourCC code.
       
    52 	@return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    53 	*/
       
    54 	IMPORT_C TInt FormatToFourCC(TUid aFormat,TFourCC &aFourCC);
       
    55 
       
    56 	/*
       
    57 	This method is used to find format Uid corresponding to fourCC Code from cache table.
       
    58 	@param TFourCC &aFourCC The unique FourCC code.
       
    59 	@param TUid aFormat a unique format Uid.
       
    60 	@return an error code. KErrNone if successful, otherwise one of the system wide error codes.
       
    61 	*/
       
    62 	IMPORT_C TInt FourCCToFormat(TFourCC aFourCC, TUid &aFormat) const;
       
    63 
       
    64 	/*
       
    65  	Destructor    
       
    66 	*/
       
    67 	virtual ~CFourCCConvertor();
       
    68 
       
    69 private:
       
    70 	/*
       
    71 	Constructor
       
    72 	*/
       
    73 	CFourCCConvertor();
       
    74 
       
    75 	/*
       
    76 	Second Phase Constructor
       
    77 	*/
       
    78 	void ConstructL();
       
    79 
       
    80 	/*
       
    81 	This method is used to initialize the cache tables. This method uses two cache
       
    82 	tables. It Stores Format Uids corresponding to fourCC Codes in one cache table
       
    83 	and fourCC codes corresponding to Format Uids in another cache table. In the First 
       
    84 	cache table,it uses format Uid as key and in the second cache table, it uses fourCC code as key. 
       
    85 	*/
       
    86 	void LoadL();
       
    87 
       
    88     // DATA DECLARATION
       
    89 
       
    90 	/* Cache Table that stores FourCC codes corresponding to Format Uids */
       
    91 	RHashMap<TUint32,TUint32> *iHashFourCCToFormat;
       
    92 	
       
    93 	/* Cache Table that stores format Uids corresponding to FourCC codes */
       
    94 	RHashMap<TUint32,TUint32> *iHashFormatToFourCC;
       
    95 
       
    96 	};
       
    97 
       
    98 #endif // A3FFOURCCLOOKUP_H