radioapp/radioenginewrapper/src/radioenginewrapper_win32.cpp
changeset 16 f54ebcfc1b80
parent 13 46974bebc798
child 19 afea38384506
equal deleted inserted replaced
14:63aabac4416d 16:f54ebcfc1b80
    21 #include "radioenginewrapperobserver.h"
    21 #include "radioenginewrapperobserver.h"
    22 
    22 
    23 /*!
    23 /*!
    24  * Constructor
    24  * Constructor
    25  */
    25  */
    26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler,
    26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) :
    27                                         RadioEngineWrapperObserver& observer ) :
    27     d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) )
    28     d_ptr( new RadioEngineWrapperPrivate( this, stationHandler, observer ) )
       
    29 {
    28 {
    30     Q_D( RadioEngineWrapper );
    29     Q_D( RadioEngineWrapper );
    31     d->init();
    30     d->init();
    32 }
    31 }
    33 
    32 
    35  * Destructor
    34  * Destructor
    36  */
    35  */
    37 RadioEngineWrapper::~RadioEngineWrapper()
    36 RadioEngineWrapper::~RadioEngineWrapper()
    38 {
    37 {
    39     delete d_ptr;
    38     delete d_ptr;
       
    39 }
       
    40 
       
    41 /*!
       
    42  *
       
    43  */
       
    44 void RadioEngineWrapper::addObserver( RadioEngineWrapperObserver* observer )
       
    45 {
       
    46     Q_D( RadioEngineWrapper );
       
    47     d->mObservers.append( observer );
       
    48 }
       
    49 
       
    50 /*!
       
    51  *
       
    52  */
       
    53 void RadioEngineWrapper::removeObserver( RadioEngineWrapperObserver* observer )
       
    54 {
       
    55     Q_D( RadioEngineWrapper );
       
    56     d->mObservers.removeAll( observer );
    40 }
    57 }
    41 
    58 
    42 /*!
    59 /*!
    43  * Checks if the radio engine has been constructed properly
    60  * Checks if the radio engine has been constructed properly
    44  */
    61  */
   109 {
   126 {
   110     return true;
   127     return true;
   111 }
   128 }
   112 
   129 
   113 /*!
   130 /*!
   114  * Checks if the scan is on
   131  * Returns the currently tuned frequency
   115  */
   132  */
   116 bool RadioEngineWrapper::isScanning() const
   133 uint RadioEngineWrapper::currentFrequency() const
       
   134 {
       
   135     Q_D( const RadioEngineWrapper );
       
   136     return d->mFrequency;
       
   137 }
       
   138 
       
   139 /*!
       
   140  * Returns the mute status
       
   141  */
       
   142 bool RadioEngineWrapper::isMuted() const
   117 {
   143 {
   118     return false;
   144     return false;
   119 }
   145 }
   120 
   146 
   121 /*!
   147 /*!
   122  * Returns the currently tuned frequency
   148  * Returns the antenna connection status
   123  */
       
   124 uint RadioEngineWrapper::currentFrequency() const
       
   125 {
       
   126     Q_D( const RadioEngineWrapper );
       
   127     return d->mFrequency;
       
   128 }
       
   129 
       
   130 /*!
       
   131  * Returns the mute status
       
   132  */
       
   133 bool RadioEngineWrapper::isMuted() const
       
   134 {
       
   135     return false;
       
   136 }
       
   137 
       
   138 /*!
       
   139  * Returns the headset connection status
       
   140  */
   149  */
   141 bool RadioEngineWrapper::isAntennaAttached() const
   150 bool RadioEngineWrapper::isAntennaAttached() const
   142 {
   151 {
   143     Q_D( const RadioEngineWrapper );
   152     Q_D( const RadioEngineWrapper );
   144     return d->mAntennaAttached;
   153     return d->mAntennaAttached;
   191  *
   200  *
   192  */
   201  */
   193 void RadioEngineWrapper::toggleAudioRoute()
   202 void RadioEngineWrapper::toggleAudioRoute()
   194 {
   203 {
   195     Q_D( RadioEngineWrapper );
   204     Q_D( RadioEngineWrapper );
   196     d->mUseLoudspeaker = !d->mUseLoudspeaker;
   205     d->toggleAudioRoute();
   197     d->mObserver.audioRouteChanged( d->mUseLoudspeaker );
   206 }
   198 }
   207 
   199 
   208 /*!
   200 /*!
   209  *
   201  *
   210  */
   202  */
   211 void RadioEngineWrapper::startSeeking( Seeking::Direction direction, const int reason )
   203 void RadioEngineWrapper::startSeeking( Seeking::Direction direction )
   212 {
   204 {
   213     Q_D( RadioEngineWrapper );
   205     Q_D( RadioEngineWrapper );
   214     d->startSeeking( direction, reason );
   206     d->startSeeking( direction );
   215 }
   207 }
   216 
   208 
   217 /*!
   209 /*!
   218  *
   210  *
   219  */
   211  */
   220 void RadioEngineWrapper::cancelSeeking()
   212 void RadioEngineWrapper::scanFrequencyBand()
   221 {
   213 {
   222     Q_D( RadioEngineWrapper );
   214 }
   223     d->cancelSeeking();
   215 
   224 }
   216 /*!
       
   217  *
       
   218  */
       
   219 void RadioEngineWrapper::cancelScanFrequencyBand()
       
   220 {
       
   221     Q_D( RadioEngineWrapper );
       
   222     d->frequencyScannerFinished();
       
   223 }