inc/mpenginefactory.h
changeset 29 8192e5b5c935
child 55 f3930dda3342
equal deleted inserted replaced
25:3ec52facab4d 29:8192e5b5c935
       
     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: Music Player engine.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MPENGINEFACTORY_H
       
    19 #define MPENGINEFACTORY_H
       
    20 
       
    21 #include <QObject>
       
    22 
       
    23 #include "mpengine.h"
       
    24 #include "mpcommondefs.h"
       
    25 
       
    26 
       
    27 #if defined(BUILD_MPENGINE_LIB)
       
    28 #define MPENGINE_EXPORT Q_DECL_EXPORT
       
    29 #else
       
    30 #define MPENGINE_EXPORT Q_DECL_IMPORT
       
    31 #endif
       
    32 
       
    33 
       
    34 class MPENGINE_EXPORT MpEngineFactory : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 private:
       
    39     explicit MpEngineFactory();
       
    40 
       
    41 public:
       
    42     virtual ~MpEngineFactory();
       
    43     static MpEngineFactory * instance();
       
    44     
       
    45     static MpEngine *createSharedEngine( TUid uid = TUid::Uid( MpCommon::KMusicPlayerUid ), MpEngine::EngineMode mode = MpEngine::StandAlone );
       
    46     static MpEngine *createIsolatedEngine( MpEngine::EngineMode mode );
       
    47     static MpEngine *sharedEngine();
       
    48     static void close();
       
    49 	
       
    50 private:
       
    51     
       
    52     Q_DISABLE_COPY( MpEngineFactory )
       
    53     
       
    54     MpEngine             *mSharedEngine;
       
    55     QList<MpEngine *>    mEngines;
       
    56 
       
    57 };
       
    58 
       
    59 #endif // MPENGINEFACTORY_H