audiostubs/devsoundextensions_stubs/inc/SbcEncoderIntfcCI.h
changeset 46 e1758cbb96ac
parent 0 0ce1b5ce9557
child 9 f935d51494d1
equal deleted inserted replaced
43:e71858845f73 46:e1758cbb96ac
       
     1 /*
       
     2 * Copyright (c) 2006-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: Audio Stubs -  Custom Interface stub object for configuring the SBC encoder.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSBCENCODERINTFCCI_H
       
    20 #define CSBCENCODERINTFCCI_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <SbcEncoderIntfc.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39  *  Custom Interface stub for configuring the SBC encoder operating modes.
       
    40  *  This class processes requests received from the CSbcEncoderIntfcProxy.
       
    41  *
       
    42  *  @lib SbcEncoderIntfcCI_Stub.lib
       
    43  *  @since S60 3.0
       
    44  */
       
    45 class CSbcEncoderIntfcCI : public CSbcEncoderIntfc
       
    46 	{
       
    47     public:  // Constructors and destructor
       
    48 
       
    49         /**
       
    50          * Two-phased constructor.
       
    51          */
       
    52 		IMPORT_C static CSbcEncoderIntfcCI* NewL();
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          */
       
    57         IMPORT_C virtual ~CSbcEncoderIntfcCI();
       
    58 
       
    59     public: // New functions
       
    60 
       
    61     public: // Functions from CSbcEncoderInfc base class
       
    62 
       
    63         /**
       
    64          * Retrieves the sampling frequencies supported by the encoder.
       
    65          * @since S60 3.0
       
    66          * @param RArray<TUint>& - reference to the array of sampling freq.
       
    67          * @return TInt status
       
    68          */
       
    69 		IMPORT_C virtual TInt GetSupportedSamplingFrequencies(
       
    70 		                      RArray<TUint>& aSupportedSamplingFrequencies);
       
    71 
       
    72         /**
       
    73          * Retrieves the channel modes supported by the encoder.
       
    74          * @since S60 3.0
       
    75          * @param RArray<TUint>& - reference to the array of channel modes.
       
    76          * @return TInt status
       
    77          */
       
    78 		IMPORT_C virtual TInt GetSupportedChannelModes(
       
    79 		                      RArray<TSbcChannelMode>& aSupportedChannelModes);
       
    80 
       
    81         /**
       
    82          * Retrieves the blocks supported by the encoder.
       
    83          * @since S60 3.0
       
    84          * @param RArray<TUint>& - reference to the array of blocks.
       
    85          * @return TInt status
       
    86          */
       
    87 		IMPORT_C virtual TInt GetSupportedNumOfBlocks(
       
    88 		                      RArray<TUint>& aSupportedNumOfBlocks);
       
    89 
       
    90         /**
       
    91          * Retrieves the subbands supported by the encoder.
       
    92          * @since S60 3.0
       
    93          * @param RArray<TUint>& - reference to the array of subbands.
       
    94          * @return TInt status
       
    95          */
       
    96 		IMPORT_C virtual TInt GetSupportedNumOfSubbands(
       
    97 		                      RArray<TUint>& aSupportedNumOfSubbands);
       
    98 
       
    99         /**
       
   100          * Retrieves the allocation methods supported by the encoder.
       
   101          * @since S60 3.0
       
   102          * @param RArray<TUint>& - reference to the array of alloc. methods.
       
   103          * @return TInt status
       
   104          */
       
   105 		IMPORT_C virtual TInt GetSupportedAllocationMethods(
       
   106 		                      RArray<TSbcAllocationMethod>&
       
   107 		                      aSupportedAllocationMethods);
       
   108 
       
   109         /**
       
   110          * Retrieves the bitpool size supported by the encoder.
       
   111          * @since S60 3.0
       
   112          * @param TUint& - reference to the min bitpool size.
       
   113          * @param TUint& - reference to the max bitpool size.
       
   114          * @return TInt status
       
   115          */
       
   116 		IMPORT_C virtual TInt GetSupportedBitpoolRange(
       
   117 		                      TUint& aMinSupportedBitpoolSize,
       
   118 		                      TUint& aMaxSupportedBitpoolSize);
       
   119 
       
   120         /**
       
   121          * Sets new sampling frequency.
       
   122          * @since S60 3.0
       
   123          * @param TUint - sampling frequency to be set.
       
   124          * @return void
       
   125          */
       
   126 		IMPORT_C virtual void SetSamplingFrequency(TUint aSamplingFrequency);
       
   127 
       
   128         /**
       
   129          * Returns current sampling frequency.
       
   130          * @since S60 3.0
       
   131          * @param TUint& - current sampling frequency.
       
   132          * @return TInt - status
       
   133          */
       
   134 		IMPORT_C virtual TInt GetSamplingFrequency(TUint& aSamplingFrequency);
       
   135 
       
   136         /**
       
   137          * Sets new channel mode.
       
   138          * @since S60 3.0
       
   139          * @param TSbcChannelMode - channel mode to be set.
       
   140          * @return void
       
   141          */
       
   142 		IMPORT_C virtual void SetChannelMode(TSbcChannelMode aChannelMode);
       
   143 
       
   144         /**
       
   145          * Returns current channel mode.
       
   146          * @since S60 3.0
       
   147          * @param TSbcChannelMode& - current channel mode.
       
   148          * @return TInt - status
       
   149          */
       
   150 		IMPORT_C virtual TInt GetChannelMode(TSbcChannelMode& aChannelMode);
       
   151 
       
   152         /**
       
   153           * Sets new number of subbands.
       
   154           * @since S60 3.0
       
   155           * @param TSbcChannelMode - number of subbands to be set.
       
   156           * @return void
       
   157           */
       
   158 		IMPORT_C virtual void SetNumOfSubbands(TUint aNumOfSubbands);
       
   159 
       
   160         /**
       
   161           * Returns current number of subbands.
       
   162           * @since S60 3.0
       
   163           * @param TUint& - current subbands.
       
   164           * @return TInt - status
       
   165           */
       
   166 		IMPORT_C virtual TInt GetNumOfSubbands(TUint& aNumOfSubbands);
       
   167 
       
   168         /**
       
   169          * Sets new number of blocks.
       
   170          * @since S60 3.0
       
   171          * @param TSbcChannelMode - number of blocks to be set.
       
   172          * @return void
       
   173          */
       
   174 		IMPORT_C virtual void SetNumOfBlocks(TUint aNumOfBlocks);
       
   175 
       
   176         /**
       
   177          * Returns current number of blocks.
       
   178          * @since S60 3.0
       
   179          * @param TUint& - current number of blocks.
       
   180          * @return TInt - status
       
   181          */
       
   182 		IMPORT_C virtual TInt GetNumOfBlocks(TUint& aNumOfBlocks);
       
   183 
       
   184         /**
       
   185          * Sets new allocation method.
       
   186          * @since S60 3.0
       
   187          * @param TSbcAllocationMethod - allocation method to be set.
       
   188          * @return void
       
   189          */
       
   190 		IMPORT_C virtual void SetAllocationMethod(
       
   191 		                      TSbcAllocationMethod aAllocationMethod);
       
   192 
       
   193         /**
       
   194          * Returns current allocation method.
       
   195          * @since S60 3.0
       
   196          * @param TUint& - current allocation method.
       
   197          * @return TInt - status
       
   198          */
       
   199 		IMPORT_C virtual TInt GetAllocationMethod(
       
   200 		                      TSbcAllocationMethod& aAllocationMethod);
       
   201 
       
   202         /**
       
   203          * Sets new bitpool size.
       
   204          * @since S60 3.0
       
   205          * @param TUint - bitpool size to be set.
       
   206          * @return void
       
   207          */
       
   208 		IMPORT_C virtual void SetBitpoolSize(TUint aBitpoolSize);
       
   209 
       
   210         /**
       
   211          * Returns current bitpool size.
       
   212          * @since S60 3.0
       
   213          * @param TUint& - current bitpool size.
       
   214          * @return TInt - status
       
   215          */
       
   216 		IMPORT_C virtual TInt GetBitpoolSize(TUint& aBitpoolSize);
       
   217 
       
   218         /**
       
   219          * Commits new configuration settings.
       
   220          * @since S60 3.0
       
   221          * @return TInt - status
       
   222          */
       
   223 		IMPORT_C virtual TInt ApplyConfig();
       
   224 
       
   225 
       
   226     protected:  // New functions
       
   227 
       
   228     protected:  // Functions from base classes
       
   229 
       
   230 	private:
       
   231 
       
   232         /**
       
   233          * C++ default constructor.
       
   234          */
       
   235         CSbcEncoderIntfcCI();
       
   236 
       
   237         /**
       
   238          * Symbian 2nd phase constructor.
       
   239          */
       
   240         void ConstructL();
       
   241 
       
   242     public:     // Data
       
   243     protected:  // Data
       
   244     private:    // Data
       
   245 
       
   246     	// Working config before ApplyConfig()
       
   247     	TUint                iSamplingFrequency;
       
   248     	TSbcChannelMode      iChannelMode;
       
   249     	TUint                iNumOfSubbands;
       
   250     	TUint                iNumOfBlocks;
       
   251     	TSbcAllocationMethod iAllocationMethod;
       
   252     	TUint                iBitpoolSize;
       
   253 
       
   254     	// Current config after ApplyConfig()
       
   255     	TUint                iCurrentSamplingFrequency;
       
   256     	TSbcChannelMode      iCurrentChannelMode;
       
   257     	TUint                iCurrentNumOfSubbands;
       
   258     	TUint                iCurrentNumOfBlocks;
       
   259     	TSbcAllocationMethod iCurrentAllocationMethod;
       
   260     	TUint                iCurrentBitpoolSize;
       
   261 
       
   262 	};
       
   263 
       
   264 #endif      // CSBCENCODERINTFCCI_H
       
   265 
       
   266 // End of File