31 class RadioEngineWrapperObserver; |
32 class RadioEngineWrapperObserver; |
32 |
33 |
33 // Class declaration |
34 // Class declaration |
34 class WRAPPER_DLL_EXPORT RadioEngineWrapper |
35 class WRAPPER_DLL_EXPORT RadioEngineWrapper |
35 { |
36 { |
36 Q_DECLARE_PRIVATE_D( d_ptr, RadioEngineWrapper ) |
37 Q_DECLARE_PRIVATE_D( d_ptr.data(), RadioEngineWrapper ) |
37 Q_DISABLE_COPY( RadioEngineWrapper ) |
38 Q_DISABLE_COPY( RadioEngineWrapper ) |
38 |
39 |
39 public: |
40 public: |
40 |
41 |
41 /** |
42 /** |
42 * Constructor and destructor |
43 * Constructor and destructor |
43 */ |
44 */ |
44 RadioEngineWrapper( RadioStationHandlerIf& stationHandler ); |
45 RadioEngineWrapper( RadioStationHandlerIf& stationHandler ); |
45 ~RadioEngineWrapper(); |
46 ~RadioEngineWrapper(); |
46 |
47 |
|
48 bool init(); |
|
49 |
47 void addObserver( RadioEngineWrapperObserver* observer ); |
50 void addObserver( RadioEngineWrapperObserver* observer ); |
48 void removeObserver( RadioEngineWrapperObserver* observer ); |
51 void removeObserver( RadioEngineWrapperObserver* observer ); |
49 |
|
50 /** |
|
51 * Checks if the radio engine has been constructed properly |
|
52 */ |
|
53 bool isEngineConstructed(); |
|
54 |
52 |
55 /** |
53 /** |
56 * Getters for things owned by the engine |
54 * Getters for things owned by the engine |
57 */ |
55 */ |
58 RadioSettingsIf& settings(); |
56 RadioSettingsIf& settings(); |
62 */ |
60 */ |
63 RadioRegion::Region region() const; |
61 RadioRegion::Region region() const; |
64 uint minFrequency() const; |
62 uint minFrequency() const; |
65 uint maxFrequency() const; |
63 uint maxFrequency() const; |
66 uint frequencyStepSize() const; |
64 uint frequencyStepSize() const; |
67 bool isFrequencyValid( uint frequency ); |
65 bool isFrequencyValid( uint frequency ) const; |
68 |
66 |
69 /** |
67 /** |
70 * Getters for current radio status |
68 * Getters for current radio status |
71 */ |
69 */ |
72 bool isRadioOn() const; |
70 bool isRadioOn() const; |
73 uint currentFrequency() const; |
71 uint currentFrequency() const; |
74 bool isMuted() const; |
72 bool isMuted() const; |
75 bool isAntennaAttached() const; |
73 bool isAntennaAttached() const; |
76 bool isUsingLoudspeaker() const; |
74 bool isUsingLoudspeaker() const; |
77 |
75 |
|
76 void setManualSeekMode( bool manualSeek ); |
|
77 bool isInManualSeekMode() const; |
|
78 |
|
79 void setRdsEnabled( bool rdsEnabled ); |
|
80 |
78 /** |
81 /** |
79 * Functions to tune to given frequency or preset |
82 * Tunes to the given frequency |
80 */ |
83 */ |
81 void tuneFrequency( uint frequency, const int reason = TuneReason::Unspecified ); |
84 void setFrequency( uint frequency, const int reason = TuneReason::Unspecified ); |
82 void tuneWithDelay( uint frequency, const int reason = TuneReason::Unspecified ); |
|
83 |
85 |
84 /*! |
86 /*! |
85 * Audio update command functions for the engine |
87 * Audio update command functions for the engine |
86 */ |
88 */ |
|
89 void increaseVolume(); |
|
90 void decreaseVolume(); |
87 void setVolume( int volume ); |
91 void setVolume( int volume ); |
88 void setMute( bool muted ); |
92 void setMute( bool muted, bool updateSettings = true ); |
89 void toggleAudioRoute(); |
93 void toggleAudioRoute(); |
90 |
94 |
91 void startSeeking( Seeking::Direction direction, const int reason = TuneReason::Unspecified ); |
95 void startSeeking( Seek::Direction direction, const int reason = TuneReason::Unspecified ); |
92 void cancelSeeking(); |
96 void cancelSeeking(); |
93 |
97 |
94 private: // data |
98 private: // data |
95 |
99 |
96 /** |
100 /** |
97 * Unmodifiable pointer to the private implementation |
101 * Unmodifiable pointer to the private implementation |
98 */ |
102 */ |
99 RadioEngineWrapperPrivate* const d_ptr; |
103 const QScopedPointer<RadioEngineWrapperPrivate> d_ptr; |
100 |
104 |
101 }; |
105 }; |
102 |
106 |
103 #endif // RADIOENGINEWRAPPER_H |
107 #endif // RADIOENGINEWRAPPER_H |