kradio4  r778
frequencyseekhelper.h
Go to the documentation of this file.
1 /***************************************************************************
2  frequencyseekhelper.h - description
3  -------------------
4  begin : Fre Mai 9 2003
5  copyright : (C) 2003 by Martin Witte
6  email : emw-kradio@nocabal.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef KRADIO_FREQUENCY_SEEKHELPER_H
19 #define KRADIO_FREQUENCY_SEEKHELPER_H
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <QtCore/QObject>
26 #include <QtCore/QTimer>
27 //#include "radiodevice_interfaces.h"
28 #include "frequencyradio_interfaces.h"
29 #include "seekhelper.h"
30 #include <kdemacros.h>
31 
32 class KDE_EXPORT FrequencySeekHelper : public QObject,
33  public SeekHelper,
34  public IFrequencyRadioClient
35 {
36 Q_OBJECT
37 public:
38 
39  FrequencySeekHelper(ISeekRadio &parent);
40  virtual ~FrequencySeekHelper();
41 
42 // IFrequencyRadioClient
43 RECEIVERS:
44  bool noticeFrequencyChanged(float /*f*/, const FrequencyRadioStation */*s*/) { return false; }
45  bool noticeMinMaxFrequencyChanged(float /*min*/, float /*max*/) { return false; }
46  bool noticeDeviceMinMaxFrequencyChanged(float /*min*/, float /*max*/){ return false; }
47  bool noticeScanStepChanged(float /*s*/) { return false; }
48 
49 public:
50 
51  virtual bool connectI (Interface *i);
52  virtual bool disconnectI(Interface *i);
53 
54  virtual void start(const SoundStreamID &, direction_t dir);
55 
56 public slots:
57 
58  virtual void step() { SeekHelper::step(); }
59 
60 protected:
61  virtual void abort();
62  virtual bool isGood() const;
63  virtual bool isBetter() const;
64  virtual bool isWorse() const;
65  virtual bool bestFound() const;
66  virtual void getData();
67  virtual void rememberBest();
68  virtual bool nextSeekStep();
69  virtual void applyBest();
70 
71 protected:
72  QTimer *m_timer;
73 
74  float m_currentSignal, m_oldSignal;
76  float m_currentFrequency, m_oldFrequency;
78 };
79 
80 #endif
virtual bool isBetter() const =0
virtual bool nextSeekStep()=0
virtual bool isGood() const =0
virtual void abort()=0
bool noticeDeviceMinMaxFrequencyChanged(float, float)
virtual bool isWorse() const =0
virtual bool disconnectI(Interface *i)
virtual bool bestFound() const =0
virtual void rememberBest()=0
virtual void applyBest()=0
virtual void step()
RECEIVERS const FrequencyRadioStation *bool noticeMinMaxFrequencyChanged(float, float)
virtual void getData()=0
virtual bool connectI(Interface *i)
bool noticeScanStepChanged(float)
virtual void start(const SoundStreamID &id, direction_t dir)