summaryrefslogtreecommitdiffstats
path: root/src/include/seekhelper.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-05-30 19:40:31 +0900
committerSlávek Banko <slavek.banko@axis.cz>2022-05-30 21:55:12 +0200
commit9d7329284fd42187092c829ae6ed030561002776 (patch)
tree1d53503d17938eca725caee7ff783fccf52ca509 /src/include/seekhelper.h
parentfac82f62f156c76cb4b23c313111283b30a778b5 (diff)
downloadtderadio-9d732928.tar.gz
tderadio-9d732928.zip
Standardize folder structure.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit d95a4fea540b371fa86493d069fdbd54f33c5b40)
Diffstat (limited to 'src/include/seekhelper.h')
-rw-r--r--src/include/seekhelper.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/include/seekhelper.h b/src/include/seekhelper.h
new file mode 100644
index 0000000..f61ad9d
--- /dev/null
+++ b/src/include/seekhelper.h
@@ -0,0 +1,83 @@
+/***************************************************************************
+ seekhelper.h - description
+ -------------------
+ begin : Sam Mai 10 2003
+ copyright : (C) 2003 by Martin Witte
+ email : witte@kawo1.rwth-aachen.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KRADIO_SEEKHELPER_H
+#define KRADIO_SEEKHELPER_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "radiodevice_interfaces.h"
+#include "soundstreamclient_interfaces.h"
+
+
+class SeekHelper : public IRadioDeviceClient,
+ public ISoundStreamClient
+{
+public:
+ typedef enum { off, searchWorse, searchBest } state_t;
+ typedef enum { up, down } direction_t;
+
+ SeekHelper(ISeekRadio &parent);
+ virtual ~SeekHelper();
+
+ virtual bool connectI (Interface *i);
+ virtual bool disconnectI(Interface *i);
+
+ virtual void start(const SoundStreamID &id, direction_t dir);
+ virtual void step();
+ virtual void stop();
+
+ bool isRunning() const { return m_state != off; }
+ bool isRunningUp() const { return m_state != off && m_direction == up; }
+ bool isRunningDown() const { return m_state != off && m_direction == down; }
+
+
+// IRadioDeviceClient
+RECEIVERS:
+ bool noticePowerChanged (bool /*on*/, const IRadioDevice */*sender*/) { return false; }
+ bool noticeStationChanged (const RadioStation &, const IRadioDevice */*sender*/) { return false; }
+ bool noticeDescriptionChanged (const TQString &, const IRadioDevice */*sender*/) { return false; }
+
+ bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/, const IRadioDevice */*sender*/) { return false; }
+
+protected:
+
+ virtual void finish();
+
+ virtual void abort() = 0;
+ virtual bool isGood() const = 0;
+ virtual bool isBetter() const = 0;
+ virtual bool isWorse() const = 0;
+ virtual bool bestFound() const = 0;
+ virtual void getData() = 0;
+ virtual void rememberBest() = 0;
+ virtual bool nextSeekStep() = 0;
+ virtual void applyBest() = 0;
+
+protected:
+ state_t m_state;
+ direction_t m_direction;
+ bool m_oldMute;
+
+ ISeekRadio &m_parent;
+ SoundStreamID m_SoundStreamID;
+};
+
+#endif
+