26 #include "radioenginewrapperobserver.h" |
26 #include "radioenginewrapperobserver.h" |
27 |
27 |
28 // Forward declarations |
28 // Forward declarations |
29 class RadioUiEnginePrivate; |
29 class RadioUiEnginePrivate; |
30 class RadioStation; |
30 class RadioStation; |
|
31 class QTimer; |
31 |
32 |
32 class RadioMonitorService : public XQServiceProvider |
33 class RadioMonitorService : public XQServiceProvider |
33 , public RadioEngineWrapperObserver |
34 , public RadioEngineWrapperObserver |
34 { |
35 { |
35 Q_OBJECT |
36 Q_OBJECT |
39 RadioMonitorService( RadioUiEnginePrivate& engine ); |
40 RadioMonitorService( RadioUiEnginePrivate& engine ); |
40 virtual ~RadioMonitorService(); |
41 virtual ~RadioMonitorService(); |
41 |
42 |
42 void init(); |
43 void init(); |
43 |
44 |
44 void notifySong( const QString& song ); |
|
45 |
|
46 public slots: |
45 public slots: |
47 |
46 |
48 void requestNotifications(); // Slot called by Qt Highway |
47 void requestNotifications(); // Slot called by Qt Highway |
49 void requestAllData(); // Slot called by Qt Highway |
48 void requestAllData(); // Slot called by Qt Highway |
50 |
49 |
51 private slots: |
50 private slots: |
52 |
51 |
53 void notifyRadioStatus(); |
52 void notifyRadioStatus(); |
54 void notifyFavoriteCount(); |
53 void notifyFavoriteCount(); |
55 void notifyStationChange( const RadioStation& station ); |
54 void notifyStationChange( const RadioStation& station ); |
|
55 void sendNotifications(); |
56 |
56 |
57 private: |
57 private: |
58 |
58 |
59 // from base class RadioEngineWrapperObserver |
59 // from base class RadioEngineWrapperObserver |
60 |
60 |
61 void tunedToFrequency( uint frequency, int reason ); |
61 void tunedToFrequency( uint frequency, int reason ); |
62 |
62 |
63 // New functions |
63 // New functions |
64 |
64 |
65 RadioStatus::Status determineRadioStatus() const; |
65 RadioStatus::Status determineRadioStatus() const; |
|
66 |
|
67 void checkIfCurrentStationIsFavorite(); |
|
68 |
|
69 QString trimHtmlTags( const QString& html ); |
|
70 |
66 void notify( const QVariant& notification ); |
71 void notify( const QVariant& notification ); |
67 void notifyList( const QVariantList& list ); |
72 void notifyList( const QVariantList& list ); |
68 |
73 |
69 private: // data |
74 private: // data |
70 |
75 |
71 RadioUiEnginePrivate& mUiEngine; |
76 RadioUiEnginePrivate& mUiEngine; |
72 |
77 |
73 QList<int> mRequestIndexes; |
78 QList<int> mRequestIndexes; |
74 |
79 |
75 RadioStatus::Status mRadioStatus; |
80 RadioStatus::Status mRadioStatus; |
|
81 |
|
82 QVariantList mNotificationList; |
|
83 |
|
84 QTimer* mNotificationTimer; |
76 |
85 |
77 }; |
86 }; |
78 |
87 |
79 #endif // RADIOMONITORSERVICE_H |
88 #endif // RADIOMONITORSERVICE_H |