controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp
changeset 22 a5692c68d772
parent 21 2883a5458389
equal deleted inserted replaced
21:2883a5458389 22:a5692c68d772
    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(d, SIGNAL(notifyRefreshStart()),
    40     connect(d, SIGNAL(notifyPreviewEvent(int)),
    39             this, SIGNAL(notifyRefreshStart()));
    41             this, SIGNAL(notifyPreviewEvent(int)));
    40     connect(d, SIGNAL(notifyRefreshFinish()),
       
    41             this, SIGNAL(notifyRefreshFinish()));
       
    42     connect(mAudioPlayer, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)),
       
    43             this, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)));
       
    44 }
    42 }
    45 
    43 
    46 ToneFetcherEngine::~ToneFetcherEngine()
    44 ToneFetcherEngine::~ToneFetcherEngine()
    47 {
    45 {
    48     delete d;
    46     delete d;
    49 }
    47 }
    50 
    48 
    51 void ToneFetcherEngine::getTone()
    49 void ToneFetcherEngine::getTones()
    52 {
    50 {
    53     d->QueryTones();
    51     d->getTones();
    54 }
    52 }
    55 
    53 
    56 void ToneFetcherEngine::preview(const QString &file )
    54 void ToneFetcherEngine::play(const QString &file)
    57 {
    55 {    
    58     mAudioPlayer->SetAttr(file);
    56     d->play(file);
    59     mAudioPlayer->Play();
       
    60 }
    57 }
    61 
    58 
    62 bool ToneFetcherEngine::IsPlaying()
    59 bool ToneFetcherEngine::isPlaying()
    63 {
    60 {
    64     mAudioPlayer->IsPlaying();
    61     return d->isPlaying();
    65 }
    62 }
    66 
    63 
    67 void ToneFetcherEngine::stop()
    64 void ToneFetcherEngine::stopPlaying()
    68 {
    65 {
    69     mAudioPlayer->Stop();
    66     d->stopPlaying();
    70 }
    67 }
    71 
    68 
    72 //End of File
    69 //End of File