utilities/mpmediacontroller/tsrc/unittest_mpmediakeyhandler/stub/src/mpenginefactory.cpp
changeset 48 af3740e3753f
equal deleted inserted replaced
42:79c49924ae23 48:af3740e3753f
       
     1 /*
       
     2 * Copyright (c) 2009 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: MpEngineFactory stub for testing mpmediakeyhandler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "stub/inc/mpenginefactory.h"
       
    20 
       
    21 /*!
       
    22  *  Stub function
       
    23  */
       
    24 MpEngine::MpEngine() 
       
    25     : iMediaCommandReceived( CmdNone ),
       
    26       iMediaPropertyRequested( PropNone )
       
    27 {
       
    28 }
       
    29 
       
    30 
       
    31 /*!
       
    32  *  Stub function
       
    33  */
       
    34 
       
    35 void MpEngine::play()
       
    36 {
       
    37     iMediaCommandReceived = CmdPlay;
       
    38 }
       
    39 
       
    40 /*!
       
    41  *  Stub function
       
    42  */
       
    43 void MpEngine::pause()
       
    44 {
       
    45     iMediaCommandReceived = CmdPause;
       
    46 }
       
    47 
       
    48 /*!
       
    49  *  Stub function
       
    50  */
       
    51 void MpEngine::playPause()
       
    52 {
       
    53     iMediaCommandReceived = CmdPlayPause;
       
    54 }
       
    55 
       
    56 /*!
       
    57  *  Stub function
       
    58  */
       
    59 void MpEngine::stop()
       
    60 {
       
    61     iMediaCommandReceived = CmdStop;
       
    62 }
       
    63 
       
    64 /*!
       
    65  *  Stub function
       
    66  */
       
    67 void MpEngine::skipForward()
       
    68 {
       
    69     iMediaCommandReceived = CmdSkipForward;
       
    70 }
       
    71 
       
    72 /*!
       
    73  *  Stub function
       
    74  */
       
    75 void MpEngine::startSeekForward()
       
    76 {
       
    77     iMediaCommandReceived = CmdStartSeekForward;
       
    78 }
       
    79 
       
    80 /*!
       
    81  *  Stub function
       
    82  */
       
    83 void MpEngine::stopSeeking()
       
    84 {
       
    85     iMediaCommandReceived = CmdStopSeeking;
       
    86 }
       
    87 
       
    88 /*!
       
    89  *  Stub function
       
    90  */
       
    91 void MpEngine::skipBackward()
       
    92 {
       
    93     iMediaCommandReceived = CmdSkipBackward;
       
    94 }
       
    95 
       
    96 /*!
       
    97  *  Stub function
       
    98  */
       
    99 void MpEngine::startSeekBackward()
       
   100 {
       
   101     iMediaCommandReceived = CmdStartSeekBackward;
       
   102 }
       
   103 
       
   104 /*!
       
   105  *  Stub function
       
   106  */
       
   107 void MpEngine::getVolumeLevelMax( )
       
   108 {
       
   109     iMediaPropertyRequested = PropVolumeLevelMax;
       
   110 }
       
   111 
       
   112 /*!
       
   113  *  Stub function
       
   114  */
       
   115 void MpEngine::getVolumeLevel( )
       
   116 {
       
   117     iMediaPropertyRequested = PropVolumeLevel;
       
   118 }
       
   119 
       
   120 /*!
       
   121  *  Stub function
       
   122  */
       
   123 void MpEngine::increaseVolume()
       
   124 {
       
   125     iMediaCommandReceived = CmdIncreaseVolume;
       
   126 }
       
   127 
       
   128 /*!
       
   129  *  Stub function
       
   130  */
       
   131 void MpEngine::decreaseVolume()
       
   132 {
       
   133     iMediaCommandReceived = CmdDecreaseVolume;
       
   134 }
       
   135 
       
   136 /*!
       
   137  *  Stub function
       
   138  */
       
   139 void MpEngine::setVolumeLevel( int /*value*/ )
       
   140 {
       
   141     iMediaCommandReceived = CmdSetVolumeLevel;
       
   142 }
       
   143 
       
   144 /*!
       
   145  *  Stub function
       
   146  */
       
   147 void MpEngine::getVolumeMuteState( )
       
   148 {
       
   149     iMediaPropertyRequested = PropVolumeMuteState;
       
   150 }
       
   151 
       
   152 /*!
       
   153  *  Stub function
       
   154  */
       
   155 void MpEngine::muteVolume()
       
   156 {
       
   157     iMediaCommandReceived = CmdMuteVolume;
       
   158 }
       
   159 
       
   160 /*!
       
   161  *  Stub function
       
   162  */
       
   163 void MpEngine::unmuteVolume()
       
   164 {
       
   165     iMediaCommandReceived = CmdUnmuteVolume;
       
   166 }
       
   167 
       
   168 
       
   169 //============= MpEngineFactory =============
       
   170 
       
   171 /*!
       
   172  *  Stub function
       
   173  */
       
   174 MpEngineFactory::MpEngineFactory()
       
   175     : mSharedEngine( 0 )
       
   176 {
       
   177 }
       
   178 
       
   179 /*!
       
   180  *  Stub function
       
   181  */
       
   182 MpEngineFactory::~MpEngineFactory()
       
   183 {
       
   184     delete mSharedEngine;
       
   185     mSharedEngine = 0;
       
   186 }
       
   187 
       
   188 /*!
       
   189  *  Stub function
       
   190  */
       
   191 MpEngineFactory * MpEngineFactory::instance()
       
   192 {
       
   193     static MpEngineFactory instance;
       
   194     return &instance;
       
   195 }
       
   196 
       
   197 /*!
       
   198  *  Stub function
       
   199  */
       
   200 MpEngine *MpEngineFactory::sharedEngine()
       
   201 {
       
   202     if ( !instance()->mSharedEngine ) {
       
   203         instance()->mSharedEngine = new MpEngine();
       
   204     }
       
   205     return instance()->mSharedEngine;
       
   206 }
       
   207 
       
   208 /*!
       
   209  *  Stub function
       
   210  */
       
   211 void MpEngineFactory::close()
       
   212 {
       
   213     if ( instance()->mSharedEngine ) {
       
   214         delete instance()->mSharedEngine;
       
   215         instance()->mSharedEngine = 0;
       
   216     }
       
   217 }