javauis/amms_akn/mmacontrol/src/cammsvolumecontrolbuilder.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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:  AMMS player builder for adding AMMS audio player controls.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <cmmavolumecontrol.h>
       
    22 #include <cmmaaudioplayer.h>
       
    23 #include <jdebug.h>
       
    24 
       
    25 #include "cammsvolumecontrolbuilder.h"
       
    26 #include "cammsvolumecontrol.h"
       
    27 #include "ammsconstants.h"
       
    28 #include "ammsutil.h"
       
    29 
       
    30 // ============================ MEMBER FUNCTIONS ===============================
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CAMMSVolumeControlBuilder::NewL
       
    34 // Two-phased constructor.
       
    35 // -----------------------------------------------------------------------------
       
    36 CAMMSVolumeControlBuilder* CAMMSVolumeControlBuilder::NewLC()
       
    37 {
       
    38     CAMMSVolumeControlBuilder* self = new(ELeave) CAMMSVolumeControlBuilder();
       
    39     CleanupStack::PushL(self);
       
    40     return self;
       
    41 }
       
    42 
       
    43 
       
    44 // Destructor
       
    45 CAMMSVolumeControlBuilder::~CAMMSVolumeControlBuilder()
       
    46 {
       
    47 }
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CAMMSVolumeControlBuilder::PreparePlayerL
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void CAMMSVolumeControlBuilder::PreparePlayerL(CMMAPlayer* aPlayer)
       
    54 {
       
    55     DEBUG_STR("AMMS::CAMMSVolumeControlBuilder::PreparePlayerL type %S",
       
    56               aPlayer->Type());
       
    57 
       
    58     CMMAControl* control = AMMSUtil::FindControl(aPlayer,
       
    59                            KMMAVolumeControlName);
       
    60     if (control)
       
    61     {
       
    62         CMMAVolumeControl* mmaControl =
       
    63             reinterpret_cast< CMMAVolumeControl* >(control);
       
    64 
       
    65         CAMMSVolumeControl* ammsControl = CAMMSVolumeControl::NewLC(
       
    66                                               KAMMSGlobalVolume,
       
    67                                               mmaControl,
       
    68                                               aPlayer);
       
    69         aPlayer->AddControlL(ammsControl);
       
    70         CleanupStack::Pop(ammsControl);
       
    71 
       
    72         DEBUG("AMMS::CAMMSVolumeControlBuilder::PreparePlayerL add OK");
       
    73     }
       
    74     // else volume control need not to be added, for example camera player.
       
    75 }
       
    76 
       
    77 // -----------------------------------------------------------------------------
       
    78 // CAMMSVolumeControlBuilder::CAMMSVolumeControlBuilder
       
    79 // C++ default constructor can NOT contain any code, that
       
    80 // might leave.
       
    81 // -----------------------------------------------------------------------------
       
    82 CAMMSVolumeControlBuilder::CAMMSVolumeControlBuilder()
       
    83 {
       
    84 }
       
    85 
       
    86 //  End of File