radioapp/radioenginewrapper/inc/radioenginewrapper_win32_p.h
changeset 16 f54ebcfc1b80
parent 14 63aabac4416d
child 19 afea38384506
--- a/radioapp/radioenginewrapper/inc/radioenginewrapper_win32_p.h	Fri Apr 16 14:58:55 2010 +0300
+++ b/radioapp/radioenginewrapper/inc/radioenginewrapper_win32_p.h	Mon May 03 12:31:41 2010 +0300
@@ -36,6 +36,13 @@
 class QSettings;
 class QTimer;
 
+typedef QList<RadioEngineWrapperObserver*> ObserverList;
+
+#define RUN_NOTIFY_LOOP( list, func ) \
+        foreach( RadioEngineWrapperObserver* observer, list ) { \
+            observer->func; \
+        }
+
 // Class declaration
 class WRAPPER_DLL_EXPORT RadioEngineWrapperPrivate : public QObject
 {
@@ -48,8 +55,7 @@
 public:
 
     RadioEngineWrapperPrivate( RadioEngineWrapper* wrapper,
-                               RadioStationHandlerIf& stationHandler,
-                               RadioEngineWrapperObserver& observer );
+                               RadioStationHandlerIf& stationHandler );
 
     ~RadioEngineWrapperPrivate();
 
@@ -69,12 +75,15 @@
     /**
      * Functions called from slots to tune to given frequency or preset
      */
-    void tuneFrequency( uint frequency, const int sender );
-    void tuneWithDelay( uint frequency, const int sender );
+    void tuneFrequency( uint frequency, const int reason );
+    void tuneWithDelay( uint frequency, const int reason );
+
+    ObserverList& observers();
 
-    RadioEngineWrapperObserver& observer();
+    void startSeeking( Seeking::Direction direction, const int reason );
+    void cancelSeeking();
 
-    void startSeeking( Seeking::Direction direction );
+    void toggleAudioRoute();
 
 // Functions used by the win32 test window
 
@@ -100,11 +109,6 @@
 
 // New functions
 
-    /**
-     * Called by RadioFrequencyScanningHandler when the scanning has finished
-     */
-    void frequencyScannerFinished();
-
     void parseData();
 
 private: // data
@@ -124,7 +128,7 @@
     /**
      * Reference to the wrapper observer
      */
-    RadioEngineWrapperObserver&                     mObserver;
+    ObserverList                                    mObservers;
 
     /**
      * Radio settings handler
@@ -145,20 +149,15 @@
     QString                                         mParsingError;
 
     /**
-     * Id of the sender of the last tune command. RadioFrequencyStrip or someone else
+     * Reason for the tune event. RadioFrequencyStrip or someone else
      */
-    int                                             mCommandSender;
+    int                                             mTuneReason;
 
     /**
      * Flag to indicate whether or not audio should be routed to loudspeaker
      */
     bool                                            mUseLoudspeaker;
 
-    /**
-     * Flag to indicate whether or not the engine is seeking
-     */
-    bool                                            mIsSeeking;
-
     QScopedPointer<QSettings>                       mEngineSettings;
 
     bool                                            mAntennaAttached;