45
|
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 |
*
|
47
|
14 |
* Description: mp engine factory stub for testing mpsettingsaudioeffectswidget
|
45
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "mpengine.h"
|
|
19 |
#include "mpenginefactory.h"
|
|
20 |
#include "mptrace.h"
|
|
21 |
|
|
22 |
/*!
|
47
|
23 |
Stub
|
45
|
24 |
*/
|
|
25 |
|
|
26 |
/*!
|
|
27 |
Constructs music player engine factory.
|
|
28 |
*/
|
|
29 |
MpEngineFactory::MpEngineFactory()
|
|
30 |
: mSharedEngine( 0 )
|
|
31 |
{
|
|
32 |
TX_ENTRY_ARGS("Stub")
|
|
33 |
}
|
|
34 |
|
|
35 |
/*!
|
|
36 |
Destructs music player engine factory.
|
|
37 |
*/
|
|
38 |
MpEngineFactory::~MpEngineFactory()
|
|
39 |
{
|
|
40 |
}
|
|
41 |
|
|
42 |
/*!
|
|
43 |
Returns the singleton instance of music player engine factory.
|
|
44 |
*/
|
|
45 |
MpEngineFactory * MpEngineFactory::instance()
|
|
46 |
{
|
|
47 |
static MpEngineFactory instance;
|
|
48 |
return &instance;
|
|
49 |
}
|
|
50 |
|
|
51 |
/*!
|
|
52 |
Returns an instance to an engine with \a hostUid, and \a mode, if the shared engine is
|
|
53 |
already created parameters are ignored.
|
|
54 |
*/
|
|
55 |
MpEngine *MpEngineFactory::createSharedEngine( TUid hostUid , MpEngine::EngineMode mode )
|
|
56 |
{
|
|
57 |
Q_UNUSED( hostUid );
|
|
58 |
Q_UNUSED( mode );
|
|
59 |
if ( !instance()->mSharedEngine ) {
|
|
60 |
instance()->mSharedEngine = new MpEngine();
|
|
61 |
}
|
|
62 |
return instance()->mSharedEngine;
|
|
63 |
}
|
|
64 |
|
|
65 |
/*!
|
|
66 |
Returns an instance to the current shared engine previously created with createEngine().
|
|
67 |
*/
|
|
68 |
MpEngine *MpEngineFactory::sharedEngine()
|
|
69 |
{
|
|
70 |
return instance()->mSharedEngine;
|
|
71 |
}
|
|
72 |
|
|
73 |
/*!
|
|
74 |
Closes all engines created on this process.
|
|
75 |
*/
|
|
76 |
void MpEngineFactory::close()
|
|
77 |
{
|
|
78 |
if ( instance()->mSharedEngine ) {
|
|
79 |
delete instance()->mSharedEngine;
|
|
80 |
instance()->mSharedEngine = 0;
|
|
81 |
|
|
82 |
}
|
|
83 |
}
|