devicesrv_plat/accessory_policy_usb_audio_api/inc/accpolaudiocontrolbase.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2  * Copyright (c) 2007 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:  Base class for audio control objects.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef ACCPOLAUDIOCONTROLBASE_H
       
    19 #define ACCPOLAUDIOCONTROLBASE_H
       
    20 
       
    21 // SYSTEM INCLUDES
       
    22 #include <accpolobjectbase.h>
       
    23 #include <accpolobjecttypes.h>
       
    24 
       
    25 // DATA TYPES
       
    26 /**
       
    27  * Supported audio controls for feature unit.
       
    28  */
       
    29 const TUint32 KAccMuteControl   = 0x1; // 00000 00000 00000 00001
       
    30 const TUint32 KAccVolumeControl = 0x2; // 00000 00000 00000 00010
       
    31 
       
    32 /**
       
    33  * Predefined channel types.
       
    34  */
       
    35 const TUint32 KAccMasterChannel     = 0x0;
       
    36 const TUint32 KAccLeftFrontChannel  = 0x1; // 00000 00000 00000 00001
       
    37 const TUint32 KAccRightFrontChannel = 0x2; // 00000 00000 00000 00010
       
    38 const TUint32 KAccChannelCount      = 3;
       
    39 
       
    40 /**
       
    41  *  Base class for audio control objects.
       
    42  *
       
    43  *  @accpolaudiodevicetopology.lib
       
    44  */
       
    45 NONSHARABLE_CLASS ( CAccPolAudioControlBase ) : public CAccPolObjectBase
       
    46     {
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     virtual ~CAccPolAudioControlBase();
       
    53 
       
    54     /**
       
    55      * Assign operator for audio control base class.
       
    56      *
       
    57      * @param CAccPolAudioControlBase, Const reference to object to be copied.
       
    58      * @return CAccPolAudioControlBase, Reference to object pointer.
       
    59      */
       
    60     IMPORT_C CAccPolAudioControlBase& operator= ( const CAccPolAudioControlBase& );
       
    61 
       
    62     /**
       
    63      * Returns the audio unit Id, where the audio control parameters are associated.
       
    64      *
       
    65      * @return TInt, Value of the audio unit Id.
       
    66      */
       
    67     IMPORT_C TUint8 UnitId() const;
       
    68 
       
    69     /**
       
    70      * Sets the unit Id.
       
    71      *
       
    72      * @param aUnitId, Unit Id to be stored.
       
    73      * @return void.
       
    74      */
       
    75     IMPORT_C void SetUnitId( TUint8 aUnitId );
       
    76 
       
    77     /**
       
    78      * Sets a channel number where this audio control parameter(s) is/are associated.
       
    79      *
       
    80      * @param aChannel, Channel number. See accpolaudiotopologytypes.h.
       
    81      * @return void.
       
    82      */
       
    83     IMPORT_C void SetChannel( TUint32 aChannel );
       
    84 
       
    85     /**
       
    86      * Returns the channel number where the audio control parameter(s) is/are associated.
       
    87      *
       
    88      * @return TUint32, Value of channel number.
       
    89      */
       
    90     IMPORT_C TUint32 Channel() const;
       
    91 
       
    92 protected:
       
    93 
       
    94     /**
       
    95      * Externalize audio control base class.
       
    96      *
       
    97      * @param aStream, Write stream object.
       
    98      * @return void.
       
    99      */
       
   100     IMPORT_C void ExternalizeAudioControlbaseL( RWriteStream& aStream ) const;
       
   101 
       
   102     /**
       
   103      * Internalize audio control base class.
       
   104      *
       
   105      * @param aStream, Read stream object.
       
   106      * @return void.
       
   107      */
       
   108     IMPORT_C void InternalizeAudioControlbaseL( RReadStream& aStream );
       
   109 
       
   110 protected:
       
   111 
       
   112     /**
       
   113      * C++ default constructor.
       
   114      */
       
   115     CAccPolAudioControlBase( TTopologyConObjectType aObjectType,
       
   116         CAccPolObjectCon* aObject = NULL );
       
   117 
       
   118     /**
       
   119      * C++ default constructor.
       
   120      */
       
   121     CAccPolAudioControlBase( TTopologyConObjectType aObjectType,
       
   122         TUint32 aChannel );
       
   123 
       
   124 private:
       
   125 
       
   126     /**
       
   127      * Unit Id.
       
   128      */
       
   129     TUint8 iUnitId;
       
   130 
       
   131     /**
       
   132      * Channel number.
       
   133      */
       
   134     TUint32 iChannel;
       
   135     };
       
   136 
       
   137 #endif // ACCPOLAUDIOCONTROLBASE_H