javauis/amms_qt/ammscontrol/audio3D/src/cammscommitcontrolgroup.cpp
branchRCL_3
changeset 17 0fd27995241b
equal deleted inserted replaced
15:f9bb0fca356a 17:0fd27995241b
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Group for commit controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "cammscommitcontrolgroup.h"
       
    23 #include "cammsmodule.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CAMMSCommitControlGroup::NewLC
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 CAMMSCommitControlGroup* CAMMSCommitControlGroup::NewLC(
       
    32     CAMMSModule& aSpectator,
       
    33     CAMMSModuleContainer& aSoundSource3Ds)
       
    34 {
       
    35     CAMMSCommitControlGroup* self = new(ELeave) CAMMSCommitControlGroup(
       
    36         aSpectator,
       
    37         aSoundSource3Ds);
       
    38 
       
    39     CleanupStack::PushL(self);
       
    40     // calls base class ConstructL
       
    41     self->ConstructL();
       
    42 
       
    43     return self;
       
    44 }
       
    45 
       
    46 // Destructor
       
    47 CAMMSCommitControlGroup::~CAMMSCommitControlGroup()
       
    48 {
       
    49 }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CAMMSCommitControlGroup::CommitAllControlsL
       
    53 // Transfers all the pending parameters to the audio processing system
       
    54 // for all ControlGroups in this controllable
       
    55 // (other items were commented in a header).
       
    56 // -----------------------------------------------------------------------------
       
    57 void CAMMSCommitControlGroup::CommitAllControlsL()
       
    58 {
       
    59     TInt groupAmount = 0;
       
    60 
       
    61     // Go through every module in SoundSource3D
       
    62     TInt moduleAmount = iSoundSource3Ds.Count();
       
    63     for (TInt i = 0; i < moduleAmount; i++)
       
    64     {
       
    65         CAMMSModule* module = iSoundSource3Ds.At(i);
       
    66 
       
    67         // Go through every ControlGroup in Module
       
    68         groupAmount = module->Count();
       
    69         for (TInt j = 0; j < groupAmount; j++)
       
    70         {
       
    71             MAMMSControlGroup* group = module->At(j);
       
    72             group->CommitGroupL();
       
    73         }
       
    74     }
       
    75 
       
    76     // And finally go through every ControlGroup in Spectator
       
    77     groupAmount = iSpectator.Count();
       
    78     for (TInt i = 0; i < groupAmount; i++)
       
    79     {
       
    80         MAMMSControlGroup* group = iSpectator.At(i);
       
    81         group->CommitGroupL();
       
    82     }
       
    83 }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CAMMSCommitControlGroup::SetDeferredL
       
    87 // Sets the mode of the CommitControl
       
    88 // (other items were commented in a header).
       
    89 // -----------------------------------------------------------------------------
       
    90 void CAMMSCommitControlGroup::SetDeferredL(TBool aDeferred)
       
    91 {
       
    92     TInt groupAmount = 0;
       
    93     TCommitMode mode = (aDeferred ? EDeferred : EImmediate);
       
    94 
       
    95     // Go through every module in SoundSource3D
       
    96     TInt moduleAmount = iSoundSource3Ds.Count();
       
    97     for (TInt i = 0; i < moduleAmount; i++)
       
    98     {
       
    99         CAMMSModule* module = iSoundSource3Ds.At(i);
       
   100 
       
   101         // Go through every ControlGroup in Module
       
   102         groupAmount = module->Count();
       
   103         for (TInt j = 0; j < groupAmount; j++)
       
   104         {
       
   105             MAMMSControlGroup* group = module->At(j);
       
   106             group->SetModeL(mode);
       
   107         }
       
   108     }
       
   109 
       
   110     // And finally go through every ControlGroup in Spectator
       
   111     groupAmount = iSpectator.Count();
       
   112     for (TInt i = 0; i < groupAmount; i++)
       
   113     {
       
   114         MAMMSControlGroup* group = iSpectator.At(i);
       
   115         group->SetModeL(mode);
       
   116     }
       
   117 }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CAMMSCommitControlGroup::ClassName
       
   121 // Returns class name that identifies this control group.
       
   122 // (other items were commented in a header).
       
   123 // -----------------------------------------------------------------------------
       
   124 const TDesC16& CAMMSCommitControlGroup::ClassName()
       
   125 {
       
   126     return KAMMSCommitControlClassName;
       
   127 }
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CAMMSCommitControlGroup::CommitL
       
   131 // Transfers all the pending parameters to the audio processing system.
       
   132 // (other items were commented in a header).
       
   133 // -----------------------------------------------------------------------------
       
   134 void CAMMSCommitControlGroup::CommitL(TInt /*aCommit*/)
       
   135 {
       
   136 }
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // CAMMSCommitControlGroup::CAMMSCommitControlGroup
       
   140 // C++ default constructor can NOT contain any code, that
       
   141 // might leave.
       
   142 // -----------------------------------------------------------------------------
       
   143 CAMMSCommitControlGroup::CAMMSCommitControlGroup(
       
   144     CAMMSModule& aSpectator,
       
   145     CAMMSModuleContainer& aSoundSource3Ds):
       
   146 // CommitControlGroup has no associated amms controls therefore
       
   147 // the name passed as a parameter to the constructor is KNullDesC
       
   148 // CHANGED for now, passing actual name here even no associated Controls.
       
   149         CAMMSAudio3DControlGroup(KAMMSCommitControl),
       
   150         iSpectator(aSpectator),
       
   151         iSoundSource3Ds(aSoundSource3Ds)
       
   152 {
       
   153 }
       
   154 
       
   155