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