19
|
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:
|
|
15 |
* The source file for tone fetcher engine.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
#include "tonefetcherengine.h"
|
|
19 |
#include "toneselectionengine_p.h"
|
|
20 |
#include "tonepreviewprivate.h"
|
|
21 |
|
|
22 |
ToneFetcherEngine::ToneFetcherEngine(QObject* parent) : QObject(parent)
|
|
23 |
{
|
|
24 |
d = new ToneSelectionEnginePrivate(this);
|
|
25 |
Q_ASSERT(d);
|
|
26 |
mAudioPlayer = new TonePreviewPrivate( this );
|
|
27 |
Q_ASSERT(mAudioPlayer);
|
|
28 |
connect(d, SIGNAL(mdeSessionOpened()),
|
|
29 |
this, SIGNAL(mdeSessionOpened()));
|
|
30 |
connect(d, SIGNAL(mdeSessionError(int)),
|
|
31 |
this, SIGNAL(mdeSessionError(int)));
|
|
32 |
connect(d, SIGNAL(queryComplete(QStringList, QStringList)),
|
|
33 |
this, SIGNAL(queryComplete(QStringList, QStringList)));
|
|
34 |
connect(d, SIGNAL(queryError(int)),
|
|
35 |
this, SIGNAL(queryError(int)));
|
|
36 |
connect(d, SIGNAL(notifyObjectChanged()),
|
|
37 |
this, SIGNAL(notifyObjectChanged()));
|
21
|
38 |
connect(d, SIGNAL(notifyRefreshStart()),
|
|
39 |
this, SIGNAL(notifyRefreshStart()));
|
|
40 |
connect(d, SIGNAL(notifyRefreshFinish()),
|
|
41 |
this, SIGNAL(notifyRefreshFinish()));
|
19
|
42 |
connect(mAudioPlayer, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)),
|
|
43 |
this, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)));
|
|
44 |
}
|
|
45 |
|
|
46 |
ToneFetcherEngine::~ToneFetcherEngine()
|
|
47 |
{
|
|
48 |
delete d;
|
|
49 |
}
|
|
50 |
|
|
51 |
void ToneFetcherEngine::getTone()
|
|
52 |
{
|
|
53 |
d->QueryTones();
|
|
54 |
}
|
|
55 |
|
|
56 |
void ToneFetcherEngine::preview(const QString &file )
|
|
57 |
{
|
|
58 |
mAudioPlayer->SetAttr(file);
|
|
59 |
mAudioPlayer->Play();
|
|
60 |
}
|
|
61 |
|
|
62 |
bool ToneFetcherEngine::IsPlaying()
|
|
63 |
{
|
|
64 |
mAudioPlayer->IsPlaying();
|
|
65 |
}
|
21
|
66 |
|
|
67 |
void ToneFetcherEngine::stop()
|
|
68 |
{
|
|
69 |
mAudioPlayer->Stop();
|
|
70 |
}
|
|
71 |
|
19
|
72 |
//End of File
|