frequencyseekhelper.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KRADIO_FREQUENCY_SEEKHELPER_H
00019 #define KRADIO_FREQUENCY_SEEKHELPER_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <QtCore/QObject>
00026 #include <QtCore/QTimer>
00027
00028 #include "frequencyradio_interfaces.h"
00029 #include "seekhelper.h"
00030 #include <kdemacros.h>
00031
00032 class KDE_EXPORT FrequencySeekHelper : public QObject,
00033 public SeekHelper,
00034 public IFrequencyRadioClient
00035 {
00036 Q_OBJECT
00037 public:
00038
00039 FrequencySeekHelper(ISeekRadio &parent);
00040 virtual ~FrequencySeekHelper();
00041
00042
00043 RECEIVERS:
00044 bool noticeFrequencyChanged(float , const FrequencyRadioStation *) { return false; }
00045 bool noticeMinMaxFrequencyChanged(float , float ) { return false; }
00046 bool noticeDeviceMinMaxFrequencyChanged(float , float ){ return false; }
00047 bool noticeScanStepChanged(float ) { return false; }
00048
00049 public:
00050
00051 virtual bool connectI (Interface *i);
00052 virtual bool disconnectI(Interface *i);
00053
00054 virtual void start(const SoundStreamID &, direction_t dir);
00055
00056 public slots:
00057
00058 virtual void step() { SeekHelper::step(); }
00059
00060 protected:
00061 virtual void abort();
00062 virtual bool isGood() const;
00063 virtual bool isBetter() const;
00064 virtual bool isWorse() const;
00065 virtual bool bestFound() const;
00066 virtual void getData();
00067 virtual void rememberBest();
00068 virtual bool nextSeekStep();
00069 virtual void applyBest();
00070
00071 protected:
00072 QTimer *m_timer;
00073
00074 float m_currentSignal, m_oldSignal;
00075 bool m_goodSignal;
00076 float m_currentFrequency, m_oldFrequency;
00077 float m_bestFrequency;
00078 };
00079
00080 #endif