radioapp/radioenginewrapper/src/radioenginewrapper_win32.cpp
branchGCC_SURGE
changeset 37 451b2e1545b2
parent 19 afea38384506
parent 32 189d20c34778
equal deleted inserted replaced
26:6bcf277166c1 37:451b2e1545b2
    24  * Constructor
    24  * Constructor
    25  */
    25  */
    26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) :
    26 RadioEngineWrapper::RadioEngineWrapper( RadioStationHandlerIf& stationHandler ) :
    27     d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) )
    27     d_ptr( new RadioEngineWrapperPrivate( this, stationHandler ) )
    28 {
    28 {
    29     Q_D( RadioEngineWrapper );
       
    30     d->init();
       
    31 }
    29 }
    32 
    30 
    33 /*!
    31 /*!
    34  * Destructor
    32  * Destructor
    35  */
    33  */
    36 RadioEngineWrapper::~RadioEngineWrapper()
    34 RadioEngineWrapper::~RadioEngineWrapper()
    37 {
    35 {
    38     delete d_ptr;
    36 }
       
    37 
       
    38 /*!
       
    39  *
       
    40  */
       
    41 bool RadioEngineWrapper::init()
       
    42 {
       
    43     Q_D( RadioEngineWrapper );
       
    44     return d->init();
    39 }
    45 }
    40 
    46 
    41 /*!
    47 /*!
    42  *
    48  *
    43  */
    49  */
    55     Q_D( RadioEngineWrapper );
    61     Q_D( RadioEngineWrapper );
    56     d->mObservers.removeAll( observer );
    62     d->mObservers.removeAll( observer );
    57 }
    63 }
    58 
    64 
    59 /*!
    65 /*!
    60  * Checks if the radio engine has been constructed properly
       
    61  */
       
    62 bool RadioEngineWrapper::isEngineConstructed()
       
    63 {
       
    64     Q_D( RadioEngineWrapper );
       
    65     return d->isEngineConstructed();
       
    66 }
       
    67 
       
    68 /*!
       
    69  * Returns the settings handler owned by the engine
    66  * Returns the settings handler owned by the engine
    70  */
    67  */
    71 RadioSettingsIf& RadioEngineWrapper::settings()
    68 RadioSettingsIf& RadioEngineWrapper::settings()
    72 {
    69 {
    73     Q_D( RadioEngineWrapper );
    70     Q_D( RadioEngineWrapper );
   111 }
   108 }
   112 
   109 
   113 /*!
   110 /*!
   114  * Returns the frequency step size from the selected region
   111  * Returns the frequency step size from the selected region
   115  */
   112  */
   116 bool RadioEngineWrapper::isFrequencyValid( uint frequency )
   113 bool RadioEngineWrapper::isFrequencyValid( uint frequency ) const
   117 {
   114 {
   118     Q_UNUSED( frequency );
   115     Q_UNUSED( frequency );
       
   116     return frequency >= minFrequency() && frequency <= maxFrequency() && frequency % frequencyStepSize() == 0;
       
   117 }
       
   118 
       
   119 /*!
       
   120  * Checks if the radio engine is on
       
   121  */
       
   122 bool RadioEngineWrapper::isRadioOn() const
       
   123 {
   119     return true;
   124     return true;
   120 }
   125 }
   121 
   126 
   122 /*!
   127 /*!
   123  * Checks if the radio engine is on
       
   124  */
       
   125 bool RadioEngineWrapper::isRadioOn() const
       
   126 {
       
   127     return true;
       
   128 }
       
   129 
       
   130 /*!
       
   131  * Returns the currently tuned frequency
   128  * Returns the currently tuned frequency
   132  */
   129  */
   133 uint RadioEngineWrapper::currentFrequency() const
   130 uint RadioEngineWrapper::currentFrequency() const
   134 {
   131 {
   135     Q_D( const RadioEngineWrapper );
   132     Q_D( const RadioEngineWrapper );
   161     Q_D( const RadioEngineWrapper );
   158     Q_D( const RadioEngineWrapper );
   162     return d->mUseLoudspeaker;
   159     return d->mUseLoudspeaker;
   163 }
   160 }
   164 
   161 
   165 /*!
   162 /*!
       
   163  * Sets or unsets the engine to manual seek mode
       
   164  */
       
   165 void RadioEngineWrapper::setManualSeekMode( bool manualSeek )
       
   166 {
       
   167     Q_D( RadioEngineWrapper );
       
   168     d->mManualSeekMode = manualSeek;
       
   169     if ( !manualSeek ) {
       
   170         RUN_NOTIFY_LOOP( d->mObservers, tunedToFrequency( d->mFrequency, d->mTuneReason ) );
       
   171     }
       
   172 }
       
   173 
       
   174 /*!
       
   175  * Checks if the engine is in manual seek mode
       
   176  */
       
   177 bool RadioEngineWrapper::isInManualSeekMode() const
       
   178 {
       
   179     Q_D( const RadioEngineWrapper );
       
   180     return d->mManualSeekMode;
       
   181 }
       
   182 
       
   183 /*!
       
   184  *
       
   185  */
       
   186 void RadioEngineWrapper::setRdsEnabled( bool rdsEnabled )
       
   187 {
       
   188     Q_UNUSED( rdsEnabled );
       
   189 }
       
   190 
       
   191 /*!
   166  * Tunes to the given frequency
   192  * Tunes to the given frequency
   167  */
   193  */
   168 void RadioEngineWrapper::tuneFrequency( uint frequency, const int sender )
   194 void RadioEngineWrapper::setFrequency( uint frequency, const int reason )
   169 {
   195 {
   170     Q_D( RadioEngineWrapper );
   196     Q_D( RadioEngineWrapper );
   171     d->tuneFrequency( frequency, sender );
   197     d->setFrequency( frequency, reason );
   172 }
   198 }
   173 
   199 
   174 /*!
   200 /*!
   175  * Tunes to the given frequency after a delay
   201  *
   176  */
   202  */
   177 void RadioEngineWrapper::tuneWithDelay( uint frequency, const int sender )
   203 void RadioEngineWrapper::increaseVolume()
   178 {
   204 {
   179     Q_D( RadioEngineWrapper );
   205 }
   180     d->tuneWithDelay( frequency, sender );
   206 
       
   207 /*!
       
   208  *
       
   209  */
       
   210 void RadioEngineWrapper::decreaseVolume()
       
   211 {
   181 }
   212 }
   182 
   213 
   183 /*!
   214 /*!
   184  * volume update command for the engine
   215  * volume update command for the engine
   185  */
   216  */
   190 }
   221 }
   191 
   222 
   192 /*!
   223 /*!
   193  *
   224  *
   194  */
   225  */
   195 void RadioEngineWrapper::setMute( bool muted )
   226 void RadioEngineWrapper::setMute( bool muted, bool updateSettings )
   196 {
   227 {
       
   228     Q_UNUSED( muted );
       
   229     Q_UNUSED( updateSettings );
   197 }
   230 }
   198 
   231 
   199 /*!
   232 /*!
   200  *
   233  *
   201  */
   234  */
   206 }
   239 }
   207 
   240 
   208 /*!
   241 /*!
   209  *
   242  *
   210  */
   243  */
   211 void RadioEngineWrapper::startSeeking( Seeking::Direction direction, const int reason )
   244 void RadioEngineWrapper::startSeeking( Seek::Direction direction, const int reason )
   212 {
   245 {
   213     Q_D( RadioEngineWrapper );
   246     Q_D( RadioEngineWrapper );
   214     d->startSeeking( direction, reason );
   247     d->startSeeking( direction, reason );
   215 }
   248 }
   216 
   249