javauis/amms_qt/mmacontrol/src/cammscontrol.cpp
branchRCL_3
changeset 18 9ac0a0a7da70
parent 17 0fd27995241b
child 19 71c436fe3ce0
equal deleted inserted replaced
17:0fd27995241b 18:9ac0a0a7da70
     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:  Base class for AMMS controls.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <cmmaaudioplayer.h>
       
    21 #include <cmmamidiplayer.h>
       
    22 #include "cammscontrol.h"
       
    23 #include "cammscustomcommandutility.h"
       
    24 
       
    25 // ============================ MEMBER FUNCTIONS ===============================
       
    26 
       
    27 // Destructor
       
    28 CAMMSControl::~CAMMSControl()
       
    29 {
       
    30 }
       
    31 
       
    32 // -----------------------------------------------------------------------------
       
    33 // CAMMSControl::CreateCustomCommandUtilityL
       
    34 // Creates a custom command utility.
       
    35 // (other items were commented in a header).
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CCustomCommandUtility* CAMMSControl::CreateCustomCommandUtilityL()
       
    39 {
       
    40     CCustomCommandUtility* customCommandUtility = NULL;
       
    41 
       
    42     if (iPlayer->Type() == KMMAMIDIPlayer)
       
    43     {
       
    44         CMMAMIDIPlayer* mmaMIDIPlayer =
       
    45             reinterpret_cast< CMMAMIDIPlayer* >(iPlayer);
       
    46 
       
    47         CMidiClientUtility* midiClientUtility = mmaMIDIPlayer->MidiClient();
       
    48         customCommandUtility =
       
    49             CCustomCommandUtility::NewL(*midiClientUtility);
       
    50     }
       
    51     else if (iPlayer->Type() == KMMAAudioPlayer)
       
    52     {
       
    53         CMMAAudioPlayer* mmaAudioPlayer =
       
    54             reinterpret_cast< CMMAAudioPlayer* >(iPlayer);
       
    55 
       
    56         RMMFController& mmfController = mmaAudioPlayer->Controller();
       
    57         customCommandUtility =
       
    58             CAMMSCustomCommandUtility::NewL(mmfController);
       
    59     }
       
    60     else
       
    61     {
       
    62         // Player is KMMAEMCAudioPlayer or of other type
       
    63         // Do nothing
       
    64     }
       
    65 
       
    66     return customCommandUtility;
       
    67 }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CAMMSControl::PublicClassName
       
    71 // Returns public class name.
       
    72 // (other items were commented in a header).
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 const TDesC& CAMMSControl::PublicClassName() const
       
    76 {
       
    77     // Return null descriptor so that the control name is not visible in MMA.
       
    78     return KNullDesC;
       
    79 }
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CAMMSControl::PrepareControlL
       
    83 // Virtual function to prepare Controls.
       
    84 // (other items were commented in a header).
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 void CAMMSControl::PrepareControlL()
       
    88 {
       
    89     // Empty implementation, the Controls that need preparing overwrite this
       
    90 }
       
    91 
       
    92 // -----------------------------------------------------------------------------
       
    93 // CAMMSControl::DeallocateControl
       
    94 // Virtual function to deallocate Controls.
       
    95 // (other items were commented in a header).
       
    96 // -----------------------------------------------------------------------------
       
    97 //
       
    98 void CAMMSControl::DeallocateControl()
       
    99 {
       
   100     // Empty implementation, the Controls that need deallocating overwrite this
       
   101 }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CAMMSControl::CAMMSControl
       
   105 // C++ default constructor can NOT contain any code, that
       
   106 // might leave.
       
   107 // -----------------------------------------------------------------------------
       
   108 CAMMSControl::CAMMSControl(CMMAPlayer* aPlayer)
       
   109         : iPlayer(aPlayer)
       
   110 {
       
   111 }
       
   112 
       
   113 //  End of File
       
   114