javauis/amms_qt/ammscontrol/audio3D/src/cammsaudio3dcontrolgroup.cpp
changeset 23 98ccebc37403
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Group for 3D audio controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cammsaudio3dcontrolgroup.h"
       
    21 
       
    22 // ============================ MEMBER FUNCTIONS ===============================
       
    23 
       
    24 // Destructor
       
    25 CAMMSAudio3DControlGroup::~CAMMSAudio3DControlGroup()
       
    26 {
       
    27 }
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CAMMSAudio3DControlGroup::UpdateL
       
    31 // Update the controls depending on commit mode
       
    32 // (other items were commented in a header).
       
    33 // -----------------------------------------------------------------------------
       
    34 void CAMMSAudio3DControlGroup::UpdateL(TInt aCommit)
       
    35 {
       
    36     // Add new variables that have to be committed to member variable.
       
    37     iCommit |= aCommit;
       
    38 
       
    39     if (iCommitMode == EImmediate)
       
    40     {
       
    41         // Commit new values, and remove them from the member variable.
       
    42         CommitL(aCommit);
       
    43         iCommit &= ~aCommit;
       
    44     }
       
    45 }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CAMMSAudio3DControlGroup::SetModeL
       
    49 // Sets the mode of the CommitControl.
       
    50 // Can be called only from CAMMSCommitControlGroup
       
    51 // (other items were commented in a header).
       
    52 // -----------------------------------------------------------------------------
       
    53 void CAMMSAudio3DControlGroup::SetModeL(TCommitMode aMode)
       
    54 {
       
    55     // When switching back from the deferred mode to the immediate mode
       
    56     // (setDeferred(false)) all the pending parameters from the buffer are
       
    57     // transmitted to the audio processing system automatically.
       
    58     if (aMode == EImmediate)
       
    59     {
       
    60         CommitL(iCommit);
       
    61         iCommit = 0;
       
    62     }
       
    63     iCommitMode = aMode;
       
    64 }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CAMMSAudio3DControlGroup::CommitGroupL
       
    68 // Commits all the controls in the group
       
    69 // (other items were commented in a header).
       
    70 // -----------------------------------------------------------------------------
       
    71 void CAMMSAudio3DControlGroup::CommitGroupL()
       
    72 {
       
    73     // In case the mode is changed to EImmediate in the middle of commit process,
       
    74     // SetModeL method is implemented so that it takes care of all pending
       
    75     // parameter committing.
       
    76     if (iCommitMode == EDeferred)
       
    77     {
       
    78         CommitL(iCommit);
       
    79         iCommit = 0;
       
    80     }
       
    81 }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CAMMSAudio3DControlGroup::CAMMSAudio3DControlGroup
       
    85 // C++ default constructor can NOT contain any code, that
       
    86 // might leave.
       
    87 // (other items were commented in a header).
       
    88 // -----------------------------------------------------------------------------
       
    89 CAMMSAudio3DControlGroup::CAMMSAudio3DControlGroup(
       
    90     const TDesC& aName,
       
    91     TAMMSControlTypes aControlType) :
       
    92         CAMMSControlGroup(aName, aControlType)
       
    93 {
       
    94     // default values
       
    95     iCommitMode = EImmediate;
       
    96     iCommit = 0;
       
    97 }
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CAMMSAudio3DControlGroup::ConstructL
       
   101 // Symbian 2nd phase constructor can leave.
       
   102 // -----------------------------------------------------------------------------
       
   103 void CAMMSAudio3DControlGroup::ConstructL()
       
   104 {
       
   105     CAMMSControlGroup::ConstructL();
       
   106 }
       
   107 
       
   108 
       
   109