summaryrefslogtreecommitdiffstats
path: root/kradio3/plugins/gui-standard-display
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 18:23:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 18:23:26 +0000
commitae364d9bed0589bf1a22cd5f530c563462379e3e (patch)
treee32727e2664e7ce68d0d30270afa040320ae35a1 /kradio3/plugins/gui-standard-display
downloadtderadio-ae364d9bed0589bf1a22cd5f530c563462379e3e.tar.gz
tderadio-ae364d9bed0589bf1a22cd5f530c563462379e3e.zip
Added old KDE3 version of kradio
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1094417 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/gui-standard-display')
-rw-r--r--kradio3/plugins/gui-standard-display/Makefile.am22
-rw-r--r--kradio3/plugins/gui-standard-display/displaycfg.cpp145
-rw-r--r--kradio3/plugins/gui-standard-display/displaycfg.h72
-rw-r--r--kradio3/plugins/gui-standard-display/displaycfg_interfaces.cpp69
-rw-r--r--kradio3/plugins/gui-standard-display/displaycfg_interfaces.h82
-rw-r--r--kradio3/plugins/gui-standard-display/po/Makefile.am2
-rw-r--r--kradio3/plugins/gui-standard-display/po/de.po212
-rw-r--r--kradio3/plugins/gui-standard-display/po/ru.po213
-rw-r--r--kradio3/plugins/gui-standard-display/radioview-configuration.cpp116
-rw-r--r--kradio3/plugins/gui-standard-display/radioview-configuration.h61
-rw-r--r--kradio3/plugins/gui-standard-display/radioview.cpp807
-rw-r--r--kradio3/plugins/gui-standard-display/radioview.h207
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_element.cpp34
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_element.h66
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp443
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_frequencyradio.h108
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_frequencyseeker.cpp250
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_frequencyseeker.h78
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_seekinterface.ui167
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_seekinterface.ui.h21
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_volume.cpp141
-rw-r--r--kradio3/plugins/gui-standard-display/radioview_volume.h75
22 files changed, 3391 insertions, 0 deletions
diff --git a/kradio3/plugins/gui-standard-display/Makefile.am b/kradio3/plugins/gui-standard-display/Makefile.am
new file mode 100644
index 0000000..a7e7544
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/Makefile.am
@@ -0,0 +1,22 @@
+SUBDIRS = po .
+
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+libkradio_LTLIBRARIES = libstandard-display.la
+libstandard_display_la_SOURCES = displaycfg.cpp displaycfg_interfaces.cpp \
+ radioview-configuration.cpp radioview.cpp \
+ radioview_element.cpp \
+ radioview_frequencyradio.cpp \
+ radioview_frequencyseeker.cpp \
+ radioview_volume.cpp
+libstandard_display_la_LDFLAGS = -module -avoid-version $(KDE_RPATH) $(all_libraries)
+
+noinst_HEADERS = displaycfg.h displaycfg_interfaces.h radioview-configuration.h radioview_element.h radioview_frequencyradio.h radioview_frequencyseeker.h radioview.h radioview_volume.h
+
+#messages: rc.cpp
+# $(XGETTEXT) *.cpp *.h -o po/kradio-gui-standard-display.pot
+
+messages: rc.cpp
+ $(EXTRACTRC) *.rc *.ui >> rc.cpp
+ $(XGETTEXT) rc.cpp *.h *.cpp -o po/kradio-gui-standard-display.pot
diff --git a/kradio3/plugins/gui-standard-display/displaycfg.cpp b/kradio3/plugins/gui-standard-display/displaycfg.cpp
new file mode 100644
index 0000000..8e26e72
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/displaycfg.cpp
@@ -0,0 +1,145 @@
+/***************************************************************************
+ displaycfg.cpp - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "displaycfg.h"
+#include <kcolorbutton.h>
+#include <kcolordialog.h>
+#include <kfontdialog.h>
+
+#include <qlayout.h>
+#include <klocale.h>
+#include <qlabel.h>
+#include <qbuttongroup.h>
+
+DisplayConfiguration::DisplayConfiguration(QWidget *parent)
+ : QWidget (parent),
+ m_dirty(true),
+ m_ignore_gui_updates(false)
+{
+ QGroupBox *bg = new QGroupBox(i18n("Display Colors"), this);
+ bg->setColumnLayout(0, Qt::Vertical );
+ bg->layout()->setSpacing( 8 );
+ bg->layout()->setMargin( 12 );
+ QGridLayout *gl = new QGridLayout (bg->layout());
+
+ m_btnActive = new KColorButton(queryDisplayActiveColor(), bg);
+ m_btnInactive = new KColorButton(queryDisplayInactiveColor(), bg);
+ m_btnBkgnd = new KColorButton(queryDisplayBkgndColor(), bg);
+
+ connect(m_btnActive, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+ connect(m_btnInactive, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+ connect(m_btnBkgnd, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+
+ QLabel *l1 = new QLabel(i18n("Active Text"), bg);
+ QLabel *l2 = new QLabel(i18n("Inactive Text"), bg);
+ QLabel *l3 = new QLabel(i18n("Background Color"), bg);
+
+ l1->setAlignment(QLabel::AlignCenter);
+ l2->setAlignment(QLabel::AlignCenter);
+ l3->setAlignment(QLabel::AlignCenter);
+
+ l1->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ l2->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ l3->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ m_btnActive ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+ m_btnInactive->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+ m_btnBkgnd ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+
+ m_btnActive ->setMinimumSize(QSize(40, 40));
+ m_btnInactive->setMinimumSize(QSize(40, 40));
+ m_btnBkgnd ->setMinimumSize(QSize(40, 40));
+
+ gl->addWidget (l1, 0, 0, Qt::AlignCenter);
+ gl->addWidget (l2, 0, 1, Qt::AlignCenter);
+ gl->addWidget (l3, 0, 2, Qt::AlignCenter);
+ gl->addWidget (m_btnActive, 1, 0);
+ gl->addWidget (m_btnInactive, 1, 1);
+ gl->addWidget (m_btnBkgnd, 1, 2);
+
+ m_fontChooser = new KFontChooser(this, NULL, false, QStringList(), true, 4);
+ m_fontChooser->setFont(queryDisplayFont());
+ m_fontChooser->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+
+ QVBoxLayout *l = new QVBoxLayout(this, 10);
+ l->addWidget(bg);
+ l->addWidget(m_fontChooser);
+
+ connect(m_btnActive, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+ connect(m_btnInactive, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+ connect(m_btnBkgnd, SIGNAL(changed(const QColor &)), this, SLOT(slotSetDirty()));
+ connect(m_fontChooser, SIGNAL(fontSelected(const QFont &)), this, SLOT(slotSetDirty()));
+
+}
+
+
+DisplayConfiguration::~DisplayConfiguration()
+{
+}
+
+
+bool DisplayConfiguration::noticeDisplayColorsChanged(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd)
+{
+ m_ignore_gui_updates = true;
+ m_btnActive->setColor(activeColor);
+ m_btnInactive->setColor(inactiveColor);
+ m_btnBkgnd->setColor(bkgnd);
+ m_ignore_gui_updates = false;
+ return true;
+}
+
+
+bool DisplayConfiguration::noticeDisplayFontChanged(const QFont &f)
+{
+ m_ignore_gui_updates = true;
+ m_fontChooser->setFont(f);
+ m_ignore_gui_updates = false;
+ return true;
+}
+
+
+void DisplayConfiguration::slotOK()
+{
+ if (m_dirty) {
+ sendDisplayColors(m_btnActive->color(), m_btnInactive->color(), m_btnBkgnd->color());
+ sendDisplayFont(m_fontChooser->font());
+ m_dirty = false;
+ }
+}
+
+void DisplayConfiguration::slotCancel()
+{
+ if (m_dirty) {
+ m_ignore_gui_updates = true;
+ m_btnActive ->setColor(queryDisplayActiveColor());
+ m_btnInactive->setColor(queryDisplayInactiveColor());
+ m_btnBkgnd ->setColor(queryDisplayBkgndColor());
+ m_fontChooser->setFont(queryDisplayFont());
+ m_dirty = false;
+ m_ignore_gui_updates = false;
+ }
+}
+
+void DisplayConfiguration::slotSetDirty()
+{
+ if (!m_dirty && !m_ignore_gui_updates) {
+ m_dirty = true;
+ emit sigDirty();
+ }
+}
+
+
+#include "displaycfg.moc"
diff --git a/kradio3/plugins/gui-standard-display/displaycfg.h b/kradio3/plugins/gui-standard-display/displaycfg.h
new file mode 100644
index 0000000..fcd6079
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/displaycfg.h
@@ -0,0 +1,72 @@
+/***************************************************************************
+ displaycfg.h - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_DISPLAYCFG_H
+#define KRADIO_DISPLAYCFG_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "displaycfg_interfaces.h"
+#include <qwidget.h>
+
+class KColorButton;
+class KFontChooser;
+
+class DisplayConfiguration : public QWidget,
+ public IDisplayCfgClient
+{
+Q_OBJECT
+public:
+ DisplayConfiguration(QWidget *parent);
+ ~DisplayConfiguration();
+
+// Interface
+
+ bool connectI (Interface *i) { return IDisplayCfgClient::connectI(i); }
+ bool disconnectI (Interface *i) { return IDisplayCfgClient::disconnectI(i); }
+
+// IDisplayCfgClient
+
+RECEIVERS:
+ bool noticeDisplayColorsChanged(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd);
+ bool noticeDisplayFontChanged(const QFont &f);
+
+
+public slots:
+
+ void slotOK();
+ void slotCancel();
+ void slotSetDirty();
+
+signals:
+
+ void sigDirty();
+
+protected:
+ KColorButton *m_btnActive;
+ KColorButton *m_btnInactive;
+ KColorButton *m_btnBkgnd;
+ KFontChooser *m_fontChooser;
+
+ bool m_dirty;
+ bool m_ignore_gui_updates;
+};
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/displaycfg_interfaces.cpp b/kradio3/plugins/gui-standard-display/displaycfg_interfaces.cpp
new file mode 100644
index 0000000..a7bbf01
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/displaycfg_interfaces.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ displaycfg_interfaces.cpp - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "displaycfg_interfaces.h"
+
+// IDisplayCfg
+
+IF_IMPL_SENDER ( IDisplayCfg::notifyDisplayColorsChanged(const QColor &a, const QColor &b, const QColor &c),
+ noticeDisplayColorsChanged(a,b, c) )
+
+IF_IMPL_SENDER ( IDisplayCfg::notifyDisplayFontChanged(const QFont &f),
+ noticeDisplayFontChanged(f) )
+
+// IDisplayCfgClient
+
+IF_IMPL_SENDER ( IDisplayCfgClient::sendDisplayColors(const QColor &a, const QColor &b, const QColor &c),
+ setDisplayColors(a,b, c) )
+
+IF_IMPL_SENDER ( IDisplayCfgClient::sendDisplayFont(const QFont &f),
+ setDisplayFont(f) )
+
+const QColor default_display_active_color = QColor(20, 244, 20);
+IF_IMPL_QUERY ( const QColor &IDisplayCfgClient::queryDisplayActiveColor(),
+ getDisplayActiveColor(),
+ default_display_active_color )
+
+const QColor default_display_inactive_color = QColor(10, 117, 10).light(75);
+IF_IMPL_QUERY ( const QColor &IDisplayCfgClient::queryDisplayInactiveColor(),
+ getDisplayInactiveColor(),
+ default_display_inactive_color )
+
+const QColor default_display_bkgnd_color = QColor(10, 117, 10);
+IF_IMPL_QUERY ( const QColor &IDisplayCfgClient::queryDisplayBkgndColor(),
+ getDisplayBkgndColor(),
+ default_display_bkgnd_color )
+
+const QFont default_display_font = QFont("Helvetica");
+IF_IMPL_QUERY ( const QFont &IDisplayCfgClient::queryDisplayFont(),
+ getDisplayFont(),
+ default_display_font )
+
+
+void IDisplayCfgClient::noticeConnectedI (cmplInterface *, bool /*pointer_valid*/)
+{
+ noticeDisplayColorsChanged(queryDisplayActiveColor(), queryDisplayInactiveColor(), queryDisplayBkgndColor());
+ noticeDisplayFontChanged(queryDisplayFont());
+}
+
+
+void IDisplayCfgClient::noticeDisconnectedI (cmplInterface *, bool /*pointer_valid*/)
+{
+ noticeDisplayColorsChanged(queryDisplayActiveColor(), queryDisplayInactiveColor(), queryDisplayBkgndColor());
+ noticeDisplayFontChanged(queryDisplayFont());
+}
+
diff --git a/kradio3/plugins/gui-standard-display/displaycfg_interfaces.h b/kradio3/plugins/gui-standard-display/displaycfg_interfaces.h
new file mode 100644
index 0000000..ac2ef5d
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/displaycfg_interfaces.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ displaycfg_interfaces.h - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_DISPLAYCFG_INTERFACES_H
+#define KRADIO_DISPLAYCFG_INTERFACES_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "../../src/include/interfaces.h"
+
+#include <qfont.h>
+#include <qcolor.h>
+
+///////////////////////////////////////////////////////////////////////
+
+
+INTERFACE(IDisplayCfg, IDisplayCfgClient)
+{
+public :
+ IF_CON_DESTRUCTOR(IDisplayCfg, -1)
+
+RECEIVERS:
+ IF_RECEIVER( setDisplayColors(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd) )
+ IF_RECEIVER( setDisplayFont (const QFont &f) )
+
+SENDERS:
+ IF_SENDER ( notifyDisplayColorsChanged(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd) )
+ IF_SENDER ( notifyDisplayFontChanged(const QFont &f) )
+
+ANSWERS:
+ IF_ANSWER ( const QColor &getDisplayActiveColor() const )
+ IF_ANSWER ( const QColor &getDisplayInactiveColor() const )
+ IF_ANSWER ( const QColor &getDisplayBkgndColor() const )
+ IF_ANSWER ( const QFont &getDisplayFont() const )
+
+};
+
+
+INTERFACE(IDisplayCfgClient, IDisplayCfg)
+{
+friend class IDisplayCfg;
+
+public :
+ IF_CON_DESTRUCTOR(IDisplayCfgClient, 1)
+
+SENDERS:
+ IF_SENDER ( sendDisplayColors(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd) )
+ IF_SENDER ( sendDisplayFont (const QFont &f) )
+
+RECEIVERS:
+ IF_RECEIVER( noticeDisplayColorsChanged(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd) )
+ IF_RECEIVER( noticeDisplayFontChanged(const QFont &f) )
+
+QUERIES:
+ IF_QUERY ( const QColor &queryDisplayActiveColor() )
+ IF_QUERY ( const QColor &queryDisplayInactiveColor() )
+ IF_QUERY ( const QColor &queryDisplayBkgndColor() )
+ IF_QUERY ( const QFont &queryDisplayFont() )
+
+RECEIVERS:
+ virtual void noticeConnectedI (cmplInterface *, bool pointer_valid);
+ virtual void noticeDisconnectedI (cmplInterface *, bool pointer_valid);
+};
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/po/Makefile.am b/kradio3/plugins/gui-standard-display/po/Makefile.am
new file mode 100644
index 0000000..956ae72
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/po/Makefile.am
@@ -0,0 +1,2 @@
+PACKAGE = kradio-gui-standard-display
+POFILES = AUTO
diff --git a/kradio3/plugins/gui-standard-display/po/de.po b/kradio3/plugins/gui-standard-display/po/de.po
new file mode 100644
index 0000000..5013f29
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/po/de.po
@@ -0,0 +1,212 @@
+# translation of kradio-gui-standard-display.po to
+# This file is put in the public domain.
+#
+# Ernst Martin Witte <[email protected]>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: kradio-gui-standard-display\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-11-06 01:24+0100\n"
+"PO-Revision-Date: 2006-11-06 01:23+0100\n"
+"Last-Translator: Ernst Martin Witte <[email protected]>\n"
+"Language-Team: <[email protected]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. i18n: file radioview_seekinterface.ui line 17
+#: rc.cpp:3 rc.cpp:25
+#, no-c-format
+msgid "RadioView_SeekInterface"
+msgstr "RadioView_SeekInterface"
+
+#. i18n: file radioview_seekinterface.ui line 45
+#: rc.cpp:7 rc.cpp:29
+#, no-c-format
+msgid "search previous station"
+msgstr "Suche vorherigen Sender"
+
+#. i18n: file radioview_seekinterface.ui line 73
+#: rc.cpp:11 rc.cpp:33
+#, no-c-format
+msgid "decrease freq. by 0.05 MHz"
+msgstr "Frequenz um 0.05 MHz verringern"
+
+#. i18n: file radioview_seekinterface.ui line 108
+#: rc.cpp:14 rc.cpp:36
+#, no-c-format
+msgid "Frequency control"
+msgstr "Frequenz verändern"
+
+#. i18n: file radioview_seekinterface.ui line 129
+#: rc.cpp:18 rc.cpp:40
+#, no-c-format
+msgid "increase freq. by 0.05 MHz"
+msgstr "Frequenz um 0.05 MHz erhöhen"
+
+#. i18n: file radioview_seekinterface.ui line 146
+#: rc.cpp:22 rc.cpp:44
+#, no-c-format
+msgid "search next station"
+msgstr "Suche nächsten Sender"
+
+#: _translatorinfo.cpp:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr "Ernst Martin Witte"
+
+#: _translatorinfo.cpp:3
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+
+#: displaycfg.cpp:33
+msgid "Display Colors"
+msgstr "Farben für die Radioanzeige"
+
+#: displaycfg.cpp:47
+msgid "Active Text"
+msgstr "Aktiver Text"
+
+#: displaycfg.cpp:48
+msgid "Inactive Text"
+msgstr "Inaktiver Text"
+
+#: displaycfg.cpp:49
+msgid "Background Color"
+msgstr "Hintergrundfarbe"
+
+#: radioview.cpp:55
+msgid "Standard Display for KRadio"
+msgstr "Standardanzeige für KRadio"
+
+#: radioview.cpp:72
+msgid "Radio Display"
+msgstr "Radio-Anzeige"
+
+#: radioview.cpp:127
+msgid "Pause KRadio"
+msgstr "KRadio pausieren"
+
+#: radioview.cpp:133
+msgid "Start Recording"
+msgstr "Aufnahme starten"
+
+#: radioview.cpp:141
+msgid "5 min"
+msgstr "5 min"
+
+#: radioview.cpp:142
+msgid "10 min"
+msgstr "10 min"
+
+#: radioview.cpp:143
+msgid "15 min"
+msgstr "15 min"
+
+#: radioview.cpp:144
+msgid "30 min"
+msgstr "30 min"
+
+#: radioview.cpp:145
+msgid "60 min"
+msgstr "60 min"
+
+#: radioview.cpp:189
+msgid "Configure KRadio"
+msgstr "KRadio Einrichten"
+
+#: radioview.cpp:190
+msgid "Power On/Off"
+msgstr "Ein/Ausschalten"
+
+#: radioview.cpp:191
+msgid "Quit KRadio Application"
+msgstr "KRadio beenden"
+
+#: radioview.cpp:192
+msgid "Start/Stop Recording"
+msgstr "Aufnahme starten/beenden"
+
+#: radioview.cpp:193
+msgid "Start/Stop Sleep Countdown"
+msgstr "Schlummermodus ein/ausschalten"
+
+#: radioview.cpp:194
+msgid "Show/Hide Plugins"
+msgstr "Plugins anzeigen/verstecken"
+
+#: radioview.cpp:195
+msgid "Select a Radio Station"
+msgstr "Sender auswählen"
+
+#: radioview.cpp:332
+msgid "no preset defined"
+msgstr "kein voreingestellter Sender gefunden"
+
+#: radioview.cpp:442 radioview.cpp:480
+msgid "Stop Recording of %1"
+msgstr "Aufnahme von %1 beenden"
+
+#: radioview.cpp:553
+msgid "Display"
+msgstr "Anzeige"
+
+#: radioview.cpp:554
+msgid "Display Configuration"
+msgstr "Konfiguration der Radio-Anzeige"
+
+#: radioview.cpp:590
+msgid "set Toolbar-Flag for Display"
+msgstr "Werkzeugleisten-Flag für das Displayfenster"
+
+#: radioview.cpp:593
+msgid "Common"
+msgstr "Allgemein"
+
+#: radioview_frequencyradio.cpp:99 radioview_frequencyradio.cpp:100
+msgid "Frequency Display"
+msgstr "Frequenzanzeige"
+
+#: radioview_frequencyradio.cpp:388 radioview_frequencyradio.cpp:389
+msgid "AM"
+msgstr "MW"
+
+#: radioview_frequencyradio.cpp:394 radioview_frequencyradio.cpp:395
+msgid "FM"
+msgstr "UKW"
+
+#: radioview_frequencyradio.cpp:406
+msgid "%1 kHz"
+msgstr "%1 kHz"
+
+#: radioview_frequencyradio.cpp:408
+msgid "%1 MHz"
+msgstr "%1 MHz"
+
+#: radioview_frequencyseeker.cpp:76
+msgid "Search for previous Radio Station"
+msgstr "Suche nach vorherigem Sender"
+
+#: radioview_frequencyseeker.cpp:77
+msgid "Search for next Radio Station"
+msgstr "Suche nach nächstem Sender"
+
+#: radioview_frequencyseeker.cpp:78
+msgid "Decrement Frequency"
+msgstr "Frequenz erniedrigen"
+
+#: radioview_frequencyseeker.cpp:79
+msgid "Increment Frequency"
+msgstr "Frequenz erhöhen"
+
+#: radioview_frequencyseeker.cpp:80
+msgid "Change Frequency"
+msgstr "Frequenz verändern"
+
+#: radioview_volume.cpp:56
+msgid "Change Volume"
+msgstr "Läutstärke verändern"
diff --git a/kradio3/plugins/gui-standard-display/po/ru.po b/kradio3/plugins/gui-standard-display/po/ru.po
new file mode 100644
index 0000000..722b790
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/po/ru.po
@@ -0,0 +1,213 @@
+# translation of ru.po to
+# translation of kradio-gui-standard-display.po to
+# This file is put in the public domain.
+# Алексей Кузнецов <[email protected]>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ru\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-11-11 02:11+0100\n"
+"PO-Revision-Date: 2006-11-08 13:06+0300\n"
+"Last-Translator: Алексей Кузнецов <[email protected]>\n"
+"Language-Team: <[email protected]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.10\n"
+
+#. i18n: file radioview_seekinterface.ui line 17
+#: rc.cpp:3 rc.cpp:25
+#, no-c-format
+msgid "RadioView_SeekInterface"
+msgstr "RadioView_SeekInterface"
+
+#. i18n: file radioview_seekinterface.ui line 45
+#: rc.cpp:7 rc.cpp:29
+#, no-c-format
+msgid "search previous station"
+msgstr "Поиск предыдущей станции"
+
+#. i18n: file radioview_seekinterface.ui line 73
+#: rc.cpp:11 rc.cpp:33
+#, no-c-format
+msgid "decrease freq. by 0.05 MHz"
+msgstr "Уменьшать частоту по 0,05 МГц"
+
+#. i18n: file radioview_seekinterface.ui line 108
+#: rc.cpp:14 rc.cpp:36
+#, no-c-format
+msgid "Frequency control"
+msgstr "Управление частотой"
+
+#. i18n: file radioview_seekinterface.ui line 129
+#: rc.cpp:18 rc.cpp:40
+#, no-c-format
+msgid "increase freq. by 0.05 MHz"
+msgstr "Увеличивать частоту по 0,05 МГц"
+
+#. i18n: file radioview_seekinterface.ui line 146
+#: rc.cpp:22 rc.cpp:44
+#, no-c-format
+msgid "search next station"
+msgstr "Поиск следующей станции"
+
+#: _translatorinfo.cpp:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr "Алексей Кузнецов"
+
+#: _translatorinfo.cpp:3
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+
+#: displaycfg.cpp:33
+msgid "Display Colors"
+msgstr "Цвета"
+
+#: displaycfg.cpp:47
+msgid "Active Text"
+msgstr "Цвет активного текста"
+
+#: displaycfg.cpp:48
+msgid "Inactive Text"
+msgstr "Цвет инертного текста"
+
+#: displaycfg.cpp:49
+msgid "Background Color"
+msgstr "Цвет фона"
+
+#: radioview.cpp:55
+msgid "Standard Display for KRadio"
+msgstr "Главное окно KRadio"
+
+#: radioview.cpp:72
+msgid "Radio Display"
+msgstr "Главное окно"
+
+#: radioview.cpp:127
+msgid "Pause KRadio"
+msgstr "Приостановить"
+
+#: radioview.cpp:133
+msgid "Start Recording"
+msgstr "Начать запись"
+
+#: radioview.cpp:141
+msgid "5 min"
+msgstr "5 минут"
+
+#: radioview.cpp:142
+msgid "10 min"
+msgstr "10 минут"
+
+#: radioview.cpp:143
+msgid "15 min"
+msgstr "четверть часа"
+
+#: radioview.cpp:144
+msgid "30 min"
+msgstr "полчаса"
+
+#: radioview.cpp:145
+msgid "60 min"
+msgstr "час"
+
+#: radioview.cpp:189
+msgid "Configure KRadio"
+msgstr "Настроить KRadio"
+
+#: radioview.cpp:190
+msgid "Power On/Off"
+msgstr "Включить/выключить"
+
+#: radioview.cpp:191
+msgid "Quit KRadio Application"
+msgstr "Закрыть KRadio"
+
+#: radioview.cpp:192
+msgid "Start/Stop Recording"
+msgstr "Начать/завершить запись"
+
+#: radioview.cpp:193
+msgid "Start/Stop Sleep Countdown"
+msgstr "Включить/выключить таймер отключения"
+
+#: radioview.cpp:194
+msgid "Show/Hide Plugins"
+msgstr "Показать/скрыть"
+
+#: radioview.cpp:195
+msgid "Select a Radio Station"
+msgstr "Выбор радиостанции из списка"
+
+#: radioview.cpp:332
+msgid "no preset defined"
+msgstr "Станция не определена"
+
+#: radioview.cpp:442 radioview.cpp:480
+msgid "Stop Recording of %1"
+msgstr "Остановить запись %1"
+
+#: radioview.cpp:553
+msgid "Display"
+msgstr "Вид"
+
+#: radioview.cpp:554
+msgid "Display Configuration"
+msgstr "Настройка внешнего вида"
+
+#: radioview.cpp:590
+msgid "set Toolbar-Flag for Display"
+msgstr ""
+
+#: radioview.cpp:593
+msgid "Common"
+msgstr "Общие"
+
+#: radioview_frequencyradio.cpp:99 radioview_frequencyradio.cpp:100
+msgid "Frequency Display"
+msgstr "Отображение частоты"
+
+#: radioview_frequencyradio.cpp:388 radioview_frequencyradio.cpp:389
+msgid "AM"
+msgstr "ДВ/СВ/КВ"
+
+#: radioview_frequencyradio.cpp:394 radioview_frequencyradio.cpp:395
+msgid "FM"
+msgstr "УКВ"
+
+#: radioview_frequencyradio.cpp:406
+msgid "%1 kHz"
+msgstr "%1 кГц"
+
+#: radioview_frequencyradio.cpp:408
+msgid "%1 MHz"
+msgstr "%1 МГц"
+
+#: radioview_frequencyseeker.cpp:76
+msgid "Search for previous Radio Station"
+msgstr "Искать станцию вниз"
+
+#: radioview_frequencyseeker.cpp:77
+msgid "Search for next Radio Station"
+msgstr "Искать станцию вверх"
+
+#: radioview_frequencyseeker.cpp:78
+msgid "Decrement Frequency"
+msgstr "Уменьшить частоту"
+
+#: radioview_frequencyseeker.cpp:79
+msgid "Increment Frequency"
+msgstr "Увеличить частоту"
+
+#: radioview_frequencyseeker.cpp:80
+msgid "Change Frequency"
+msgstr "Изменить частоту"
+
+#: radioview_volume.cpp:56
+msgid "Change Volume"
+msgstr "Изменить громкость"
diff --git a/kradio3/plugins/gui-standard-display/radioview-configuration.cpp b/kradio3/plugins/gui-standard-display/radioview-configuration.cpp
new file mode 100644
index 0000000..9a22313
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview-configuration.cpp
@@ -0,0 +1,116 @@
+/***************************************************************************
+ radioview-configuration.cpp - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "radioview-configuration.h"
+
+RadioViewConfiguration::RadioViewConfiguration(QWidget *parent)
+ : QTabWidget (parent),
+ m_dirty(true)
+{
+}
+
+RadioViewConfiguration::~RadioViewConfiguration()
+{
+}
+
+
+void RadioViewConfiguration::addTab (QWidget *child, const QString &label)
+{
+ QTabWidget::addTab(child, label);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::addTab (QWidget *child, const QIconSet &iconset, const QString &label)
+{
+ QTabWidget::addTab(child, iconset, label);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::addTab (QWidget *child, QTab *tab)
+{
+ QTabWidget::addTab(child, tab);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::insertTab (QWidget *child, const QString &label, int index)
+{
+ QTabWidget::insertTab(child, label, index);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::insertTab (QWidget *child, const QIconSet &iconset, const QString &label, int index)
+{
+ QTabWidget::insertTab(child, iconset, label, index);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::insertTab (QWidget *child, QTab *tab, int index)
+{
+ QTabWidget::insertTab(child, tab, index);
+ QObject::connect(this, SIGNAL(sigOK()), child, SLOT(slotOK()));
+ QObject::connect(this, SIGNAL(sigCancel()), child, SLOT(slotCancel()));
+ QObject::connect(child, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+}
+
+
+void RadioViewConfiguration::removePage(QWidget *w)
+{
+ QObject::disconnect(this, SIGNAL(sigOK()), w, SLOT(slotOK()));
+ QObject::disconnect(this, SIGNAL(sigCancel()), w, SLOT(slotCancel()));
+ QObject::disconnect(w, SIGNAL(sigDirty()), this, SLOT(slotSetDirty()));
+ QTabWidget::removePage(w);
+}
+
+
+void RadioViewConfiguration::slotOK()
+{
+ if (m_dirty) {
+ emit sigOK();
+ m_dirty = false;
+ }
+}
+
+void RadioViewConfiguration::slotCancel()
+{
+ if (m_dirty) {
+ emit sigCancel();
+ m_dirty = false;
+ }
+}
+
+void RadioViewConfiguration::slotSetDirty()
+{
+ m_dirty = true;
+}
+
+
+#include "radioview-configuration.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview-configuration.h b/kradio3/plugins/gui-standard-display/radioview-configuration.h
new file mode 100644
index 0000000..a85d4d9
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview-configuration.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ radioview-configuration.h - description
+ -------------------
+ begin : Fr Aug 15 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_CONFIGURATION_H
+#define KRADIO_RADIOVIEW_CONFIGURATION_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+
+#include <qtabwidget.h>
+
+class RadioViewConfiguration : public QTabWidget
+{
+Q_OBJECT
+public :
+ RadioViewConfiguration(QWidget *parent = NULL);
+ ~RadioViewConfiguration();
+
+ void addTab (QWidget *child, const QString &label);
+ void addTab (QWidget *child, const QIconSet &iconset, const QString &label);
+ void addTab (QWidget *child, QTab *tab);
+ void insertTab (QWidget *child, const QString &label, int index = -1);
+ void insertTab (QWidget *child, const QIconSet &iconset, const QString &label, int index = -1);
+ void insertTab (QWidget *child, QTab *tab, int index = -1);
+ void removePage(QWidget *w);
+
+public slots:
+
+ void slotOK();
+ void slotCancel();
+ void slotSetDirty();
+
+signals:
+
+ void sigOK();
+ void sigCancel();
+
+protected:
+ bool m_dirty;
+};
+
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/radioview.cpp b/kradio3/plugins/gui-standard-display/radioview.cpp
new file mode 100644
index 0000000..e1fd8e4
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview.cpp
@@ -0,0 +1,807 @@
+/***************************************************************************
+ radioview.cpp - description
+ -------------------
+ begin : Mit Mai 28 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include <qwidgetstack.h>
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <qslider.h>
+#include <qfile.h>
+#include <qtooltip.h>
+#include <qcheckbox.h>
+#include <qimage.h>
+
+#include <kcombobox.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kwin.h>
+#include <kconfig.h>
+#include <kpopupmenu.h>
+
+#include "../../src/include/radiodevice_interfaces.h"
+#include "../../src/include/radiostation.h"
+#include "../../src/include/stationlist.h"
+#include "../../src/include/pluginmanager.h"
+#include "../../src/include/plugin_configuration_dialog.h"
+#include "../../src/include/aboutwidget.h"
+
+#include "radioview.h"
+#include "radioview_frequencyradio.h"
+#include "radioview_volume.h"
+#include "radioview_frequencyseeker.h"
+#include "radioview-configuration.h"
+
+#include <kaboutdata.h>
+
+#define POPUP_ID_START_RECORDING_DEFAULT 0
+#define POPUP_ID_STOP_RECORDING_BASE 100
+
+///////////////////////////////////////////////////////////////////////
+
+PLUGIN_LIBRARY_FUNCTIONS(RadioView, "kradio-gui-standard-display", i18n("Standard Display for KRadio"));
+
+///////////////////////////////////////////////////////////////////////
+
+bool RadioView::ElementCfg::operator == (const ElementCfg &x) const
+{
+ if (!x.element || !element)
+ return x.cfg == cfg;
+ if (!x.cfg || !cfg)
+ return x.element == element;
+ return element == x.element && cfg == x.cfg;
+}
+
+///////////////////////////////////////////////////////////////////////
+
+RadioView::RadioView(const QString &name)
+ : QWidget(NULL, name.ascii()),
+ WidgetPluginBase(name, i18n("Radio Display")),
+ enableToolbarFlag(false),
+ btnPower(NULL),
+ btnConfigure(NULL),
+ btnQuit(NULL),
+ btnRecording(NULL),
+ btnSnooze(NULL),
+ btnPlugins(NULL),
+ comboStations(NULL),
+ currentDevice(NULL),
+ m_RecordingMenu(NULL),
+ m_NextRecordingMenuID(POPUP_ID_STOP_RECORDING_BASE),
+ m_PluginMenu(NULL)
+{
+ for (int i = 0; i < clsClassMAX; ++i)
+ maxUsability[i] = 0;
+
+ QBoxLayout *l01 = new QBoxLayout(this, QBoxLayout::LeftToRight, /*spacing=*/3);
+ l01->setMargin(1);
+ l01->setSpacing(2);
+ widgetStacks[clsRadioSound] = new QWidgetStack (this);
+ l01->addWidget(widgetStacks[clsRadioSound]);
+
+ QBoxLayout *l02 = new QBoxLayout(l01, QBoxLayout::Down);
+ QBoxLayout *l03 = new QBoxLayout(l02, QBoxLayout::LeftToRight);
+ comboStations = new KComboBox (this);
+ l02->addWidget (comboStations);
+
+ QBoxLayout *l05 = new QBoxLayout(l03, QBoxLayout::Down);
+ widgetStacks[clsRadioDisplay] = new QWidgetStack (this);
+ l05->addWidget(widgetStacks[clsRadioDisplay]);
+ widgetStacks[clsRadioSeek] = new QWidgetStack (this);
+ l05->addWidget(widgetStacks[clsRadioSeek]);
+
+ QGridLayout *l04 = new QGridLayout (l03, /*rows=*/ 3, /*cols=*/ 2);
+ btnPower = new QToolButton(this);
+ btnPower->setToggleButton(true);
+ btnRecording = new QToolButton(this);
+ btnRecording->setToggleButton(true);
+ btnConfigure = new QToolButton(this);
+ btnConfigure->setToggleButton(true);
+ btnQuit = new QToolButton(this);
+ btnSnooze = new QToolButton(this);
+ btnSnooze->setToggleButton(true);
+ btnPlugins = new QToolButton(this);
+ btnPlugins->setPopupDelay(1);
+ l04->addWidget (btnPower, 0, 0);
+ l04->addWidget (btnRecording, 0, 1);
+ l04->addWidget (btnConfigure, 1, 0);
+ l04->addWidget (btnQuit, 1, 1);
+ l04->addWidget (btnSnooze, 2, 0);
+ l04->addWidget (btnPlugins, 2, 1);
+
+ m_pauseMenu = new KPopupMenu(btnPower);
+ m_pauseMenu->insertItem(SmallIcon("kradio_pause"),
+ i18n("Pause KRadio"),
+ this, SLOT(slotPause()));
+ btnPower->setPopupDelay(200);
+
+ m_RecordingMenu = new KPopupMenu(btnRecording);
+ m_RecordingMenu->insertItem(SmallIcon("kradio_record"),
+ i18n("Start Recording"),
+ POPUP_ID_START_RECORDING_DEFAULT);
+ QObject::connect(m_RecordingMenu, SIGNAL(activated(int)),
+ this, SLOT(slotRecordingMenu(int)));
+ btnRecording->setPopup(m_RecordingMenu);
+
+
+ m_SnoozeMenu = new KPopupMenu(btnSnooze);
+ m_SnoozeMenu->insertItem(i18n("5 min"), this, SLOT(slotSnooze(int)), 0, 5);
+ m_SnoozeMenu->insertItem(i18n("10 min"), this, SLOT(slotSnooze(int)), 0, 10);
+ m_SnoozeMenu->insertItem(i18n("15 min"), this, SLOT(slotSnooze(int)), 0, 15);
+ m_SnoozeMenu->insertItem(i18n("30 min"), this, SLOT(slotSnooze(int)), 0, 30);
+ m_SnoozeMenu->insertItem(i18n("60 min"), this, SLOT(slotSnooze(int)), 0, 60);
+ btnSnooze->setPopup(m_SnoozeMenu);
+ btnSnooze->setPopupDelay(200);
+
+ // Plugin-Button/Menu
+
+ m_PluginMenu = new KPopupMenu(btnPlugins);
+ if (m_manager)
+ m_manager->addWidgetPluginMenuItems(m_PluginMenu, m_Plugins2MenuID);
+ btnPlugins->setPopup(m_PluginMenu);
+
+ // ICONS
+
+ btnPower->setIconSet(SmallIconSet("kradio_muteon"));
+ btnRecording->setIconSet(SmallIconSet("kradio_record"));
+ btnConfigure->setIconSet(SmallIconSet("configure"));
+ btnQuit->setIconSet(SmallIconSet("exit"));
+ btnSnooze->setIconSet(SmallIconSet("kradio_zzz"));
+ btnPlugins->setIconSet(SmallIconSet("kradio_plugins"));
+
+ widgetStacks[clsRadioSound] ->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred));
+ widgetStacks[clsRadioDisplay]->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));
+ widgetStacks[clsRadioSeek] ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ comboStations ->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ comboStations->setMinimumHeight(28);
+
+
+ QObject::connect(btnPower, SIGNAL(toggled(bool)),
+ this, SLOT(slotPower(bool)));
+ QObject::connect(btnQuit, SIGNAL(clicked()),
+ kapp, SLOT(quit()));
+ QObject::connect(btnConfigure, SIGNAL(toggled(bool)),
+ this, SLOT(slotConfigure(bool)));
+ QObject::connect(btnRecording, SIGNAL(clicked()),
+ this, SLOT(slotRecord()));
+ QObject::connect(btnSnooze, SIGNAL(toggled(bool)),
+ this, SLOT(slotSnooze(bool)));
+ QObject::connect(comboStations, SIGNAL(activated(int)),
+ this, SLOT(slotComboStationSelected(int)));
+ QObject::connect(btnPlugins, SIGNAL(clicked()),
+ this, SLOT(slotBtnPluginsClicked()));
+
+ // tooltips
+
+ QToolTip::add(btnConfigure, i18n("Configure KRadio"));
+ QToolTip::add(btnPower, i18n("Power On/Off"));
+ QToolTip::add(btnQuit, i18n("Quit KRadio Application"));
+ QToolTip::add(btnRecording, i18n("Start/Stop Recording"));
+ QToolTip::add(btnSnooze, i18n("Start/Stop Sleep Countdown"));
+ QToolTip::add(btnPlugins, i18n("Show/Hide Plugins"));
+ QToolTip::add(comboStations, i18n("Select a Radio Station"));
+
+ // testing
+ addElement (new RadioViewFrequencyRadio (this, QString::null));
+ addElement (new RadioViewVolume(this, QString::null));
+ addElement (new RadioViewFrequencySeeker(this, QString::null));
+
+ autoSetCaption();
+}
+
+
+RadioView::~RadioView ()
+{
+ QPtrListIterator<QObject> it(configPages);
+ while (configPages.first()) {
+ delete configPages.first();
+ }
+ configPages.clear();
+}
+
+
+bool RadioView::addElement (RadioViewElement *e)
+{
+ if (!e) return false;
+
+ RadioViewClass cls = e->getClass();
+
+ if (cls < 0 || cls >= clsClassMAX)
+ return false;
+
+
+ e->reparent(this, QPoint(0, 0), true);
+ QObject::connect(e, SIGNAL(destroyed(QObject*)),
+ this, SLOT(removeElement(QObject*)));
+ elements.append(e);
+ widgetStacks[cls]->addWidget(e);
+
+ // connect Element with device, disconnect doesn't matter (comp. removeElement)
+ // other devices follow if currentDevice changes
+ if (currentDevice)
+ e->connectI(currentDevice);
+
+ e->connectI(getSoundStreamServer());
+
+ QPtrListIterator<QObject> it(configPages);
+ for (; it.current(); ++it) {
+ addConfigurationTabFor(e, (QTabWidget *)it.current());
+ }
+
+ selectTopWidgets();
+
+ return true;
+}
+
+
+bool RadioView::removeElement (QObject *_e)
+{
+ RadioViewElement *e = dynamic_cast<RadioViewElement*>(_e);
+ if (!e)
+ return false;
+
+ ElementCfgListIterator it;
+ while ((it = elementConfigPages.find(e)) != elementConfigPages.end()) {
+ delete (*it).cfg;
+ // it must not used behind, the element will be deleted automatically
+ // by slotElementConfigPageDeleted
+ }
+
+ e->disconnectI(getSoundStreamServer());
+
+ if (currentDevice)
+ e->disconnectI(currentDevice);
+
+ RadioViewClass cls = e->getClass();
+ QObject::disconnect(e, SIGNAL(destroyed(QObject*)),
+ this, SLOT(removeElement(QObject*)));
+ widgetStacks[cls]->removeWidget(e);
+ elements.remove(e);
+
+ selectTopWidgets();
+
+ return true;
+}
+
+
+void RadioView::selectTopWidgets()
+{
+ for (int i = 0; i < clsClassMAX; ++i)
+ maxUsability[i] = 0;
+
+ for (ElementListIterator i(elements); i.current(); ++i) {
+ RadioViewElement *e = i.current();
+ RadioViewClass cls = e->getClass();
+ float u = e->getUsability(currentDevice);
+ if (u > maxUsability[cls]) {
+ maxUsability[cls] = u;
+ widgetStacks[cls]->raiseWidget(e);
+ }
+ }
+ // adjustLayout!?
+}
+
+
+// IRadioClient
+
+bool RadioView::noticePowerChanged(bool on)
+{
+ btnPower->setIconSet(SmallIconSet( on ? "kradio_muteoff" : "kradio_muteon"));
+ btnPower->setOn(on);
+ if (on) {
+ btnPower->setPopup(m_pauseMenu);
+ } else {
+ btnPower->setPopup(NULL);
+ }
+ autoSetCaption();
+ return true;
+}
+
+
+bool RadioView::noticeStationChanged (const RadioStation &, int idx)
+{
+ // add 1 for "no preset defined" entry
+ comboStations->setCurrentItem(idx + 1);
+ autoSetCaption();
+ bool r = false;
+ SoundFormat sf;
+ queryIsRecordingRunning(queryCurrentSoundStreamID(), r, sf);
+ m_RecordingMenu->setItemEnabled(POPUP_ID_START_RECORDING_DEFAULT, !r);
+ return true;
+}
+
+
+bool RadioView::noticeStationsChanged(const StationList &sl)
+{
+ const RawStationList &list = sl.all();
+
+ comboStations->clear();
+ comboStations->insertItem("<" + i18n("no preset defined") + ">");
+
+ for (RawStationList::Iterator i(list); i.current(); ++i) {
+ RadioStation *stn = i.current();
+ QString icon = stn->iconName();
+ if (icon.length() && QFile(icon).exists()) {
+ QImage img(icon);
+ int h = img.height();
+ float f = (float)(comboStations->height() - 4) / (h ? (float)h : 1.0);
+ comboStations->insertItem(img.smoothScale((int)(img.width()*f), (int)(h * f)), stn->name());
+ } else {
+ comboStations->insertItem(stn->name());
+ }
+ }
+
+ noticeStationChanged(queryCurrentStation(), queryCurrentStationIdx());
+ return true;
+}
+
+
+bool RadioView::noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/)
+{
+ // FIXME: perhaps do something
+ return false;
+}
+
+// IRadioDevicePoolClient
+
+bool RadioView::noticeActiveDeviceChanged(IRadioDevice *newDevice)
+{
+ IRadioDevice *oldDevice = currentDevice;
+ currentDevice = newDevice;
+
+ for (ElementListIterator i(elements); i.current(); ++i) {
+ RadioViewElement *e = i.current();
+ if (oldDevice)
+ e->disconnectI(oldDevice);
+ if (newDevice)
+ e->connectI(currentDevice);
+ }
+
+ selectTopWidgets();
+ return true;
+}
+
+
+// Interface
+
+bool RadioView::connectI(Interface *i)
+{
+ bool a = IRadioClient::connectI(i);
+ bool b = IRadioDevicePoolClient::connectI(i);
+ bool c = PluginBase::connectI(i);
+ bool d = ITimeControlClient::connectI(i);
+
+ // Callbacks for ISoundStreamClient
+
+ bool e = ISoundStreamClient::connectI(i);
+
+ return a || b || c || d || e;
+}
+
+
+bool RadioView::disconnectI(Interface *i)
+{
+ bool a = IRadioClient::disconnectI(i);
+ bool b = IRadioDevicePoolClient::disconnectI(i);
+ bool c = PluginBase::disconnectI(i);
+ bool d = ITimeControlClient::disconnectI(i);
+ bool e = ISoundStreamClient::disconnectI(i);
+ if (e) {
+ // special task for soundstreamclient, different from radio device pool
+ for (ElementListIterator it(elements); it.current(); ++it) {
+ RadioViewElement *e = it.current();
+ e->disconnectI(i);
+ }
+ }
+ return a || b || c || d || e;
+}
+
+void RadioView::noticeConnectedI (ISoundStreamServer *s, bool pointer_valid)
+{
+ ISoundStreamClient::noticeConnectedI(s, pointer_valid);
+ if (s && pointer_valid) {
+ s->register4_sendStartRecordingWithFormat(this);
+ s->register4_sendStopRecording (this);
+ s->register4_notifySoundStreamChanged (this);
+
+ // special task for soundstreamclient, different from radio device pool
+ for (ElementListIterator it(elements); it.current(); ++it) {
+ RadioViewElement *e = it.current();
+ e->connectI(s);
+ }
+ }
+}
+
+// ISoundStreamClient
+
+bool RadioView::startRecordingWithFormat(
+ SoundStreamID id,
+ const SoundFormat &/*proposed_format*/,
+ SoundFormat &/*real_format*/)
+{
+ if (!id.isValid() || id != queryCurrentSoundStreamID() || m_StreamID2MenuID.contains(id))
+ return false;
+
+ QString descr;
+ querySoundStreamDescription(id, descr);
+ int menu_id = m_NextRecordingMenuID++;
+ m_RecordingMenu->insertItem(SmallIcon("kradio_record"),
+ i18n("Stop Recording of %1").arg(descr),
+ menu_id);
+ m_MenuID2StreamID.insert(menu_id, id);
+ m_StreamID2MenuID.insert(id, menu_id);
+ btnRecording->setOn(true);
+
+ if (id == queryCurrentSoundStreamID())
+ m_RecordingMenu->setItemEnabled(POPUP_ID_START_RECORDING_DEFAULT, false);
+
+ return false; // this is only a "hook" that does not initiate the recording so don't say that we handled the event
+}
+
+
+bool RadioView::stopRecording (SoundStreamID id)
+{
+ if (!id.isValid() || !m_StreamID2MenuID.contains(id))
+ return false;
+
+ int menu_id = m_StreamID2MenuID[id];
+ m_RecordingMenu->removeItem(menu_id);
+ m_MenuID2StreamID.remove(menu_id);
+ m_StreamID2MenuID.remove(id);
+ btnRecording->setOn(m_StreamID2MenuID.count() > 0);
+
+ if (id == queryCurrentSoundStreamID())
+ m_RecordingMenu->setItemEnabled(POPUP_ID_START_RECORDING_DEFAULT, true);
+
+ return false;
+}
+
+
+bool RadioView::noticeSoundStreamChanged(SoundStreamID id)
+{
+ if (m_StreamID2MenuID.contains(id)) {
+ QString descr;
+ querySoundStreamDescription(id, descr);
+ m_RecordingMenu->changeItem(m_StreamID2MenuID[id],
+ SmallIcon("kradio_record"),
+ i18n("Stop Recording of %1").arg(descr));
+ return true;
+ }
+ return false;
+}
+
+
+// ITimeControl
+
+bool RadioView::noticeCountdownStarted(const QDateTime &)
+{
+ btnSnooze->setOn(true);
+ return true;
+}
+
+bool RadioView::noticeCountdownStopped()
+{
+ btnSnooze->setOn(false);
+ return true;
+}
+
+bool RadioView::noticeCountdownZero()
+{
+ btnSnooze->setOn(false);
+ return true;
+}
+
+// WidgetPluginBase
+
+void RadioView::saveState (KConfig *config) const
+{
+ config->setGroup(QString("radioview-") + name());
+
+ config->writeEntry("enableToobarFlag", enableToolbarFlag);
+ WidgetPluginBase::saveState(config);
+
+ for (ElementListIterator i(elements); i.current(); ++i) {
+ RadioViewElement *e = i.current();
+ e->saveState(config);
+ }
+}
+
+
+void RadioView::restoreState (KConfig *config)
+{
+ config->setGroup(QString("radioview-") + name());
+
+ enableToolbarFlag = config->readBoolEntry("enableToolbarFlag", false);
+ WidgetPluginBase::restoreState(config);
+
+ for (ElementListIterator i(elements); i.current(); ++i) {
+ RadioViewElement *e = i.current();
+ e->restoreState(config);
+ }
+}
+
+
+ConfigPageInfo RadioView::createConfigurationPage()
+{
+ RadioViewConfiguration *c = new RadioViewConfiguration();
+
+ //addCommonConfigurationTab(c);
+
+ for (ElementListIterator i(elements); i.current(); ++i) {
+ addConfigurationTabFor(i.current(), c);
+ }
+
+ configPages.append(c);
+ QObject::connect(c, SIGNAL(destroyed(QObject *)),
+ this, SLOT(slotConfigPageDeleted(QObject *)));
+
+ return ConfigPageInfo(
+ c,
+ i18n("Display"),
+ i18n("Display Configuration"),
+ "openterm"
+ );
+}
+
+
+void RadioView::addConfigurationTabFor(RadioViewElement *e, QTabWidget *c)
+{
+ if (!e || !c)
+ return;
+
+ ConfigPageInfo inf = e->createConfigurationPage();
+
+ if (inf.page) {
+
+ if (inf.iconName.length()) {
+ c->addTab(inf.page, QIconSet(SmallIconSet(inf.iconName)), inf.itemName);
+ } else {
+ c->addTab(inf.page, inf.itemName);
+ }
+
+ elementConfigPages.push_back(ElementCfg(e, inf.page));
+ QObject::connect(inf.page, SIGNAL(destroyed(QObject *)),
+ this, SLOT(slotElementConfigPageDeleted(QObject *)));
+ }
+}
+
+
+void RadioView::addCommonConfigurationTab(QTabWidget *c)
+{
+ if (!c)
+ return;
+
+ QFrame *f = new QFrame(c);
+ QVBoxLayout *l = new QVBoxLayout(f, 10);
+
+ l->addWidget(new QCheckBox(i18n("set Toolbar-Flag for Display"), f));
+ l->addItem(new QSpacerItem(1, 3, QSizePolicy::Fixed, QSizePolicy::Expanding));
+
+ c->addTab(f, i18n("Common"));
+
+ elementConfigPages.push_back(ElementCfg(f));
+ QObject::connect(f, SIGNAL(destroyed(QObject *)),
+ this, SLOT(slotElementConfigPageDeleted(QObject *)));
+}
+
+
+AboutPageInfo RadioView::createAboutPage()
+{
+/* KAboutData aboutData("kradio",
+ NULL,
+ NULL,
+ I18N_NOOP("Standard Radio Display for KRadio"),
+ KAboutData::License_GPL,
+ "(c) 2002-2005 Martin Witte, Klas Kalass",
+ 0,
+ "http://sourceforge.net/projects/kradio",
+ 0);
+ aboutData.addAuthor("Martin Witte", "", "[email protected]");
+ aboutData.addAuthor("Klas Kalass", "", "[email protected]");
+
+ return AboutPageInfo(
+ new KRadioAboutWidget(aboutData, KRadioAboutWidget::AbtTabbed),
+ i18n("Display"),
+ i18n("Standard Radio Display for KRadio"),
+ "openterm"
+ );*/
+ return AboutPageInfo();
+}
+
+
+void RadioView::noticeWidgetPluginShown(WidgetPluginBase *p, bool shown)
+{
+ if (!m_manager || !p)
+ return;
+ if ((WidgetPluginBase*)m_manager->getConfigDialog() == p) {
+ btnConfigure->blockSignals(true);
+ btnConfigure->setOn(shown);
+ btnConfigure->blockSignals(false);
+ }
+
+ if (m_Plugins2MenuID.contains(p)) {
+ m_manager->updateWidgetPluginMenuItem(p, m_PluginMenu, m_Plugins2MenuID, shown);
+ }
+}
+
+
+// own Stuff
+
+void RadioView::noticePluginsChanged(const PluginList &/*l*/)
+{
+ m_Plugins2MenuID.clear();
+ m_PluginMenu->clear();
+ if (m_manager)
+ m_manager->addWidgetPluginMenuItems(m_PluginMenu, m_Plugins2MenuID);
+}
+
+
+void RadioView::slotPower(bool on)
+{
+ on ? sendPowerOn() : sendPowerOff();
+ btnPower->setOn(queryIsPowerOn());
+}
+
+
+void RadioView::slotPause()
+{
+ if (queryIsPowerOn()) {
+ sendPausePlayback(queryCurrentSoundStreamID());
+ }
+}
+
+
+void RadioView::slotConfigure(bool b)
+{
+ QWidget *w = m_manager ? m_manager->getConfigDialog() : NULL;
+ if (w) b ? w->show() : w->hide();
+ if (!w)
+ btnConfigure->setOn(false);
+}
+
+
+void RadioView::slotRecord()
+{
+ SoundStreamID id = queryCurrentSoundStreamID();
+ bool b = btnRecording->isOn();
+
+ bool r = false;
+ SoundFormat sf;
+ queryIsRecordingRunning(id, r, sf);
+
+ if (!r && b /*!m_StreamID2MenuID.contains(id)*/) {
+ if (!queryIsPowerOn())
+ sendPowerOn();
+ sendStartRecording(id);
+ } else if (r && !b) {
+ sendStopRecording(id);
+ }
+}
+
+
+void RadioView::slotRecordingMenu(int i)
+{
+ if (i == POPUP_ID_START_RECORDING_DEFAULT) {
+ SoundStreamID id = queryCurrentSoundStreamID();
+ bool r = false;
+ SoundFormat sf;
+ queryIsRecordingRunning(id, r, sf);
+ if (!r) {
+ if (!queryIsPowerOn())
+ sendPowerOn();
+ sendStartRecording(id);
+ }
+ } else if (m_MenuID2StreamID.contains(i)) {
+ sendStopRecording(m_MenuID2StreamID[i]);
+ }
+}
+
+
+void RadioView::slotSnooze(bool on)
+{
+ if (on)
+ sendStartCountdown();
+ else
+ sendStopCountdown();
+}
+
+
+void RadioView::slotSnooze(int n)
+{
+ sendCountdownSeconds(n*60);
+ sendStartCountdown();
+}
+
+
+void RadioView::slotComboStationSelected(int idx)
+{
+ if (idx > 0) {
+ sendActivateStation(idx - 1);
+ } else {
+ comboStations->setCurrentItem(queryCurrentStationIdx() + 1);
+ }
+}
+
+void RadioView::slotBtnPluginsClicked()
+{
+ btnPlugins->openPopup();
+}
+
+void RadioView::slotConfigPageDeleted(QObject *o)
+{
+ configPages.remove(o);
+}
+
+
+void RadioView::slotElementConfigPageDeleted(QObject *o)
+{
+ ElementCfgListIterator it;
+ while ((it = elementConfigPages.find(o)) != elementConfigPages.end()) {
+ elementConfigPages.remove(it);
+ }
+}
+
+
+void RadioView::show()
+{
+ if (enableToolbarFlag)
+ KWin::setType(winId(), NET::Toolbar);
+ else
+ KWin::setType(winId(), NET::Normal);
+ WidgetPluginBase::pShow();
+ QWidget::show();
+}
+
+
+void RadioView::showOnOrgDesktop()
+{
+ WidgetPluginBase::pShowOnOrgDesktop();
+ //QWidget::show();
+}
+
+
+
+void RadioView::hide()
+{
+ WidgetPluginBase::pHide();
+ QWidget::hide();
+}
+
+
+void RadioView::showEvent(QShowEvent *e)
+{
+ QWidget::showEvent(e);
+ WidgetPluginBase::pShowEvent(e);
+}
+
+
+void RadioView::hideEvent(QHideEvent *e)
+{
+ QWidget::hideEvent(e);
+ WidgetPluginBase::pHideEvent(e);
+}
+
+
+void RadioView::autoSetCaption()
+{
+ const RadioStation &rs = queryCurrentStation();
+ setCaption((queryIsPowerOn() && rs.isValid()) ? rs.longName() : QString("KRadio"));
+}
+
+
+
+
+#include "radioview.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview.h b/kradio3/plugins/gui-standard-display/radioview.h
new file mode 100644
index 0000000..6cddc26
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview.h
@@ -0,0 +1,207 @@
+/***************************************************************************
+ radioview.h - description
+ -------------------
+ begin : Mit Mai 28 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_H
+#define KRADIO_RADIOVIEW_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qobjectlist.h>
+
+#include "../../src/include/radio_interfaces.h"
+#include "../../src/include/radiodevicepool_interfaces.h"
+#include "../../src/include/soundstreamclient_interfaces.h"
+#include "../../src/include/timecontrol_interfaces.h"
+#include "../../src/include/widgetplugins.h"
+#include "radioview_element.h"
+
+class QWidgetStack;
+class QToolButton;
+class KComboBox;
+class QTabWidget;
+class KPopupMenu;
+
+
+
+class RadioView : public QWidget,
+ public WidgetPluginBase,
+ public IRadioClient,
+ public IRadioDevicePoolClient,
+ public ISoundStreamClient,
+ public ITimeControlClient
+{
+Q_OBJECT
+public:
+
+ RadioView(const QString &name);
+ virtual ~RadioView();
+
+ virtual QString pluginClassName() const { return "RadioView"; }
+
+ const QString &name() const { return PluginBase::name(); }
+ QString &name() { return PluginBase::name(); }
+
+ // WidgetPluginBase
+
+public:
+ virtual void saveState (KConfig *) const;
+ virtual void restoreState (KConfig *);
+
+ virtual bool connectI(Interface *i);
+ virtual bool disconnectI(Interface *i);
+
+ virtual void noticeWidgetPluginShown(WidgetPluginBase *p, bool shown);
+ virtual void noticePluginsChanged(const PluginList &);
+
+ virtual ConfigPageInfo createConfigurationPage();
+ virtual AboutPageInfo createAboutPage();
+
+public slots:
+ // connects destroy-msg with remove-function
+ bool addElement (RadioViewElement *);
+ bool removeElement (QObject *);
+
+protected:
+ void selectTopWidgets();
+
+
+ // IRadioClient
+
+RECEIVERS:
+ bool noticePowerChanged(bool on);
+ bool noticeStationChanged (const RadioStation &, int idx);
+ bool noticeStationsChanged(const StationList &sl);
+ bool noticePresetFileChanged(const QString &/*f*/) { return false; }
+
+ bool noticeCurrentSoundStreamIDChanged(SoundStreamID id);
+
+ // IRadioDevicePoolClient
+
+RECEIVERS:
+ bool noticeActiveDeviceChanged(IRadioDevice *rd);
+ bool noticeDevicesChanged(const QPtrList<IRadioDevice> &) { return false; }
+ bool noticeDeviceDescriptionChanged(const QString &) { return false; }
+
+ // ISoundStreamClient
+
+RECEIVERS:
+ void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
+
+ bool startRecordingWithFormat(SoundStreamID /*id*/,
+ const SoundFormat &/*proposed_format*/,
+ SoundFormat &/*real_format*/);
+ bool stopRecording(SoundStreamID /*id*/);
+
+ bool noticeSoundStreamChanged(SoundStreamID id);
+
+ // ITimeControlClient
+
+RECEIVERS:
+ bool noticeAlarmsChanged(const AlarmVector &) { return false; }
+ bool noticeAlarm(const Alarm &) { return false; }
+ bool noticeNextAlarmChanged(const Alarm *) { return false; }
+ bool noticeCountdownStarted(const QDateTime &end);
+ bool noticeCountdownStopped();
+ bool noticeCountdownZero();
+ bool noticeCountdownSecondsChanged(int) { return false; }
+
+protected slots:
+
+ void slotPower (bool on);
+ void slotPause();
+ void slotConfigure (bool show);
+ void slotRecord ();
+ void slotSnooze (bool start);
+ void slotSnooze (int time);
+ void slotRecordingMenu(int i);
+ void slotBtnPluginsClicked();
+ void slotComboStationSelected(int);
+
+ void slotConfigPageDeleted(QObject*);
+ void slotElementConfigPageDeleted(QObject*);
+
+public slots:
+
+ void toggleShown() { WidgetPluginBase::pToggleShown(); }
+ void showOnOrgDesktop();
+ void show();
+ void hide();
+
+protected:
+ virtual void showEvent(QShowEvent *);
+ virtual void hideEvent(QHideEvent *);
+
+ virtual void autoSetCaption();
+
+ const QWidget *getWidget() const { return this; }
+ QWidget *getWidget() { return this; }
+
+ void addConfigurationTabFor(RadioViewElement *, QTabWidget *);
+ void addCommonConfigurationTab(QTabWidget *);
+
+protected:
+ bool enableToolbarFlag;
+
+ QToolButton *btnPower;
+ QToolButton *btnConfigure;
+ QToolButton *btnQuit;
+ QToolButton *btnRecording;
+ QToolButton *btnSnooze;
+ QToolButton *btnPlugins;
+ KComboBox *comboStations;
+
+ struct ElementCfg
+ {
+ RadioViewElement *element;
+ QObject *cfg;
+ ElementCfg() : element(NULL), cfg(NULL) {}
+ ElementCfg(RadioViewElement *e, QObject *w) : element(e), cfg(w) {}
+ ElementCfg(RadioViewElement *e) : element(e), cfg(NULL) {}
+ ElementCfg(QObject *w) : element(NULL), cfg(w) {}
+ bool operator == (const ElementCfg &x) const;
+ };
+
+ typedef QPtrList<RadioViewElement> ElementList;
+ typedef QPtrListIterator<RadioViewElement> ElementListIterator;
+ typedef QValueList<ElementCfg> ElementCfgList;
+ typedef QValueListIterator<ElementCfg> ElementCfgListIterator;
+
+ ElementList elements;
+ ElementCfgList elementConfigPages;
+ QObjectList configPages;
+ QWidgetStack * widgetStacks[clsClassMAX];
+ float maxUsability[clsClassMAX];
+
+ IRadioDevice *currentDevice;
+
+ KPopupMenu *m_RecordingMenu;
+ KPopupMenu *m_pauseMenu;
+ KPopupMenu *m_SnoozeMenu;
+ int m_NextRecordingMenuID;
+ QMap<int, SoundStreamID> m_MenuID2StreamID;
+ QMap<SoundStreamID, int> m_StreamID2MenuID;
+
+ KPopupMenu *m_PluginMenu;
+ QMap<WidgetPluginBase *, int> m_Plugins2MenuID;
+};
+
+
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/radioview_element.cpp b/kradio3/plugins/gui-standard-display/radioview_element.cpp
new file mode 100644
index 0000000..9c3396f
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_element.cpp
@@ -0,0 +1,34 @@
+/***************************************************************************
+ radioview_element.cpp - description
+ -------------------
+ begin : Fre Jun 20 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "radioview_element.h"
+
+RadioViewElement::RadioViewElement (QWidget * /*parent*/, const QString & /*name*/,
+ RadioViewClass cls)
+ : myClass(cls)
+{
+}
+
+
+RadioViewElement::~RadioViewElement()
+{
+}
+
+
+
+
+#include "radioview_element.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview_element.h b/kradio3/plugins/gui-standard-display/radioview_element.h
new file mode 100644
index 0000000..11c77ac
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_element.h
@@ -0,0 +1,66 @@
+/***************************************************************************
+ radioview_element.h - description
+ -------------------
+ begin : Fre Jun 20 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_ELEMENT_H
+#define KRADIO_RADIOVIEW_ELEMENT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <qframe.h>
+#include "../../src/include/interfaces.h"
+#include "../../src/include/plugins.h"
+
+enum RadioViewClass { clsRadioSound = 0,
+ clsRadioSeek,
+ clsRadioDisplay,
+ clsClassMAX
+ };
+
+
+// Defaults to an empty element
+class RadioViewElement : public QFrame,
+ public virtual Interface
+{
+Q_OBJECT
+public:
+ RadioViewElement (QWidget *parent, const QString &name, RadioViewClass myClass);
+ virtual ~RadioViewElement();
+
+ bool connectI (Interface *) { return false; } // default behaviour, please overwrite in derived class
+ bool disconnectI(Interface *) { return false; } // default behaviour, please overwrite in derived class
+
+ float getUsability (Interface *) const { return 0.01; } // 0 <= Usability <= 1, used to decide wich Element to use
+ // should be overwritten ;)
+
+ RadioViewClass getClass() const { return myClass; }
+
+ // Configuration ??
+ virtual ConfigPageInfo createConfigurationPage() { return ConfigPageInfo(); }
+
+ virtual void saveState (KConfig *) const {}
+ virtual void restoreState (KConfig *) {}
+
+
+protected :
+
+ RadioViewClass myClass;
+};
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp
new file mode 100644
index 0000000..8c6d15d
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.cpp
@@ -0,0 +1,443 @@
+/***************************************************************************
+ kradiodisplay.cpp - description
+ -------------------
+ begin : Mit Jan 29 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "../../src/include/utils.h"
+
+#include <qpainter.h>
+#include <qimage.h>
+#include <qpixmap.h>
+#include <kimageeffect.h> // fading, blending, ...
+#include <kpixmapio.h> // fast conversion between QPixmap/QImage
+#include "radioview_frequencyradio.h"
+#include "displaycfg.h"
+
+RadioViewFrequencyRadio::RadioViewFrequencyRadio(QWidget *parent, const QString &name )
+ : RadioViewElement(parent, name, clsRadioDisplay),
+ m_power(false),
+ m_valid(false),
+ m_frequency(0),
+ m_quality(0.0),
+ m_stereo(false)
+{
+ setFrameStyle(Box | Sunken);
+ setLineWidth(1);
+ setMidLineWidth(1);
+
+
+ // set some sensless default colors
+ // real values are read in restoreState
+ setDisplayColors(QColor(20, 244, 20),
+ QColor(10, 117, 10).light(75),
+ QColor(10, 117, 10));
+ setDisplayFont(QFont("Helvetica"));
+
+}
+
+
+RadioViewFrequencyRadio::~RadioViewFrequencyRadio(){
+}
+
+
+float RadioViewFrequencyRadio::getUsability (Interface *i) const
+{
+ if (dynamic_cast<IFrequencyRadio*>(i))
+ return 1.0;
+ else
+ return 0.0;
+}
+
+
+void RadioViewFrequencyRadio::saveState (KConfig *config) const
+{
+ config->writeEntry("frequency-view-colorActiveText", m_colorActiveText);
+ config->writeEntry("frequency-view-colorInactiveText", m_colorInactiveText);
+ config->writeEntry("frequency-view-colorButton", m_colorButton);
+ config->writeEntry("frequency-view-font", m_font);
+}
+
+
+void RadioViewFrequencyRadio::restoreState (KConfig *config)
+{
+ QColor defaultActive (20, 244, 20),
+ defaultInactive(QColor(10, 117, 10).light(75)),
+ defaultButton (10, 117, 10);
+ QFont defaultFont ("Helvetica");
+ QColor a, b, c;
+ QFont f;
+ a = config->readColorEntry ("frequency-view-colorActiveText",
+ &defaultActive);
+ b = config->readColorEntry ("frequency-view-colorInactiveText",
+ &defaultInactive);
+ c = config->readColorEntry ("frequency-view-colorButton",
+ &defaultButton);
+ f = config->readFontEntry ("frequency-view-font",
+ &defaultFont);
+ setDisplayColors(a, b, c);
+ setDisplayFont(f);
+}
+
+
+ConfigPageInfo RadioViewFrequencyRadio::createConfigurationPage()
+{
+ DisplayConfiguration *a = new DisplayConfiguration(NULL);
+ connectI(a);
+ return ConfigPageInfo (a,
+ i18n("Frequency Display"),
+ i18n("Frequency Display"),
+ QString::null
+ );
+}
+
+
+// Interface
+
+bool RadioViewFrequencyRadio::connectI(Interface *i)
+{
+ bool o = IDisplayCfg::connectI(i);
+ bool c = ISoundStreamClient::connectI(i);
+ if (dynamic_cast<IFrequencyRadio *>(i)) {
+
+ bool a = IRadioDeviceClient::connectI(i);
+ bool b = IFrequencyRadioClient::connectI(i);
+ return o || a || b || c;
+
+ } else {
+ return o || c;
+ }
+}
+
+
+bool RadioViewFrequencyRadio::disconnectI(Interface *i)
+{
+ // no check for IFrequencyRadio, it's just a disconnect
+
+ bool a = IRadioDeviceClient::disconnectI(i);
+ bool b = IFrequencyRadioClient::disconnectI(i);
+ bool c = ISoundStreamClient::disconnectI(i);
+ bool o = IDisplayCfg::disconnectI(i);
+
+ return a || b || c || o;
+}
+
+void RadioViewFrequencyRadio::noticeConnectedI (ISoundStreamServer *s, bool pointer_valid)
+{
+ ISoundStreamClient::noticeConnectedI(s, pointer_valid);
+ if (s && pointer_valid) {
+ s->register4_notifySignalQualityChanged(this);
+ s->register4_notifyStereoChanged(this);
+ }
+}
+
+// IDisplayCfg
+
+bool RadioViewFrequencyRadio::setDisplayColors(const QColor &activeText,
+ const QColor &inactiveText,
+ const QColor &button)
+{
+ bool change = (activeText != m_colorActiveText || inactiveText != m_colorInactiveText || button != m_colorButton);
+
+ m_colorActiveText = activeText;
+ m_colorInactiveText = inactiveText;
+ m_colorButton = button;
+
+ QPalette pl = palette();
+ QColorGroup cg = pl.inactive();
+
+ QBrush fg = cg.brush(QColorGroup::Foreground),
+ btn = cg.brush(QColorGroup::Button),
+ lgt = cg.brush(QColorGroup::Light),
+ drk = cg.brush(QColorGroup::Dark),
+ mid = cg.brush(QColorGroup::Mid),
+ txt = cg.brush(QColorGroup::Text),
+ btx = cg.brush(QColorGroup::BrightText),
+ bas = cg.brush(QColorGroup::Base),
+ bg = cg.brush(QColorGroup::Background);
+
+ fg.setColor (m_colorActiveText);
+ btn.setColor(m_colorButton);
+ lgt.setColor(m_colorButton.light(180));
+ drk.setColor(m_colorButton.light( 50));
+ mid.setColor(m_colorInactiveText);
+ txt.setColor(m_colorActiveText);
+ btx.setColor(m_colorActiveText);
+ bas.setColor(m_colorButton);
+ bg.setColor (m_colorButton);
+
+ QColorGroup ncg(fg, btn, lgt, drk, mid, txt, btx, bas, bg);
+ pl.setInactive(ncg);
+ pl.setActive(ncg);
+ setPalette(pl);
+
+ if (parentWidget() && parentWidget()->backgroundPixmap() ){
+ KPixmapIO io;
+ QImage i = io.convertToImage(*parentWidget()->backgroundPixmap());
+ KImageEffect::fade(i, 0.5, colorGroup().color(QColorGroup::Dark));
+ setPaletteBackgroundPixmap(io.convertToPixmap(i));
+ setBackgroundOrigin(WindowOrigin);
+ } else {
+ setBackgroundColor(colorGroup().color(QColorGroup::Button));
+ }
+
+ if (change)
+ notifyDisplayColorsChanged(m_colorActiveText, m_colorInactiveText, m_colorButton);
+ return true;
+}
+
+bool RadioViewFrequencyRadio::setDisplayFont (const QFont &f)
+{
+ if (m_font != f) {
+ m_font = f;
+ notifyDisplayFontChanged(m_font);
+ RadioViewElement::setFont(f);
+ }
+ return true;
+}
+
+// IRadioDeviceClient
+
+
+bool RadioViewFrequencyRadio::noticePowerChanged (bool on, const IRadioDevice */*sender*/)
+{
+ m_power = on;
+
+ SoundStreamID ssid = queryCurrentSoundStreamID();
+ float q = 0.0;
+ bool s = false;
+ querySignalQuality(ssid, q);
+ noticeSignalQualityChanged(ssid, q);
+ queryIsStereo(ssid, s);
+ noticeStereoChanged(ssid, s);
+
+ repaint();
+ return true;
+}
+
+
+bool RadioViewFrequencyRadio::noticeStationChanged (const RadioStation &, const IRadioDevice */*sender*/)
+{
+ return false; // we don't care
+}
+
+
+bool RadioViewFrequencyRadio::noticeDescriptionChanged (const QString &, const IRadioDevice */*sender*/)
+{
+ return false; // we don't care
+}
+
+
+// IRadioSoundClient
+
+bool RadioViewFrequencyRadio::noticeSignalQualityChanged(SoundStreamID id, float q)
+{
+ if (queryCurrentSoundStreamID() != id)
+ return false;
+ m_quality = q;
+ repaint ();
+ return true;
+}
+
+
+bool RadioViewFrequencyRadio::noticeStereoChanged(SoundStreamID id, bool s)
+{
+ if (queryCurrentSoundStreamID() != id)
+ return false;
+ m_stereo = s;
+ repaint ();
+ return true;
+}
+
+
+
+
+// IFrequencyRadioClient
+
+
+bool RadioViewFrequencyRadio::noticeFrequencyChanged(float f, const RadioStation *)
+{
+ m_frequency = f;
+ repaint ();
+ return true;
+}
+
+
+bool RadioViewFrequencyRadio::noticeMinMaxFrequencyChanged(float /*min*/, float /*max*/)
+{
+ return false; // we don't care
+}
+
+
+bool RadioViewFrequencyRadio::noticeDeviceMinMaxFrequencyChanged(float /*min*/, float /*max*/)
+{
+ return false; // we don't care
+}
+
+
+bool RadioViewFrequencyRadio::noticeScanStepChanged(float /*s*/)
+{
+ return false; // we don't care
+}
+
+
+
+void RadioViewFrequencyRadio::drawContents(QPainter *paint)
+{
+ if (!paint) return;
+
+ QRect r = contentsRect();
+
+ int margin = QMAX(4, QMIN(r.width() / 50, r.height() / 50)),
+ tmp = QMIN(r.height(), (r.width() - 2*margin) / 4),
+ xd_st = QMIN((r.height() - margin * 2) / 3, tmp/3),
+ xw = QMIN(tmp / 2, xd_st * 3 / 2),
+ penw = QMAX(1, xw / 25),
+ xh_st = xd_st,
+ xx_st = r.x() + margin + xw + 2 * margin + penw/2,
+ xy_st = r.y() + margin + penw/2,
+
+ xx_am = xx_st,
+ xy_am = xy_st + xh_st + margin / 2,
+ xh_am = (r.bottom() - margin - xy_am + 1 - margin/2) / 2,
+
+ xx_fm = xx_am,
+ xy_fm = xy_am + xh_am + margin/2,
+ xh_fm = xh_am,
+
+ xh_sg = r.height() - margin * 2,
+ xx_sg = r.x() + margin,
+ xy_sg = r.y() + margin;
+
+ QPen activePen (colorGroup().color(QColorGroup::Text), penw);
+ QPen inactivePen (colorGroup().color(QColorGroup::Mid), penw);
+ QBrush activeBrush = colorGroup().brush(QColorGroup::Text);
+ QBrush inactiveBrush = colorGroup().brush(QColorGroup::Mid);
+
+ // draw stereo symbol
+ paint->setPen( (m_stereo && m_power) ? activePen : inactivePen);
+ paint->drawArc((int)xx_st, (int)xy_st,
+ (int)(xd_st - penw), (int)(xd_st - penw),
+ 0, 360*16);
+ paint->drawArc((int)(xx_st + xd_st/2), (int)xy_st,
+ (int)(xd_st - penw), (int)(xd_st - penw),
+ 0, 360*16);
+
+ // draw signal quality symbol
+ float cx = xx_sg,
+ cy = xy_sg,
+ cw = xw,
+ ch = xw;
+
+ float open_a = 30.0;
+ // outer circle
+ paint->setPen( (m_quality > 0.75 && m_power) ? activePen : inactivePen);
+ paint->drawArc((int)rint(cx), (int)rint(cy),
+ (int)rint(cw), (int)rint(ch),
+ (int)(-90+open_a)*16, (int)(360 - 2*open_a)*16
+ );
+
+ // mid circle
+ paint->setPen( (m_quality > 0.50 && m_power) ? activePen : inactivePen);
+ cx += (float)xw/5.0; cy += (float)xw/5.0;
+ cw -= (float)xw/2.5; ch -= (float)xw/2.5;
+ paint->drawArc((int)rint(cx), (int)rint(cy),
+ (int)rint(cw), (int)rint(ch),
+ (int)(-90+open_a)*16, (int)(360 - 2*open_a)*16
+ );
+
+ // inner circle
+ paint->setPen( (m_quality > 0.25 && m_power) ? activePen : inactivePen);
+ cx += (float)xw/5.0; cy += (float)xw/5.0;
+ cw -= (float)xw/2.5; ch -= (float)xw/2.5;
+ paint->drawArc((int)rint(cx), (int)rint(cy),
+ (int)rint(cw), (int)rint(ch),
+ (int)(-90+open_a)*16, (int)(360 - 2*open_a)*16
+ );
+
+ // triangle
+ QPen tmppen = (m_quality > 0.1 && m_power) ? activePen : inactivePen;
+ tmppen.setWidth(1);
+ paint->setPen(tmppen);
+ paint->setBrush( (m_quality > 0.1 && m_power) ? activeBrush : inactiveBrush);
+ QPointArray pts(3);
+ pts.setPoint(0, (int)(xx_sg + xw / 4), (int)(xy_sg + xh_sg - penw/2));
+ pts.setPoint(1, (int)(xx_sg + xw *3/4), (int)(xy_sg + xh_sg - penw/2));
+ pts.setPoint(2, (int)(xx_sg + xw / 2), (int)(xy_sg + xw/2 + penw));
+ paint->drawConvexPolygon(pts);
+
+
+
+ // AM/FM display
+
+ QFont f = m_font;
+ paint->setPen ( (m_frequency <= 10 && m_power) ? activePen : inactivePen);
+ f.setPixelSize(xh_am);
+ paint->setFont(f);
+ paint->drawText(xx_am, xy_am + xh_am - 1, i18n("AM"));
+ int xw_am = QFontMetrics(f).width(i18n("AM"));
+
+ paint->setPen ( (m_frequency > 10 && m_power) ? activePen : inactivePen);
+ f.setPixelSize(xh_fm);
+ paint->setFont(f);
+ paint->drawText(xx_fm, xy_fm + xh_fm - 1, i18n("FM"));
+ int xw_fm = QFontMetrics(f).width(i18n("FM"));
+
+ int xx_f = QMAX(xx_fm + xw_fm, QMAX(xw_am + xx_am, QMAX(xx_st + xw, xw + xx_sg))) + margin,
+ xy_f = r.y() + margin,
+ xw_f = r.right() - margin - xx_f + 1,
+ xh_f = r.bottom() - margin - xy_f + 1;
+
+ // Frequency Display
+
+ QString s;
+ if (m_frequency < 10) {
+ s = i18n("%1 kHz").arg(KGlobal::locale()->formatNumber((int)(m_frequency * 1000), 0));
+ } else {
+ s = i18n("%1 MHz").arg(KGlobal::locale()->formatNumber(m_frequency, 2));
+ }
+
+ float pxs = xh_f;
+ paint->setPen ( m_power ? activePen : inactivePen);
+ f.setPixelSize((int)pxs);
+ int n = 30;
+ while (1) {
+ QFontMetrics fm(f);
+ int sw = fm.boundingRect(xx_f, xy_f, xw_f, xh_f, Qt::AlignRight | Qt::AlignVCenter, s).width();
+ if (sw <= xw_f || --n <= 0) break;
+
+ float fact = (float)xw_f / (float)sw;
+ pxs = QMIN(pxs - 1, pxs * fact);
+ f.setPixelSize(QMAX(1,(int)pxs));
+ }
+ paint->setFont(f);
+ paint->drawText(xx_f, xy_f, xw_f, xh_f, Qt::AlignRight | Qt::AlignVCenter, s);
+}
+
+
+
+
+
+
+void RadioViewFrequencyRadio::reparent (QWidget *prnt,
+ WFlags f,
+ const QPoint &p,
+ bool showIt)
+{
+ RadioViewElement::reparent(prnt, f, p, showIt);
+ setDisplayColors(m_colorActiveText, m_colorInactiveText, m_colorButton);
+}
+
+
+#include "radioview_frequencyradio.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview_frequencyradio.h b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.h
new file mode 100644
index 0000000..795eae1
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_frequencyradio.h
@@ -0,0 +1,108 @@
+/***************************************************************************
+ kradiodisplay.h - description
+ -------------------
+ begin : Mit Jan 29 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_FREQUENCYRADIO_H
+#define KRADIO_RADIOVIEW_FREQUENCYRADIO_H
+
+#include "../../src/include/radiodevice_interfaces.h"
+#include "../../src/include/soundstreamclient_interfaces.h"
+#include "radioview_element.h"
+#include "displaycfg_interfaces.h"
+
+/**
+ *@author Martin Witte
+ */
+
+class RadioViewFrequencyRadio : public RadioViewElement, // is a QObject, must be first
+ public IRadioDeviceClient,
+ public IFrequencyRadioClient,
+ public ISoundStreamClient,
+ public IDisplayCfg
+{
+Q_OBJECT
+public:
+ RadioViewFrequencyRadio(QWidget *parent, const QString &name);
+ ~RadioViewFrequencyRadio();
+
+ float getUsability (Interface *) const;
+
+ virtual void saveState (KConfig *) const;
+ virtual void restoreState (KConfig *);
+
+ ConfigPageInfo createConfigurationPage();
+
+// Interface
+
+ bool connectI (Interface *);
+ bool disconnectI(Interface *);
+
+// IDisplayCfg
+
+RECEIVERS:
+ bool setDisplayColors(const QColor &activeColor, const QColor &inactiveColor, const QColor &bkgnd);
+ bool setDisplayFont (const QFont &f);
+
+ANSWERS:
+ const QColor &getDisplayActiveColor() const { return m_colorActiveText; }
+ const QColor &getDisplayInactiveColor() const { return m_colorInactiveText; }
+ const QColor &getDisplayBkgndColor() const { return m_colorButton; }
+ const QFont &getDisplayFont() const { return m_font; }
+
+// IRadioDeviceClient
+RECEIVERS:
+ bool noticePowerChanged (bool on, const IRadioDevice *sender = NULL);
+ bool noticeStationChanged (const RadioStation &, const IRadioDevice *sender = NULL);
+ bool noticeDescriptionChanged (const QString &, const IRadioDevice *sender = NULL);
+ bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/, const IRadioDevice */*sender*/) { return false; }
+
+// ISoundStreamClient
+RECEIVERS:
+ void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
+
+ bool noticeSignalQualityChanged(SoundStreamID id, float q);
+ bool noticeStereoChanged(SoundStreamID id, bool s);
+
+// IFrequencyRadioClient
+RECEIVERS:
+ bool noticeFrequencyChanged(float f, const RadioStation *s);
+ bool noticeMinMaxFrequencyChanged(float min, float max);
+ bool noticeDeviceMinMaxFrequencyChanged(float min, float max);
+ bool noticeScanStepChanged(float s);
+
+// own stuff ;)
+
+public:
+
+ void reparent (QWidget *parent, WFlags f, const QPoint &p, bool showIt = FALSE);
+
+protected:
+
+ void drawContents(QPainter *p);
+
+protected:
+
+ QColor m_colorActiveText, m_colorInactiveText, m_colorButton;
+ QFont m_font;
+
+ bool m_power;
+ bool m_valid;
+ float m_frequency;
+ float m_quality;
+ bool m_stereo;
+};
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.cpp b/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.cpp
new file mode 100644
index 0000000..938939a
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.cpp
@@ -0,0 +1,250 @@
+/***************************************************************************
+ radioview_frequencyseeker.cpp - description
+ -------------------
+ begin : Fre Jun 20 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include <math.h>
+#include <qlayout.h>
+#include <qslider.h>
+#include <qtoolbutton.h>
+#include <qaccel.h>
+#include <qtooltip.h>
+
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "radioview_frequencyseeker.h"
+
+RadioViewFrequencySeeker::RadioViewFrequencySeeker(QWidget *parent, const QString &name)
+ : RadioViewElement(parent, name, clsRadioSeek),
+ m_btnSearchLeft(NULL),
+ m_btnStepLeft(NULL),
+ m_btnStepRight(NULL),
+ m_btnSearchRight(NULL),
+ m_sldFrequency(NULL),
+ m_ignoreChanges(false)
+{
+ QBoxLayout *l = new QBoxLayout(this, QBoxLayout::LeftToRight, /*spacing=*/ 3);
+ l->setMargin(0);
+
+ m_sldFrequency = new QSlider(Qt::Horizontal, this);
+ m_btnSearchLeft = new QToolButton(this);
+ m_btnSearchRight = new QToolButton(this);
+ m_btnStepLeft = new QToolButton(this);
+ m_btnStepRight = new QToolButton(this);
+
+ m_btnSearchLeft ->setToggleButton(true);
+ m_btnSearchRight->setToggleButton(true);
+ m_sldFrequency->setPageStep(1);
+
+ m_btnSearchLeft ->setIconSet(SmallIconSet("2leftarrow"));
+ m_btnSearchRight->setIconSet(SmallIconSet("2rightarrow"));
+ m_btnStepLeft ->setIconSet(SmallIconSet("1leftarrow"));
+ m_btnStepRight ->setIconSet(SmallIconSet("1rightarrow"));
+
+ l->addWidget (m_btnSearchLeft);
+ l->addWidget (m_btnStepLeft);
+ l->addWidget (m_sldFrequency);
+ l->addWidget (m_btnStepRight);
+ l->addWidget (m_btnSearchRight);
+
+ QObject::connect(m_sldFrequency, SIGNAL(valueChanged(int)),
+ this, SLOT(slotSliderChanged(int)));
+ QObject::connect(m_btnSearchLeft, SIGNAL(toggled(bool)),
+ this, SLOT(slotSearchLeft(bool)));
+ QObject::connect(m_btnSearchRight, SIGNAL(toggled(bool)),
+ this, SLOT(slotSearchRight(bool)));
+ QObject::connect(m_btnStepLeft, SIGNAL(clicked()),
+ m_sldFrequency, SLOT(subtractStep()));
+ QObject::connect(m_btnStepRight, SIGNAL(clicked()),
+ m_sldFrequency, SLOT(addStep()));
+
+ // Tooltips
+
+ QToolTip::add(m_btnSearchLeft, i18n("Search for previous Radio Station"));
+ QToolTip::add(m_btnSearchRight, i18n("Search for next Radio Station"));
+ QToolTip::add(m_btnStepLeft, i18n("Decrement Frequency"));
+ QToolTip::add(m_btnStepRight, i18n("Increment Frequency"));
+ QToolTip::add(m_sldFrequency, i18n("Change Frequency"));
+
+ // Accelerators
+
+ QAccel *Accel = new QAccel (this);
+ Accel->insertItem (Key_Left, 100);
+ Accel->insertItem (Key_Right, 101);
+ Accel->connectItem (100, m_sldFrequency, SLOT(subtractStep()));
+ Accel->connectItem (101, m_sldFrequency, SLOT(addStep()));
+}
+
+
+RadioViewFrequencySeeker::~RadioViewFrequencySeeker()
+{
+}
+
+
+float RadioViewFrequencySeeker::getUsability (Interface *i) const
+{
+ if (dynamic_cast<IFrequencyRadio*>(i))
+ return 0.9;
+ else
+ return 0.0;
+}
+
+
+// Interface
+
+bool RadioViewFrequencySeeker::connectI (Interface *i)
+{
+ if (IFrequencyRadioClient::connectI(i)) {
+ ISeekRadioClient::connectI(i);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
+bool RadioViewFrequencySeeker::disconnectI(Interface *i)
+{
+ bool a = IFrequencyRadioClient::disconnectI(i);
+ bool b = ISeekRadioClient::disconnectI(i);
+ return a || b;
+}
+
+
+
+// ISeekRadioClient
+
+bool RadioViewFrequencySeeker::noticeSeekStarted (bool up)
+{
+ m_ignoreChanges = true;
+ m_btnSearchLeft->setOn(!up);
+ m_btnSearchRight->setOn(up);
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+bool RadioViewFrequencySeeker::noticeSeekStopped ()
+{
+ m_ignoreChanges = true;
+ m_btnSearchLeft->setOn(false);
+ m_btnSearchRight->setOn(false);
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+bool RadioViewFrequencySeeker::noticeSeekFinished (const RadioStation &/*s*/, bool /*goodQuality*/)
+{
+ m_ignoreChanges = true;
+ m_btnSearchLeft->setOn(false);
+ m_btnSearchRight->setOn(false);
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+
+// IFrequencyRadioClient
+
+bool RadioViewFrequencySeeker::noticeFrequencyChanged(float f, const RadioStation */*s*/)
+{
+ float step = queryScanStep();
+ if (step == 0) step = 0.000001;
+
+ m_ignoreChanges = true;
+ m_sldFrequency->setValue((int)rint(f / step));
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+bool RadioViewFrequencySeeker::noticeMinMaxFrequencyChanged(float min, float max)
+{
+ float step = queryScanStep();
+ if (step == 0) step = 0.000001;
+
+ m_ignoreChanges = true;
+ m_sldFrequency->setMinValue((int)rint(min / step));
+ m_sldFrequency->setMaxValue((int)rint(max / step));
+ m_sldFrequency->setValue ((int)rint(queryFrequency() / step));
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+bool RadioViewFrequencySeeker::noticeDeviceMinMaxFrequencyChanged(float /*min*/, float /*max*/)
+{
+ return false; // we don't care
+}
+
+
+bool RadioViewFrequencySeeker::noticeScanStepChanged(float s)
+{
+ if (s == 0) s = 0.000001;
+ m_ignoreChanges = true;
+ m_sldFrequency->setMinValue((int)rint(queryMinFrequency() / s));
+ m_sldFrequency->setMaxValue((int)rint(queryMaxFrequency() / s));
+ m_sldFrequency->setValue ((int)rint(queryFrequency() / s));
+ m_ignoreChanges = false;
+ return true;
+}
+
+
+void RadioViewFrequencySeeker::slotSearchLeft(bool on)
+{
+ if (m_ignoreChanges) return;
+ if (on) {
+ if (queryIsSeekUpRunning())
+ sendStopSeek();
+ if (!queryIsSeekRunning())
+ sendStartSeekDown();
+ } else {
+ if (queryIsSeekDownRunning())
+ sendStopSeek();
+ }
+ if (!queryIsSeekDownRunning())
+ m_btnSearchLeft->setOn(false);
+}
+
+
+void RadioViewFrequencySeeker::slotSearchRight(bool on)
+{
+ if (m_ignoreChanges) return;
+ if (on) {
+ if (queryIsSeekDownRunning())
+ sendStopSeek();
+ if (!queryIsSeekRunning())
+ sendStartSeekUp();
+ } else {
+ if (queryIsSeekUpRunning())
+ sendStopSeek();
+ }
+ if (!queryIsSeekUpRunning())
+ m_btnSearchRight->setOn(false);
+}
+
+
+void RadioViewFrequencySeeker::slotSliderChanged(int val)
+{
+ if (m_ignoreChanges) return;
+ sendFrequency(val * queryScanStep());
+}
+
+
+
+
+#include "radioview_frequencyseeker.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.h b/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.h
new file mode 100644
index 0000000..12ca7d4
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_frequencyseeker.h
@@ -0,0 +1,78 @@
+/***************************************************************************
+ radioview_frequencyseeker.h - description
+ -------------------
+ begin : Fre Jun 20 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_FREQUENCYSEEKER_H
+#define KRADIO_RADIOVIEW_FREQUENCYSEEKER_H
+
+#include "../../src/include/radiodevice_interfaces.h"
+#include "radioview_element.h"
+
+class QToolButton;
+class QSlider;
+
+class RadioViewFrequencySeeker : public RadioViewElement, // is a QObject, must be first
+ public ISeekRadioClient,
+ public IFrequencyRadioClient
+{
+Q_OBJECT
+public:
+ RadioViewFrequencySeeker(QWidget *parent, const QString &name);
+ ~RadioViewFrequencySeeker();
+
+ float getUsability(Interface *) const;
+
+// Interface
+
+ bool connectI (Interface *);
+ bool disconnectI(Interface *);
+
+// ISeekRadioClient
+RECEIVERS:
+ bool noticeSeekStarted (bool up);
+ bool noticeSeekStopped ();
+ bool noticeSeekFinished (const RadioStation &s, bool goodQuality);
+ bool noticeProgress (float ) { return false; }
+
+// IFrequencyRadioClient
+RECEIVERS:
+ bool noticeFrequencyChanged(float f, const RadioStation *s);
+ bool noticeMinMaxFrequencyChanged(float min, float max);
+ bool noticeDeviceMinMaxFrequencyChanged(float min, float max);
+ bool noticeScanStepChanged(float s);
+
+// own stuff ;)
+
+protected slots:
+
+ void slotSearchLeft(bool on);
+ void slotSearchRight(bool on);
+ void slotSliderChanged(int val);
+
+protected:
+
+ QToolButton *m_btnSearchLeft,
+ *m_btnStepLeft,
+ *m_btnStepRight,
+ *m_btnSearchRight;
+ QSlider *m_sldFrequency;
+
+ bool m_ignoreChanges;
+};
+
+
+
+#endif
diff --git a/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui b/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui
new file mode 100644
index 0000000..f4fc98c
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui
@@ -0,0 +1,167 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>RadioView_SeekerUI</class>
+<author>Ernst Martin Witte</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>RadioView_SeekerUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>477</width>
+ <height>43</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>RadioView_SeekInterface</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QToolButton" row="0" column="0">
+ <property name="name">
+ <cstring>btnSearchDown</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="iconSet">
+ <iconset>"2rightarrow"</iconset>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>search previous station</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="0" column="1">
+ <property name="name">
+ <cstring>btnStepDown</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="autoRepeat">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>"2rightarrow"</iconset>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>decrease freq. by 0.05 MHz</string>
+ </property>
+ </widget>
+ <widget class="QSlider" row="0" column="2">
+ <property name="name">
+ <cstring>sldRange</cstring>
+ </property>
+ <property name="minValue">
+ <number>8700</number>
+ </property>
+ <property name="maxValue">
+ <number>10900</number>
+ </property>
+ <property name="lineStep">
+ <number>5</number>
+ </property>
+ <property name="pageStep">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>8700</number>
+ </property>
+ <property name="tracking">
+ <bool>true</bool>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="tickmarks">
+ <enum>NoMarks</enum>
+ </property>
+ <property name="tickInterval">
+ <number>100</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Frequency control</string>
+ <comment>Frequency</comment>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="0" column="3">
+ <property name="name">
+ <cstring>btnStepUp</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="autoRepeat">
+ <bool>true</bool>
+ </property>
+ <property name="iconSet">
+ <iconset>"2rightarrow"</iconset>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>increase freq. by 0.05 MHz</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="0" column="4">
+ <property name="name">
+ <cstring>btnSearchUp</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>TabFocus</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="iconSet">
+ <iconset>"2rightarrow"</iconset>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>search next station</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>btnSearchDown</tabstop>
+ <tabstop>btnStepDown</tabstop>
+ <tabstop>sldRange</tabstop>
+ <tabstop>btnStepUp</tabstop>
+ <tabstop>btnSearchUp</tabstop>
+</tabstops>
+<includes>
+ <include location="local" impldecl="in implementation">radioview_seekinterface.ui.h</include>
+</includes>
+<functions>
+ <function access="protected">init()</function>
+ <function>destroy()</function>
+</functions>
+<pixmapfunction>SmallIconSet</pixmapfunction>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui.h b/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui.h
new file mode 100644
index 0000000..1f75180
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_seekinterface.ui.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+void RadioView_SeekerUI::init()
+{
+ Accel = new QAccel (this);
+ Accel->insertItem (Key_Left, 100);
+ Accel->insertItem (Key_Right, 101);
+ Accel->connectItem (100, sldRange, SLOT(subtractStep()));
+ Accel->connectItem (101, sldRange, SLOT(addStep()));
+}
+
+void RadioView_SeekerUI::destroy()
+{
+}
diff --git a/kradio3/plugins/gui-standard-display/radioview_volume.cpp b/kradio3/plugins/gui-standard-display/radioview_volume.cpp
new file mode 100644
index 0000000..d642aa4
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_volume.cpp
@@ -0,0 +1,141 @@
+/***************************************************************************
+ radioview_volume.cpp - description
+ -------------------
+ begin : Don Jun 19 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include <math.h>
+#include <qslider.h>
+#include <qlayout.h>
+#include <qaccel.h>
+#include <qtooltip.h>
+
+#include <klocale.h>
+
+#include "radioview_volume.h"
+#include "../../src/include/plugins.h"
+
+#define SLIDER_MINVAL 0
+#define SLIDER_MAXVAL 32768
+#define SLIDER_RANGE (SLIDER_MAXVAL - SLIDER_MINVAL)
+
+RadioViewVolume::RadioViewVolume(QWidget *parent, const QString &name)
+ : RadioViewElement (parent, name, clsRadioSound),
+ m_slider(NULL),
+ m_handlingSlot(false)
+{
+ float v = 0;
+ SoundStreamID ssid = queryCurrentSoundStreamID();
+ sendLogDebug (QString ("RadioViewVolume: ssid=%1").arg(ssid.getID()));
+ queryPlaybackVolume(ssid, v);
+ m_slider = new QSlider(SLIDER_MINVAL,
+ SLIDER_MAXVAL,
+ SLIDER_RANGE/10,
+ getSlider4Volume(v),
+ Qt::Vertical, this);
+
+ QObject::connect(m_slider, SIGNAL(valueChanged(int)),
+ this, SLOT(slotVolumeChanged(int)));
+
+ QBoxLayout *l = new QBoxLayout(this, QBoxLayout::LeftToRight);
+ l->addWidget(m_slider);
+
+ // Tooltips
+
+ QToolTip::add(m_slider, i18n("Change Volume"));
+
+ // Accelerators
+ QAccel *Accel = new QAccel (this);
+ Accel->insertItem (Key_Up, 100);
+ Accel->insertItem (Key_Down, 101);
+ Accel->connectItem (100, m_slider, SLOT(subtractStep()));
+ Accel->connectItem (101, m_slider, SLOT(addStep()));
+
+}
+
+
+RadioViewVolume::~RadioViewVolume()
+{
+}
+
+
+float RadioViewVolume::getUsability (Interface */*i*/) const
+{
+ return 0.5; // there could be more features like mute control, capture settings, ...
+}
+
+
+bool RadioViewVolume::connectI (Interface *i)
+{
+ bool a = IRadioDeviceClient::connectI(i);
+ bool b = ISoundStreamClient::connectI(i);
+ return a || b;
+}
+
+
+bool RadioViewVolume::disconnectI(Interface *i)
+{
+ bool a = IRadioDeviceClient::disconnectI(i);
+ bool b = ISoundStreamClient::disconnectI(i);
+ return a || b;
+}
+
+void RadioViewVolume::noticeConnectedI (ISoundStreamServer *s, bool pointer_valid)
+{
+ ISoundStreamClient::noticeConnectedI(s, pointer_valid);
+ if (s && pointer_valid) {
+ s->register4_notifyPlaybackVolumeChanged(this);
+ }
+}
+
+// ISoundStreamClient
+
+bool RadioViewVolume::noticePlaybackVolumeChanged(SoundStreamID id, float v)
+{
+ if (queryCurrentSoundStreamID() != id)
+ return false;
+ m_slider->setValue(getSlider4Volume(v));
+ return true;
+}
+
+
+
+void RadioViewVolume::slotVolumeChanged(int val)
+{
+ if (m_handlingSlot) return;
+ m_handlingSlot = true;
+ SoundStreamID ssid = queryCurrentSoundStreamID();
+ sendPlaybackVolume(ssid, getVolume4Slider(val));
+ m_handlingSlot = false;
+}
+
+
+int RadioViewVolume::getSlider4Volume(float volume)
+{
+ if (volume >= 1) volume = 1;
+ if (volume < 0) volume = 0;
+ return SLIDER_MAXVAL - (int)rint(SLIDER_RANGE * volume);
+}
+
+
+float RadioViewVolume::getVolume4Slider(int sl)
+{
+ if (sl > SLIDER_MAXVAL) sl = SLIDER_MAXVAL;
+ if (sl < SLIDER_MINVAL) sl = SLIDER_MINVAL;
+ return (float)(SLIDER_MAXVAL - sl) / (float)SLIDER_RANGE;
+}
+
+
+
+#include "radioview_volume.moc"
diff --git a/kradio3/plugins/gui-standard-display/radioview_volume.h b/kradio3/plugins/gui-standard-display/radioview_volume.h
new file mode 100644
index 0000000..a48c16d
--- /dev/null
+++ b/kradio3/plugins/gui-standard-display/radioview_volume.h
@@ -0,0 +1,75 @@
+/***************************************************************************
+ radioview_volume.h - description
+ -------------------
+ begin : Don Jun 19 2003
+ copyright : (C) 2003 by Martin Witte
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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_RADIOVIEW_VOLUME_H
+#define KRADIO_RADIOVIEW_VOLUME_H
+
+#include "../../src/include/radiodevice_interfaces.h"
+#include "../../src/include/soundstreamclient_interfaces.h"
+#include "radioview_element.h"
+
+/**
+ *@author Martin Witte
+ */
+
+class QSlider;
+
+class RadioViewVolume : public RadioViewElement, // is a QObject, must be first
+ public IRadioDeviceClient,
+ public ISoundStreamClient,
+ public IErrorLogClient
+{
+Q_OBJECT
+public:
+ RadioViewVolume(QWidget *parent, const QString &name);
+ ~RadioViewVolume();
+
+ float getUsability(Interface *) const;
+
+// Interface
+
+ bool connectI (Interface *);
+ bool disconnectI(Interface *);
+
+// IRadioDeviceClient
+RECEIVERS:
+ bool noticePowerChanged (bool /*on*/, const IRadioDevice */*sender*/) { return false; }
+ bool noticeStationChanged (const RadioStation &, const IRadioDevice */*sender*/) { return false; }
+ bool noticeDescriptionChanged (const QString &, const IRadioDevice */*sender*/) { return false; }
+ bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/, const IRadioDevice */*sender*/) { return false; }
+
+// ISoundStreamClient
+RECEIVERS:
+ void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
+ bool noticePlaybackVolumeChanged(SoundStreamID id, float v);
+
+// own stuff
+protected slots:
+
+ void slotVolumeChanged(int val);
+
+protected:
+
+ int getSlider4Volume(float volume);
+ float getVolume4Slider(int sl);
+
+ QSlider *m_slider;
+ bool m_handlingSlot;
+
+};
+
+#endif