javauis/amms_qt/ammscontrol/audioeffect/src/cammsreverbsourcecontrolgroup.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 reverb source controls
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "cammsreverbsourcecontrolgroup.h"
       
    21 #include "cammsbasereverbsourcecontrol.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CAMMSReverbSourceControlGroup::NewLC
       
    27 // Two-phased constructor.
       
    28 // -----------------------------------------------------------------------------
       
    29 CAMMSReverbSourceControlGroup* CAMMSReverbSourceControlGroup::NewLC()
       
    30 {
       
    31     CAMMSReverbSourceControlGroup* self =
       
    32         new(ELeave) CAMMSReverbSourceControlGroup;
       
    33 
       
    34     CleanupStack::PushL(self);
       
    35 
       
    36     self->ConstructL();
       
    37 
       
    38     return self;
       
    39 }
       
    40 
       
    41 // Destructor
       
    42 CAMMSReverbSourceControlGroup::~CAMMSReverbSourceControlGroup()
       
    43 {
       
    44 }
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CAMMSReverbSourceControlGroup::RoomLevel
       
    48 // Gets the gain level of the reverberation
       
    49 // (other items were commented in a header).
       
    50 // -----------------------------------------------------------------------------
       
    51 TInt CAMMSReverbSourceControlGroup::RoomLevel()
       
    52 {
       
    53     return iRoomLevel;
       
    54 }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CAMMSReverbSourceControlGroup::SetRoomLevelL
       
    58 // Sets the gain level of the reverberation
       
    59 // (other items were commented in a header).
       
    60 // -----------------------------------------------------------------------------
       
    61 void CAMMSReverbSourceControlGroup::SetRoomLevelL(TInt aLevel)
       
    62 {
       
    63     // Set room level to controls.
       
    64     TInt count = ControlCount();
       
    65 
       
    66     for (TInt i = 0; i < count; i++)
       
    67     {
       
    68         TypeSafeControl(i)->SetRoomLevelL(aLevel);
       
    69     }
       
    70 
       
    71     iRoomLevel = aLevel;
       
    72 }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CAMMSReverbSourceControlGroup::TypeSafeControl
       
    76 // Gets control. Ownership is not tranferred.
       
    77 // (other items were commented in a header).
       
    78 // -----------------------------------------------------------------------------
       
    79 CAMMSBaseReverbSourceControl*
       
    80 CAMMSReverbSourceControlGroup::TypeSafeControl(TInt aIndex) const
       
    81 {
       
    82     return static_cast< CAMMSBaseReverbSourceControl* >(Control(aIndex));
       
    83 }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CAMMSReverbSourceControlGroup::ClassName
       
    87 // Returns class name that identifies this control group.
       
    88 // (other items were commented in a header).
       
    89 // -----------------------------------------------------------------------------
       
    90 const TDesC16& CAMMSReverbSourceControlGroup::ClassName()
       
    91 {
       
    92     return KAMMSReverbSourceControlClassName;
       
    93 }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CAMMSReverbSourceControlGroup::NotifyPlayerAddedL
       
    97 // Called by PlayerRemoved when new player is added.
       
    98 // (other items were commented in a header).
       
    99 // -----------------------------------------------------------------------------
       
   100 void CAMMSReverbSourceControlGroup::NotifyPlayerAddedL(
       
   101     CMMAPlayer* aPlayer,
       
   102     CMMAControl* aControl)
       
   103 {
       
   104     CAMMSControlGroup::NotifyPlayerAddedL(aPlayer, aControl);
       
   105 
       
   106     CAMMSBaseReverbSourceControl* control =
       
   107         static_cast<CAMMSBaseReverbSourceControl*>(aControl);
       
   108 
       
   109     // set the current parameters
       
   110     control->SetRoomLevelL(iRoomLevel);
       
   111 }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // CAMMSReverbSourceControlGroup::CAMMSReverbSourceControlGroup
       
   115 // C++ default constructor can NOT contain any code, that might leave.
       
   116 // -----------------------------------------------------------------------------
       
   117 CAMMSReverbSourceControlGroup::CAMMSReverbSourceControlGroup()
       
   118         : CAMMSControlGroup(KAMMSBaseReverbSourceControl),
       
   119         iRoomLevel(0)
       
   120 {
       
   121 }
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CAMMSReverbSourceControlGroup::ConstructL
       
   125 // Symbian 2nd phase constructor can leave.
       
   126 // -----------------------------------------------------------------------------
       
   127 void CAMMSReverbSourceControlGroup::ConstructL()
       
   128 {
       
   129     CAMMSControlGroup::ConstructL();
       
   130 }
       
   131 
       
   132 //  End of File