summaryrefslogtreecommitdiffstats
path: root/tderadio3/plugins/lirc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 17:25:34 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-02-01 17:25:34 -0600
commit48906a623383ab5222541ae048e99dd039b62a9a (patch)
tree1c5f588e90899bb1301f79cf97b8f6ddc0b1c367 /tderadio3/plugins/lirc
parenta1e6ce502c334194d31a0b78b11b77e9532da64b (diff)
downloadtderadio-48906a623383ab5222541ae048e99dd039b62a9a.tar.gz
tderadio-48906a623383ab5222541ae048e99dd039b62a9a.zip
Fix FTBFS
Diffstat (limited to 'tderadio3/plugins/lirc')
-rw-r--r--tderadio3/plugins/lirc/Makefile.am28
-rw-r--r--tderadio3/plugins/lirc/default-dot-lircrc6
-rw-r--r--tderadio3/plugins/lirc/lirc-configuration-ui.ui110
-rw-r--r--tderadio3/plugins/lirc/lirc-configuration.cpp193
-rw-r--r--tderadio3/plugins/lirc/lirc-configuration.h61
-rw-r--r--tderadio3/plugins/lirc/lircsupport.cpp553
-rw-r--r--tderadio3/plugins/lirc/lircsupport.h160
-rw-r--r--tderadio3/plugins/lirc/listviewitem_lirc.cpp51
-rw-r--r--tderadio3/plugins/lirc/listviewitem_lirc.h52
-rw-r--r--tderadio3/plugins/lirc/po/Makefile.am2
-rw-r--r--tderadio3/plugins/lirc/po/de.po213
-rw-r--r--tderadio3/plugins/lirc/po/ru.po209
12 files changed, 1638 insertions, 0 deletions
diff --git a/tderadio3/plugins/lirc/Makefile.am b/tderadio3/plugins/lirc/Makefile.am
new file mode 100644
index 0000000..383fe28
--- /dev/null
+++ b/tderadio3/plugins/lirc/Makefile.am
@@ -0,0 +1,28 @@
+
+SUBDIRS = po .
+
+INCLUDES = $(all_includes)
+METASOURCES = AUTO
+
+libkradio_LTLIBRARIES = liblirc.la
+liblirc_la_SOURCES = lircsupport.cpp lirc-configuration-ui.ui \
+ lirc-configuration.cpp listviewitem_lirc.cpp
+liblirc_la_LDFLAGS = -module -avoid-version $(KDE_RPATH) $(all_libraries)
+liblirc_la_LIBADD = $(LIB_LIRC)
+
+noinst_HEADERS = lircsupport.h lirc-configuration.h listviewitem_lirc.h
+
+
+install-data-local:
+ $(mkinstalldirs) "$(DESTDIR)$(kde_datadir)/kradio/"
+ $(INSTALL_DATA) "$(srcdir)/default-dot-lircrc" "$(DESTDIR)$(kde_datadir)/kradio/default-dot-lircrc"
+
+uninstall-local:
+ -rm -f "$(DESTDIR)$(kde_datadir)/kradio/default-dot-lircrc"
+
+#messages: rc.cpp
+# $(XGETTEXT) *.cpp *.h -o po/kradio-lirc.pot
+
+messages: rc.cpp
+ $(EXTRACTRC) *.rc *.ui >> rc.cpp
+ $(XGETTEXT) rc.cpp *.h *.cpp -o po/kradio-lirc.pot
diff --git a/tderadio3/plugins/lirc/default-dot-lircrc b/tderadio3/plugins/lirc/default-dot-lircrc
new file mode 100644
index 0000000..02ac704
--- /dev/null
+++ b/tderadio3/plugins/lirc/default-dot-lircrc
@@ -0,0 +1,6 @@
+
+begin
+ prog = kradio
+ config = eventmap
+ repeat = 1
+end
diff --git a/tderadio3/plugins/lirc/lirc-configuration-ui.ui b/tderadio3/plugins/lirc/lirc-configuration-ui.ui
new file mode 100644
index 0000000..b648265
--- /dev/null
+++ b/tderadio3/plugins/lirc/lirc-configuration-ui.ui
@@ -0,0 +1,110 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>LIRCConfigurationUI</class>
+<author>Ernst Martin Witte</author>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>LIRCConfigurationUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>585</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>LIRCConfigurationUI</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TDEListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Action</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>LIRC String</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Alternative LIRC String</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>m_ActionList</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="itemMargin">
+ <number>2</number>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ <property name="resizeMode">
+ <enum>AllColumns</enum>
+ </property>
+ <property name="defaultRenameAction">
+ <enum>Accept</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="Line" row="1" column="0">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_LabelHints</cstring>
+ </property>
+ <property name="text">
+ <string>textLabel1</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<pixmapfunction>SmallIconSet</pixmapfunction>
+<layoutdefaults spacing="6" margin="0"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/tderadio3/plugins/lirc/lirc-configuration.cpp b/tderadio3/plugins/lirc/lirc-configuration.cpp
new file mode 100644
index 0000000..8e39846
--- /dev/null
+++ b/tderadio3/plugins/lirc/lirc-configuration.cpp
@@ -0,0 +1,193 @@
+/***************************************************************************
+ lirc-configuration.cpp - description
+ -------------------
+ begin : Sat May 21 2005
+ copyright : (C) 2005 by Martin Witte
+ email : witte@kawo1.rwth-aachen.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <klistview.h>
+#include <klocale.h>
+
+#include <tqlistview.h>
+#include <tqlabel.h>
+
+#include "lirc-configuration.h"
+#include "lircsupport.h"
+#include "listviewitem_lirc.h"
+
+LIRCConfiguration::LIRCConfiguration (TQWidget *parent, LircSupport *dev)
+ : LIRCConfigurationUI(parent),
+ m_LIRC (dev),
+ m_dirty(true),
+ m_ignore_gui_updates(false)
+{
+ m_descriptions[LIRC_DIGIT_0] = i18n("digit 0");
+ m_descriptions[LIRC_DIGIT_1] = i18n("digit 1");
+ m_descriptions[LIRC_DIGIT_2] = i18n("digit 2");
+ m_descriptions[LIRC_DIGIT_3] = i18n("digit 3");
+ m_descriptions[LIRC_DIGIT_4] = i18n("digit 4");
+ m_descriptions[LIRC_DIGIT_5] = i18n("digit 5");
+ m_descriptions[LIRC_DIGIT_6] = i18n("digit 6");
+ m_descriptions[LIRC_DIGIT_7] = i18n("digit 7");
+ m_descriptions[LIRC_DIGIT_8] = i18n("digit 8");
+ m_descriptions[LIRC_DIGIT_9] = i18n("digit 9");
+ m_descriptions[LIRC_POWER_ON] = i18n("Power On");
+ m_descriptions[LIRC_POWER_OFF] = i18n("Power Off");
+ m_descriptions[LIRC_PAUSE] = i18n("Pause");
+ m_descriptions[LIRC_RECORD_START] = i18n("Start Recording");
+ m_descriptions[LIRC_RECORD_STOP] = i18n("Stop Recording");
+ m_descriptions[LIRC_VOLUME_INC] = i18n("Increase Volume");
+ m_descriptions[LIRC_VOLUME_DEC] = i18n("Decrease Volume");
+ m_descriptions[LIRC_CHANNEL_NEXT] = i18n("Next Channel");
+ m_descriptions[LIRC_CHANNEL_PREV] = i18n("Previous Channel");
+ m_descriptions[LIRC_SEARCH_NEXT] = i18n("Search Next Channel");
+ m_descriptions[LIRC_SEARCH_PREV] = i18n("Search Previous Channel");
+ m_descriptions[LIRC_SLEEP] = i18n("Enable Sleep Countdown");
+ m_descriptions[LIRC_APPLICATION_QUIT] = i18n("Quit TDERadio");
+
+ int k = 0;
+ m_order[k++] = LIRC_DIGIT_0;
+ m_order[k++] = LIRC_DIGIT_1;
+ m_order[k++] = LIRC_DIGIT_2;
+ m_order[k++] = LIRC_DIGIT_3;
+ m_order[k++] = LIRC_DIGIT_4;
+ m_order[k++] = LIRC_DIGIT_5;
+ m_order[k++] = LIRC_DIGIT_6;
+ m_order[k++] = LIRC_DIGIT_7;
+ m_order[k++] = LIRC_DIGIT_8;
+ m_order[k++] = LIRC_DIGIT_9;
+ m_order[k++] = LIRC_POWER_ON;
+ m_order[k++] = LIRC_POWER_OFF;
+ m_order[k++] = LIRC_PAUSE;
+ m_order[k++] = LIRC_RECORD_START;
+ m_order[k++] = LIRC_RECORD_STOP;
+ m_order[k++] = LIRC_VOLUME_INC;
+ m_order[k++] = LIRC_VOLUME_DEC;
+ m_order[k++] = LIRC_CHANNEL_NEXT;
+ m_order[k++] = LIRC_CHANNEL_PREV;
+ m_order[k++] = LIRC_SEARCH_NEXT;
+ m_order[k++] = LIRC_SEARCH_PREV;
+ m_order[k++] = LIRC_SLEEP;
+ m_order[k++] = LIRC_APPLICATION_QUIT;
+
+ m_ActionList->setSorting(-1);
+ m_ActionList->setColumnWidthMode(0, TQListView::Maximum);
+ m_ActionList->setColumnWidthMode(1, TQListView::Maximum);
+ m_ActionList->setColumnWidthMode(2, TQListView::Maximum);
+
+ connect(m_ActionList, TQT_SIGNAL(itemRenamed(TQListViewItem*, int)), this, TQT_SLOT(slotSetDirty()));
+ slotCancel();
+}
+
+
+LIRCConfiguration::~LIRCConfiguration ()
+{
+}
+
+
+void LIRCConfiguration::slotOK()
+{
+ if (m_dirty && m_LIRC) {
+ TQListViewItem *item = m_ActionList->firstChild();
+
+ TQMap<LIRC_Actions, TQString> actions;
+ TQMap<LIRC_Actions, TQString> alt_actions;
+
+ for (int i = 0; item; ++i, item = item->nextSibling()) {
+ LIRC_Actions action = m_order[i];
+ actions[action] = item->text(1);
+ alt_actions[action] = item->text(2);
+ }
+ m_LIRC->setActions(actions, alt_actions);
+ }
+ m_dirty = false;
+}
+
+
+void LIRCConfiguration::slotCancel()
+{
+ if (m_dirty) {
+ m_ignore_gui_updates = true;
+ m_ActionList->clear();
+ if (m_LIRC) {
+ const TQMap<LIRC_Actions, TQString> &actions = m_LIRC->getActions();
+ const TQMap<LIRC_Actions, TQString> &alt_actions = m_LIRC->getAlternativeActions();
+
+ for (unsigned i = 0; m_order.contains(i) && i < m_order.count(); ++i) {
+ LIRC_Actions action = m_order[i];
+ addKey(m_descriptions[action], actions[action], alt_actions[action]);
+ }
+ }
+
+ slotRenamingStopped(NULL, -1);
+ m_ignore_gui_updates = false;
+ }
+ m_dirty = false;
+}
+
+
+void LIRCConfiguration::addKey(const TQString &descr, const TQString &key, const TQString &alt_key)
+{
+ ListViewItemLirc *item = new ListViewItemLirc(m_ActionList, m_ActionList->lastChild());
+ if (item) {
+ TQObject::connect(item, TQT_SIGNAL(sigRenamingStarted (ListViewItemLirc *, int)),
+ this, TQT_SLOT (slotRenamingStarted(ListViewItemLirc *, int)));
+ TQObject::connect(item, TQT_SIGNAL(sigRenamingStopped (ListViewItemLirc *, int)),
+ this, TQT_SLOT (slotRenamingStopped(ListViewItemLirc *, int)));
+ item->setText(0, descr);
+ item->setText(1, key);
+ item->setText(2, alt_key);
+ item->setRenameEnabled(1, true);
+ item->setRenameEnabled(2, true);
+ }
+}
+
+void LIRCConfiguration::slotUpdateConfig()
+{
+ slotSetDirty();
+ slotCancel();
+}
+
+void LIRCConfiguration::slotRawLIRCSignal(const TQString &val, int /*repeat_counter*/, bool &consumed)
+{
+ TQListViewItem *_it = m_ActionList->currentItem();
+ ListViewItemLirc *it = static_cast<ListViewItemLirc*>(_it);
+ if (it->isRenamingInProcess()) {
+ int col = it->getRenamingColumn();
+ it->cancelRename(col);
+ it->setText(col, val);
+ consumed = true;
+ m_dirty = true;
+ }
+}
+
+void LIRCConfiguration::slotRenamingStarted(ListViewItemLirc */*sender*/, int /*col*/)
+{
+ m_LabelHints->setText(i18n("Enter the key string of your remote or just press the button on your remote control"));
+}
+
+
+void LIRCConfiguration::slotRenamingStopped(ListViewItemLirc */*sender*/, int /*col*/)
+{
+ m_LabelHints->setText(i18n("Double Click on the entries to change the assignments"));
+}
+
+
+void LIRCConfiguration::slotSetDirty()
+{
+ if (!m_ignore_gui_updates) {
+ m_dirty = true;
+ }
+}
+
+#include "lirc-configuration.moc"
diff --git a/tderadio3/plugins/lirc/lirc-configuration.h b/tderadio3/plugins/lirc/lirc-configuration.h
new file mode 100644
index 0000000..70c1ae2
--- /dev/null
+++ b/tderadio3/plugins/lirc/lirc-configuration.h
@@ -0,0 +1,61 @@
+/***************************************************************************
+ lirc-configuration.h - description
+ -------------------
+ begin : Sat May 21 2005
+ copyright : (C) 2005 by Martin Witte
+ email : witte@kawo1.rwth-aachen.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KRADIO_LIRC_CONFIGURATION_H
+#define KRADIO_LIRC_CONFIGURATION_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "lirc-configuration-ui.h"
+#include "lircsupport.h"
+#include "listviewitem_lirc.h"
+
+class LIRCConfiguration : public LIRCConfigurationUI
+{
+Q_OBJECT
+
+public :
+ LIRCConfiguration (TQWidget *parent, LircSupport *);
+ ~LIRCConfiguration ();
+
+protected slots:
+
+ void slotOK();
+ void slotCancel();
+ void slotSetDirty();
+
+ void slotUpdateConfig();
+ void slotRawLIRCSignal(const TQString &val, int repeat_counter, bool &consumed);
+
+ void slotRenamingStarted(ListViewItemLirc *, int);
+ void slotRenamingStopped(ListViewItemLirc *, int);
+
+protected:
+ void addKey(const TQString &descr, const TQString &key, const TQString &alt_key);
+
+ LircSupport *m_LIRC;
+
+ TQMap<int, LIRC_Actions> m_order;
+ TQMap<LIRC_Actions, TQString> m_descriptions;
+
+ bool m_dirty;
+ bool m_ignore_gui_updates;
+};
+
+#endif
diff --git a/tderadio3/plugins/lirc/lircsupport.cpp b/tderadio3/plugins/lirc/lircsupport.cpp
new file mode 100644
index 0000000..dcafb7f
--- /dev/null
+++ b/tderadio3/plugins/lirc/lircsupport.cpp
@@ -0,0 +1,553 @@
+/***************************************************************************
+ lircsupport.cpp - description
+ -------------------
+ begin : Mon Feb 4 2002
+ copyright : (C) 2002 by Martin Witte / Frank Schwanz
+ email : witte@kawo1.rwth-aachen.de / schwanz@fh-brandenburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "lircsupport.h"
+
+#ifdef HAVE_LIRC
+#include <lirc/lirc_client.h>
+#endif
+
+#include <tqsocketnotifier.h>
+#include <tqtimer.h>
+#include <tqfile.h>
+
+#include <kapplication.h>
+#include <kaboutdata.h>
+#include <kstandarddirs.h>
+
+#include "../../src/include/errorlog-interfaces.h"
+#include "../../src/include/radiodevice_interfaces.h"
+#include "../../src/include/stationlist.h"
+#include "../../src/include/aboutwidget.h"
+
+#include "lirc-configuration.h"
+
+#include <cstdlib>
+
+#define LIRCRC ".lircrc"
+
+///////////////////////////////////////////////////////////////////////
+//// plugin library functions
+
+//#ifdef HAVE_LIRC
+PLUGIN_LIBRARY_FUNCTIONS(LircSupport, "kradio-lirc", i18n("Linux Infrared Control (LIRC) Support"));
+//#endif
+
+/////////////////////////////////////////////////////////////////////////////
+
+LircSupport::LircSupport(const TQString &name)
+ : PluginBase(name, i18n("LIRC Plugin")),
+ m_TakeRawLIRC(false)
+{
+
+#ifdef HAVE_LIRC
+ logDebug(i18n("initializing kradio lirc plugin"));
+ fprintf (stderr, "%s\n", (const char*)i18n("initializing kradio lirc plugin").utf8());
+ char *prg = (char*)"kradio";
+
+ TQString slircrc = getenv("HOME");
+ slircrc += "/" LIRCRC;
+
+ TQFile lircrc(slircrc);
+ if (!lircrc.exists()) {
+ logWarning(i18n("%1 does not exist. File was created with TDERadio's default .lircrc proposal").arg(LIRCRC));
+ TQFile default_lircrc(locate("data", "kradio/default-dot-lircrc"));
+ lircrc.open(IO_WriteOnly);
+ default_lircrc.open(IO_ReadOnly);
+ char *buf = new char [default_lircrc.size() + 1];
+ default_lircrc.readBlock(buf, default_lircrc.size());
+ lircrc.writeBlock(buf, default_lircrc.size());
+ lircrc.close();
+ default_lircrc.close();
+ delete buf;
+ }
+
+ m_fd_lirc = lirc_init(prg, 1);
+ m_lirc_notify = 0;
+ m_lircConfig = 0;
+
+ if (m_fd_lirc != -1) {
+ if (lirc_readconfig (NULL, &m_lircConfig, NULL) == 0) {
+ m_lirc_notify = new TQSocketNotifier(m_fd_lirc, TQSocketNotifier::Read, this, "lirc_notifier");
+ if (m_lirc_notify)
+ TQObject::connect(m_lirc_notify, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotLIRC(int)));
+
+ // check config
+ lirc_config_entry *found = NULL;
+ for (lirc_config_entry *e = m_lircConfig->first; e; e = e->next) {
+ if (TQString(e->prog) == prg)
+ found = e;
+ }
+ if (!found) {
+ logWarning(i18n("There is no entry for kradio in any of your .lircrc files."));
+ logWarning(i18n("Please setup your .lircrc files correctly."));
+ m_TakeRawLIRC = true;
+ }
+
+ } else {
+ lirc_deinit();
+ m_fd_lirc = -1;
+ }
+ }
+
+ if (m_fd_lirc == -1) {
+ logWarning(i18n("Initializing kradio lirc plugin failed"));
+ fprintf (stderr, "%s\n", (const char*)i18n("Initializing kradio lirc plugin failed").utf8());
+ } else {
+ logDebug(i18n("Initializing kradio lirc plugin successful"));
+ fprintf (stderr, "%s\n", (const char*)i18n("Initializing kradio lirc plugin successful").utf8());
+ }
+#endif
+
+ m_kbdTimer = new TQTimer (this);
+ TQObject::connect (m_kbdTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotKbdTimedOut()));
+
+ m_addIndex = 0;
+}
+
+
+LircSupport::~LircSupport()
+{
+#ifdef HAVE_LIRC
+ if (m_fd_lirc != -1)
+ lirc_deinit();
+ if (m_lircConfig)
+ lirc_freeconfig(m_lircConfig);
+ m_fd_lirc = -1;
+ m_lircConfig = 0;
+#endif
+}
+
+
+void LircSupport::slotLIRC(int /*socket*/ )
+{
+#ifdef HAVE_LIRC
+ if (!m_lircConfig || !m_lirc_notify || m_fd_lirc == -1)
+ return;
+
+ char *code = 0, *c = 0;
+ if (lirc_nextcode(&code) == 0) {
+ while(m_TakeRawLIRC || (lirc_code2char (m_lircConfig, code, &c) == 0 && c != NULL)) {
+
+ TQString x = c;
+ int repeat_counter = 1;
+ if (m_TakeRawLIRC || (TQString(c) == "eventmap")) {
+ TQStringList l = TQStringList::split(" ", code);
+ if (l.count() >=4) {
+ x = l[2];
+ repeat_counter = l[1].toInt(NULL, 16);
+ }
+ }
+
+ bool consumed = false;
+ logDebug(TQString("LIRC: ") + x);
+
+ emit sigRawLIRCSignal(x, repeat_counter, consumed);
+
+ if (!consumed) {
+ if (!checkActions(x, repeat_counter, m_Actions))
+ checkActions(x, repeat_counter, m_AlternativeActions);
+ }
+ }
+ }
+ else {
+ // some error has occurred on the socket => close lirc plugin
+ logWarning(i18n("Reading from LIRC socket failed. Disabling LIRC Functions till next start of kradio"));
+ delete m_lirc_notify;
+ m_lirc_notify = NULL;
+ }
+
+ if (code)
+ free (code);
+#endif
+}
+
+
+void LircSupport::slotKbdTimedOut()
+{
+ activateStation (m_addIndex);
+ m_addIndex = 0;
+}
+
+
+void LircSupport::activateStation (int i)
+{
+ if (! sendActivateStation(i - 1))
+ sendActivateStation( (i + 9) % 10);
+}
+
+
+bool LircSupport::connectI (Interface *i)
+{
+ bool a = IRadioClient::connectI (i);
+ bool b = ITimeControlClient::connectI (i);
+ bool c = IRadioDevicePoolClient::connectI (i);
+ bool d = PluginBase::connectI(i);
+ bool e = ISoundStreamClient::connectI(i);
+ return a || b || c || d || e;
+}
+
+
+bool LircSupport::disconnectI (Interface *i)
+{
+ bool a = IRadioClient::disconnectI (i);
+ bool b = ITimeControlClient::disconnectI (i);
+ bool c = IRadioDevicePoolClient::disconnectI (i);
+ bool d = PluginBase::disconnectI(i);
+ bool e = ISoundStreamClient::disconnectI(i);
+ return a || b || c || d || e;
+}
+
+
+
+void LircSupport::saveState (TDEConfig *c) const
+{
+ c->writeEntry("LIRC_DIGIT_0", m_Actions[LIRC_DIGIT_0]);
+ c->writeEntry("LIRC_DIGIT_1", m_Actions[LIRC_DIGIT_1]);
+ c->writeEntry("LIRC_DIGIT_2", m_Actions[LIRC_DIGIT_2]);
+ c->writeEntry("LIRC_DIGIT_3", m_Actions[LIRC_DIGIT_3]);
+ c->writeEntry("LIRC_DIGIT_4", m_Actions[LIRC_DIGIT_4]);
+ c->writeEntry("LIRC_DIGIT_5", m_Actions[LIRC_DIGIT_5]);
+ c->writeEntry("LIRC_DIGIT_6", m_Actions[LIRC_DIGIT_6]);
+ c->writeEntry("LIRC_DIGIT_7", m_Actions[LIRC_DIGIT_7]);
+ c->writeEntry("LIRC_DIGIT_8", m_Actions[LIRC_DIGIT_8]);
+ c->writeEntry("LIRC_DIGIT_9", m_Actions[LIRC_DIGIT_9]);
+ c->writeEntry("LIRC_POWER_ON", m_Actions[LIRC_POWER_ON]);
+ c->writeEntry("LIRC_POWER_OFF", m_Actions[LIRC_POWER_OFF]);
+ c->writeEntry("LIRC_PAUSE", m_Actions[LIRC_PAUSE]);
+ c->writeEntry("LIRC_RECORD_START", m_Actions[LIRC_RECORD_START]);
+ c->writeEntry("LIRC_RECORD_STOP", m_Actions[LIRC_RECORD_STOP]);
+ c->writeEntry("LIRC_VOLUME_INC", m_Actions[LIRC_VOLUME_INC]);
+ c->writeEntry("LIRC_VOLUME_DEC", m_Actions[LIRC_VOLUME_DEC]);
+ c->writeEntry("LIRC_CHANNEL_NEXT", m_Actions[LIRC_CHANNEL_NEXT]);
+ c->writeEntry("LIRC_CHANNEL_PREV", m_Actions[LIRC_CHANNEL_PREV]);
+ c->writeEntry("LIRC_SEARCH_NEXT", m_Actions[LIRC_SEARCH_NEXT]);
+ c->writeEntry("LIRC_SEARCH_PREV", m_Actions[LIRC_SEARCH_PREV]);
+ c->writeEntry("LIRC_SLEEP", m_Actions[LIRC_SLEEP]);
+ c->writeEntry("LIRC_APPLICATION_QUIT", m_Actions[LIRC_APPLICATION_QUIT]);
+
+
+ c->writeEntry("ALT_LIRC_DIGIT_0", m_AlternativeActions[LIRC_DIGIT_0]);
+ c->writeEntry("ALT_LIRC_DIGIT_1", m_AlternativeActions[LIRC_DIGIT_1]);
+ c->writeEntry("ALT_LIRC_DIGIT_2", m_AlternativeActions[LIRC_DIGIT_2]);
+ c->writeEntry("ALT_LIRC_DIGIT_3", m_AlternativeActions[LIRC_DIGIT_3]);
+ c->writeEntry("ALT_LIRC_DIGIT_4", m_AlternativeActions[LIRC_DIGIT_4]);
+ c->writeEntry("ALT_LIRC_DIGIT_5", m_AlternativeActions[LIRC_DIGIT_5]);
+ c->writeEntry("ALT_LIRC_DIGIT_6", m_AlternativeActions[LIRC_DIGIT_6]);
+ c->writeEntry("ALT_LIRC_DIGIT_7", m_AlternativeActions[LIRC_DIGIT_7]);
+ c->writeEntry("ALT_LIRC_DIGIT_8", m_AlternativeActions[LIRC_DIGIT_8]);
+ c->writeEntry("ALT_LIRC_DIGIT_9", m_AlternativeActions[LIRC_DIGIT_9]);
+ c->writeEntry("ALT_LIRC_POWER_ON", m_AlternativeActions[LIRC_POWER_ON]);
+ c->writeEntry("ALT_LIRC_POWER_OFF", m_AlternativeActions[LIRC_POWER_OFF]);
+ c->writeEntry("ALT_LIRC_PAUSE", m_AlternativeActions[LIRC_PAUSE]);
+ c->writeEntry("ALT_LIRC_RECORD_START", m_AlternativeActions[LIRC_RECORD_START]);
+ c->writeEntry("ALT_LIRC_RECORD_STOP", m_AlternativeActions[LIRC_RECORD_STOP]);
+ c->writeEntry("ALT_LIRC_VOLUME_INC", m_AlternativeActions[LIRC_VOLUME_INC]);
+ c->writeEntry("ALT_LIRC_VOLUME_DEC", m_AlternativeActions[LIRC_VOLUME_DEC]);
+ c->writeEntry("ALT_LIRC_CHANNEL_NEXT", m_AlternativeActions[LIRC_CHANNEL_NEXT]);
+ c->writeEntry("ALT_LIRC_CHANNEL_PREV", m_AlternativeActions[LIRC_CHANNEL_PREV]);
+ c->writeEntry("ALT_LIRC_SEARCH_NEXT", m_AlternativeActions[LIRC_SEARCH_NEXT]);
+ c->writeEntry("ALT_LIRC_SEARCH_PREV", m_AlternativeActions[LIRC_SEARCH_PREV]);
+ c->writeEntry("ALT_LIRC_SLEEP", m_AlternativeActions[LIRC_SLEEP]);
+ c->writeEntry("ALT_LIRC_APPLICATION_QUIT", m_AlternativeActions[LIRC_APPLICATION_QUIT]);
+}
+
+void LircSupport::restoreState (TDEConfig *c)
+{
+ m_Actions[LIRC_DIGIT_0] = c->readEntry("LIRC_DIGIT_0", "0");
+ m_Actions[LIRC_DIGIT_1] = c->readEntry("LIRC_DIGIT_1", "1");
+ m_Actions[LIRC_DIGIT_2] = c->readEntry("LIRC_DIGIT_2", "2");
+ m_Actions[LIRC_DIGIT_3] = c->readEntry("LIRC_DIGIT_3", "3");
+ m_Actions[LIRC_DIGIT_4] = c->readEntry("LIRC_DIGIT_4", "4");
+ m_Actions[LIRC_DIGIT_5] = c->readEntry("LIRC_DIGIT_5", "5");
+ m_Actions[LIRC_DIGIT_6] = c->readEntry("LIRC_DIGIT_6", "6");
+ m_Actions[LIRC_DIGIT_7] = c->readEntry("LIRC_DIGIT_7", "7");
+ m_Actions[LIRC_DIGIT_8] = c->readEntry("LIRC_DIGIT_8", "8");
+ m_Actions[LIRC_DIGIT_9] = c->readEntry("LIRC_DIGIT_9", "9");
+ m_Actions[LIRC_POWER_ON] = c->readEntry("LIRC_POWER_ON", "RADIO");
+ m_Actions[LIRC_POWER_OFF] = c->readEntry("LIRC_POWER_OFF", "RADIO");
+ m_Actions[LIRC_PAUSE] = c->readEntry("LIRC_PAUSE", "FULL_SCREEN");
+ m_Actions[LIRC_RECORD_START] = c->readEntry("LIRC_RECORD_START", "");
+ m_Actions[LIRC_RECORD_STOP] = c->readEntry("LIRC_RECORD_STOP", "");
+ m_Actions[LIRC_VOLUME_INC] = c->readEntry("LIRC_VOLUME_INC", "VOL+");
+ m_Actions[LIRC_VOLUME_DEC] = c->readEntry("LIRC_VOLUME_DEC", "VOL-");
+ m_Actions[LIRC_CHANNEL_NEXT] = c->readEntry("LIRC_CHANNEL_NEXT", "CH+");
+ m_Actions[LIRC_CHANNEL_PREV] = c->readEntry("LIRC_CHANNEL_PREV", "CH-");
+ m_Actions[LIRC_SEARCH_NEXT] = c->readEntry("LIRC_SEARCH_NEXT", "SOURCE");
+ m_Actions[LIRC_SEARCH_PREV] = c->readEntry("LIRC_SEARCH_PREV", "MUTE");
+ m_Actions[LIRC_SLEEP] = c->readEntry("LIRC_SLEEP", "MINIMIZE");
+ m_Actions[LIRC_APPLICATION_QUIT] = c->readEntry("LIRC_APPLICATION_QUIT", "");
+
+
+ m_AlternativeActions[LIRC_DIGIT_0] = c->readEntry("ALT_LIRC_DIGIT_0", "");
+ m_AlternativeActions[LIRC_DIGIT_1] = c->readEntry("ALT_LIRC_DIGIT_1", "");
+ m_AlternativeActions[LIRC_DIGIT_2] = c->readEntry("ALT_LIRC_DIGIT_2", "");
+ m_AlternativeActions[LIRC_DIGIT_3] = c->readEntry("ALT_LIRC_DIGIT_3", "");
+ m_AlternativeActions[LIRC_DIGIT_4] = c->readEntry("ALT_LIRC_DIGIT_4", "");
+ m_AlternativeActions[LIRC_DIGIT_5] = c->readEntry("ALT_LIRC_DIGIT_5", "");
+ m_AlternativeActions[LIRC_DIGIT_6] = c->readEntry("ALT_LIRC_DIGIT_6", "");
+ m_AlternativeActions[LIRC_DIGIT_7] = c->readEntry("ALT_LIRC_DIGIT_7", "");
+ m_AlternativeActions[LIRC_DIGIT_8] = c->readEntry("ALT_LIRC_DIGIT_8", "");
+ m_AlternativeActions[LIRC_DIGIT_9] = c->readEntry("ALT_LIRC_DIGIT_9", "");
+ m_AlternativeActions[LIRC_POWER_ON] = c->readEntry("ALT_LIRC_POWER_ON", "");
+ m_AlternativeActions[LIRC_POWER_OFF] = c->readEntry("ALT_LIRC_POWER_OFF", "TV");
+ m_AlternativeActions[LIRC_PAUSE] = c->readEntry("ALT_LIRC_PAUSE", "");
+ m_AlternativeActions[LIRC_RECORD_START] = c->readEntry("ALT_LIRC_RECORD_START", "");
+ m_AlternativeActions[LIRC_RECORD_STOP] = c->readEntry("ALT_LIRC_RECORD_STOP", "");
+ m_AlternativeActions[LIRC_VOLUME_INC] = c->readEntry("ALT_LIRC_VOLUME_INC", "");
+ m_AlternativeActions[LIRC_VOLUME_DEC] = c->readEntry("ALT_LIRC_VOLUME_DEC", "");
+ m_AlternativeActions[LIRC_CHANNEL_NEXT] = c->readEntry("ALT_LIRC_CHANNEL_NEXT", "");
+ m_AlternativeActions[LIRC_CHANNEL_PREV] = c->readEntry("ALT_LIRC_CHANNEL_PREV", "");
+ m_AlternativeActions[LIRC_SEARCH_NEXT] = c->readEntry("ALT_LIRC_SEARCH_NEXT", "");
+ m_AlternativeActions[LIRC_SEARCH_PREV] = c->readEntry("ALT_LIRC_SEARCH_PREV", "");
+ m_AlternativeActions[LIRC_SLEEP] = c->readEntry("ALT_LIRC_SLEEP", "");
+ m_AlternativeActions[LIRC_APPLICATION_QUIT] = c->readEntry("ALT_LIRC_APPLICATION_QUIT", "");
+
+ emit sigUpdateConfig();
+}
+
+
+ConfigPageInfo LircSupport::createConfigurationPage()
+{
+ LIRCConfiguration *conf = new LIRCConfiguration(NULL, this);
+ TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig()));
+ TQObject::connect(this, TQT_SIGNAL(sigRawLIRCSignal(const TQString &, int, bool &)),
+ conf, TQT_SLOT (slotRawLIRCSignal(const TQString &, int, bool &)));
+ return ConfigPageInfo (conf,
+ i18n("LIRC Support"),
+ i18n("LIRC Plugin"),
+ "connect_creating");
+}
+
+
+AboutPageInfo LircSupport::createAboutPage()
+{
+/* TDEAboutData aboutData("kradio",
+ NULL,
+ NULL,
+ I18N_NOOP("Linux Infrared Remote Control Support for TDERadio"),
+ TDEAboutData::License_GPL,
+ "(c) 2002-2005 Martin Witte",
+ 0,
+ "http://sourceforge.net/projects/kradio",
+ 0);
+ aboutData.addAuthor("Martin Witte", "", "witte@kawo1.rwth-aachen.de");
+
+ return AboutPageInfo(
+ new TDERadioAboutWidget(aboutData, TDERadioAboutWidget::AbtTabbed),
+ i18n("LIRC Support"),
+ i18n("LIRC Plugin"),
+ "connect_creating"
+ );*/
+ return AboutPageInfo();
+}
+
+
+bool LircSupport::checkActions(const TQString &lirc_string, int repeat_counter, const TQMap<LIRC_Actions, TQString> &map)
+{
+ SoundStreamID streamID = queryCurrentSoundStreamID();
+
+ bool retval = false;
+ bool q = false;
+ SoundFormat sf;
+ ISeekRadio *seeker = NULL;
+
+ TQMapConstIterator<LIRC_Actions, TQString> it = map.begin();
+ TQMapConstIterator<LIRC_Actions, TQString> end = map.end();
+ for (; !retval && it != end; ++it) {
+ if ((*it).length() && lirc_string == *it) {
+ LIRC_Actions action = it.key();
+ int digit = -1;
+ switch (action) {
+ case LIRC_DIGIT_0 :
+ if (repeat_counter == 0) {
+ digit = 0;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_1 :
+ if (repeat_counter == 0) {
+ digit = 1;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_2 :
+ if (repeat_counter == 0) {
+ digit = 2;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_3 :
+ if (repeat_counter == 0) {
+ digit = 3;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_4 :
+ if (repeat_counter == 0) {
+ digit = 4;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_5 :
+ if (repeat_counter == 0) {
+ digit = 5;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_6 :
+ if (repeat_counter == 0) {
+ digit = 6;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_7 :
+ if (repeat_counter == 0) {
+ digit = 7;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_8 :
+ if (repeat_counter == 0) {
+ digit = 8;
+ retval = true;
+ }
+ break;
+ case LIRC_DIGIT_9 :
+ if (repeat_counter == 0) {
+ digit = 9;
+ retval = true;
+ }
+ break;
+ case LIRC_POWER_ON :
+ if (repeat_counter == 0 && !queryIsPowerOn()) {
+ retval = true;
+ sendPowerOn();
+ }
+ break;
+ case LIRC_POWER_OFF :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ sendPowerOff();
+ }
+ break;
+ case LIRC_PAUSE :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ sendPausePlayback(streamID);
+ }
+ break;
+ case LIRC_RECORD_START :
+ queryIsRecordingRunning(streamID, q = false, sf);
+ if (repeat_counter == 0 && !q) {
+ retval = true;
+ sendStartRecording(streamID);
+ }
+ break;
+ case LIRC_RECORD_STOP :
+ queryIsRecordingRunning(streamID, q = false, sf);
+ if (repeat_counter == 0 && q) {
+ retval = true;
+ sendStopRecording(streamID);
+ }
+ break;
+ case LIRC_VOLUME_INC :
+ if (queryIsPowerOn()) {
+ retval = true;
+ float oldVolume = 0;
+ queryPlaybackVolume(streamID, oldVolume);
+ sendPlaybackVolume (streamID, oldVolume + 1.0/32.0);
+ }
+ break;
+ case LIRC_VOLUME_DEC :
+ if (queryIsPowerOn()) {
+ retval = true;
+ float oldVolume = 0;
+ queryPlaybackVolume(streamID, oldVolume);
+ sendPlaybackVolume (streamID, oldVolume - 1.0/32.0);
+ }
+ break;
+ case LIRC_CHANNEL_NEXT :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ int k = queryCurrentStationIdx() + 1;
+ if (k >= queryStations().count())
+ k = 0;
+ sendActivateStation(k);
+ }
+ break;
+ case LIRC_CHANNEL_PREV :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ int k = queryCurrentStationIdx() - 1;
+ if (k < 0)
+ k = queryStations().count() - 1;
+ sendActivateStation(k);
+ }
+ break;
+ case LIRC_SEARCH_NEXT :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ seeker = dynamic_cast<ISeekRadio*> (queryActiveDevice());
+ seeker->startSeekUp();
+ }
+ break;
+ case LIRC_SEARCH_PREV :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ seeker = dynamic_cast<ISeekRadio*> (queryActiveDevice());
+ seeker->startSeekDown();
+ }
+ break;
+ case LIRC_SLEEP :
+ if (repeat_counter == 0 && queryIsPowerOn()) {
+ retval = true;
+ sendStartCountdown();
+ }
+ break;
+ case LIRC_APPLICATION_QUIT :
+ retval = true;
+ kapp->quit();
+ break;
+ default:
+ break;
+ }
+
+ if (digit >= 0) {
+ if (m_addIndex || digit == 0) {
+ activateStation(m_addIndex * 10 + digit);
+ m_kbdTimer->stop();
+ m_addIndex = 0;
+ } else {
+ m_addIndex = digit;
+ m_kbdTimer->start(500, true);
+ }
+ }
+ }
+ }
+ return retval;
+}
+
+
+void LircSupport::setActions(const TQMap<LIRC_Actions, TQString> &actions, const TQMap<LIRC_Actions, TQString> &alt_actions)
+{
+ m_Actions = actions;
+ m_AlternativeActions = alt_actions;
+}
+
+
+#include "lircsupport.moc"
diff --git a/tderadio3/plugins/lirc/lircsupport.h b/tderadio3/plugins/lirc/lircsupport.h
new file mode 100644
index 0000000..bd1ad8a
--- /dev/null
+++ b/tderadio3/plugins/lirc/lircsupport.h
@@ -0,0 +1,160 @@
+/***************************************************************************
+ lircsupport.h - description
+ -------------------
+ begin : Mon Feb 4 2002
+ copyright : (C) 2002 by Martin Witte / Frank Schwanz
+ email : witte@kawo1.rwth-aachen.de / schwanz@fh-brandenburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef LIRCSUPPORT_H
+#define LIRCSUPPORT_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <tqobject.h>
+#include "../../src/include/timecontrol_interfaces.h"
+#include "../../src/include/radio_interfaces.h"
+#include "../../src/include/radiodevicepool_interfaces.h"
+#include "../../src/include/soundstreamclient_interfaces.h"
+#include "../../src/include/plugins.h"
+
+
+enum LIRC_Actions {
+ LIRC_DIGIT_0,
+ LIRC_DIGIT_1,
+ LIRC_DIGIT_2,
+ LIRC_DIGIT_3,
+ LIRC_DIGIT_4,
+ LIRC_DIGIT_5,
+ LIRC_DIGIT_6,
+ LIRC_DIGIT_7,
+ LIRC_DIGIT_8,
+ LIRC_DIGIT_9,
+ LIRC_POWER_ON,
+ LIRC_POWER_OFF,
+ LIRC_PAUSE,
+ LIRC_RECORD_START,
+ LIRC_RECORD_STOP,
+ LIRC_VOLUME_INC,
+ LIRC_VOLUME_DEC,
+ LIRC_CHANNEL_NEXT,
+ LIRC_CHANNEL_PREV,
+ LIRC_SEARCH_NEXT,
+ LIRC_SEARCH_PREV,
+ LIRC_SLEEP,
+ LIRC_APPLICATION_QUIT
+};
+
+
+struct lirc_config;
+class TQSocketNotifier;
+class TQTimer;
+
+class LircSupport : public TQObject,
+ public PluginBase,
+ public IRadioClient,
+ public ITimeControlClient,
+ public ISoundStreamClient,
+ public IRadioDevicePoolClient
+{
+Q_OBJECT
+
+public:
+ LircSupport(const TQString &name);
+ ~LircSupport();
+
+ virtual bool connectI (Interface *);
+ virtual bool disconnectI (Interface *);
+
+ virtual TQString pluginClassName() const { return "LircSupport"; }
+
+ virtual const TQString &name() const { return PluginBase::name(); }
+ virtual TQString &name() { return PluginBase::name(); }
+
+
+ virtual void setActions(const TQMap<LIRC_Actions, TQString> &actions, const TQMap<LIRC_Actions, TQString> &alt_actions);
+ virtual const TQMap<LIRC_Actions, TQString> &getActions() const { return m_Actions; }
+ virtual const TQMap<LIRC_Actions, TQString> &getAlternativeActions() const { return m_AlternativeActions; }
+
+ // PluginBase
+
+public:
+ virtual void saveState (TDEConfig *) const;
+ virtual void restoreState (TDEConfig *);
+
+ virtual ConfigPageInfo createConfigurationPage();
+ virtual AboutPageInfo createAboutPage();
+
+ // IRadioClient methods
+
+RECEIVERS:
+ bool noticePowerChanged(bool /*on*/) { return false; }
+ bool noticeStationChanged (const RadioStation &, int /*idx*/) { return false; }
+ bool noticeStationsChanged(const StationList &/*sl*/) { return false; }
+ bool noticePresetFileChanged(const TQString &/*f*/) { return false; }
+
+ bool noticeCurrentSoundStreamIDChanged(SoundStreamID /*id*/) { return false; }
+
+ // ITimeControlClient
+
+RECEIVERS:
+ bool noticeAlarmsChanged(const AlarmVector &) { return false; }
+ bool noticeAlarm(const Alarm &) { return false; }
+ bool noticeNextAlarmChanged(const Alarm *) { return false; }
+ bool noticeCountdownStarted(const TQDateTime &/*end*/) { return false; }
+ bool noticeCountdownStopped() { return false; }
+ bool noticeCountdownZero() { return false; }
+ bool noticeCountdownSecondsChanged(int /*n*/) { return false; }
+
+ // IRadioDevicePoolClient
+
+RECEIVERS:
+ bool noticeActiveDeviceChanged(IRadioDevice *) { return false; }
+ bool noticeDevicesChanged(const TQPtrList<IRadioDevice> &) { return false; }
+ bool noticeDeviceDescriptionChanged(const TQString &) { return false; }
+
+
+protected:
+ void activateStation(int i);
+ bool checkActions(const TQString &string, int repeat_counter, const TQMap<LIRC_Actions, TQString> &map);
+
+protected slots:
+ void slotLIRC(int socket);
+ void slotKbdTimedOut();
+
+signals:
+
+ void sigUpdateConfig();
+
+ void sigRawLIRCSignal(const TQString &what, int repeat_counter, bool &consumed);
+
+protected:
+
+#ifdef HAVE_LIRC
+ TQSocketNotifier *m_lirc_notify;
+ int m_fd_lirc;
+ struct lirc_config *m_lircConfig;
+#endif
+
+ TQTimer *m_kbdTimer;
+ int m_addIndex;
+ bool m_TakeRawLIRC;
+
+ TQMap<LIRC_Actions, TQString> m_Actions;
+ TQMap<LIRC_Actions, TQString> m_AlternativeActions;
+};
+
+
+
+#endif
diff --git a/tderadio3/plugins/lirc/listviewitem_lirc.cpp b/tderadio3/plugins/lirc/listviewitem_lirc.cpp
new file mode 100644
index 0000000..20976c5
--- /dev/null
+++ b/tderadio3/plugins/lirc/listviewitem_lirc.cpp
@@ -0,0 +1,51 @@
+/***************************************************************************
+ listviewitem_lirc.cpp - description
+ -------------------
+ begin : Sun Aug 14 2005
+ copyright : (C) 2005 by Martin Witte
+ email : witte@kawo1.rwth-aachen.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include "listviewitem_lirc.h"
+
+ListViewItemLirc::ListViewItemLirc(TQListView *parent, TQListViewItem *after)
+ : TDEListViewItem(parent, after),
+ m_renamingInProcess(-1)
+{
+}
+
+ListViewItemLirc::~ListViewItemLirc()
+{
+}
+
+void ListViewItemLirc::startRename(int col)
+{
+ TDEListViewItem::startRename(col);
+ m_renamingInProcess = col;
+ emit sigRenamingStarted(this, col);
+}
+
+void ListViewItemLirc::okRename(int col)
+{
+ TDEListViewItem::okRename(col);
+ m_renamingInProcess = -1;
+ emit sigRenamingStopped(this, col);
+}
+
+void ListViewItemLirc::cancelRename(int col)
+{
+ TDEListViewItem::cancelRename(col);
+ m_renamingInProcess = -1;
+ emit sigRenamingStopped(this, col);
+}
+
+#include "listviewitem_lirc.moc"
diff --git a/tderadio3/plugins/lirc/listviewitem_lirc.h b/tderadio3/plugins/lirc/listviewitem_lirc.h
new file mode 100644
index 0000000..945ce5f
--- /dev/null
+++ b/tderadio3/plugins/lirc/listviewitem_lirc.h
@@ -0,0 +1,52 @@
+/***************************************************************************
+ listviewitem_lirc.cpp - description
+ -------------------
+ begin : Sun Aug 14 2005
+ copyright : (C) 2005 by Martin Witte
+ email : witte@kawo1.rwth-aachen.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef LISTVIEWITEM_LIRC_H
+#define LISTVIEWITEM_LIRC_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <klistview.h>
+
+class ListViewItemLirc : public TQObject, public TDEListViewItem
+{
+Q_OBJECT
+
+public:
+ ListViewItemLirc(TQListView *parent, TQListViewItem *after);
+ ~ListViewItemLirc();
+
+ bool isRenamingInProcess() const { return m_renamingInProcess >= 0; }
+ int getRenamingColumn() const { return m_renamingInProcess; }
+
+ virtual void startRename(int col);
+ virtual void okRename(int col);
+ virtual void cancelRename(int col);
+
+signals:
+
+ void sigRenamingStarted(ListViewItemLirc *sender, int column);
+ void sigRenamingStopped(ListViewItemLirc *sender, int column);
+
+protected:
+
+ int m_renamingInProcess;
+};
+
+#endif
diff --git a/tderadio3/plugins/lirc/po/Makefile.am b/tderadio3/plugins/lirc/po/Makefile.am
new file mode 100644
index 0000000..22fce99
--- /dev/null
+++ b/tderadio3/plugins/lirc/po/Makefile.am
@@ -0,0 +1,2 @@
+PACKAGE = kradio-lirc
+POFILES = AUTO
diff --git a/tderadio3/plugins/lirc/po/de.po b/tderadio3/plugins/lirc/po/de.po
new file mode 100644
index 0000000..d2d5f9a
--- /dev/null
+++ b/tderadio3/plugins/lirc/po/de.po
@@ -0,0 +1,213 @@
+# translation of de.po to
+# translation of kradio-lirc.po to
+# This file is put in the public domain.
+#
+# Ernst Martin Witte <emw@nocabal.de>, 2006.
+msgid ""
+msgstr ""
+"Project-Id-Version: de\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-11-12 18:20+0100\n"
+"PO-Revision-Date: 2006-11-06 01:32+0100\n"
+"Last-Translator: Ernst Martin Witte <emw@nocabal.de>\n"
+"Language-Team: <de@li.org>\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 lirc-configuration-ui.ui line 17
+#: rc.cpp:3 rc.cpp:18 lirc-configuration-ui.cpp:75
+#, no-c-format
+msgid "LIRCConfigurationUI"
+msgstr "LIRCConfigurationUI"
+
+#. i18n: file lirc-configuration-ui.ui line 26
+#: rc.cpp:6 rc.cpp:21 lirc-configuration-ui.cpp:34
+#: lirc-configuration-ui.cpp:76
+#, no-c-format
+msgid "Action"
+msgstr "Aktion"
+
+#. i18n: file lirc-configuration-ui.ui line 37
+#: rc.cpp:9 rc.cpp:24 lirc-configuration-ui.cpp:35
+#: lirc-configuration-ui.cpp:77
+#, no-c-format
+msgid "LIRC String"
+msgstr "LIRC-Zeichenkette"
+
+#. i18n: file lirc-configuration-ui.ui line 48
+#: rc.cpp:12 rc.cpp:27 lirc-configuration-ui.cpp:36
+#: lirc-configuration-ui.cpp:78
+#, no-c-format
+msgid "Alternative LIRC String"
+msgstr "Alternative LIRC-Zeichenkette"
+
+#. i18n: file lirc-configuration-ui.ui line 98
+#: rc.cpp:15 rc.cpp:30 lirc-configuration-ui.cpp:79
+#, no-c-format
+msgid "textLabel1"
+msgstr "textLabel1"
+
+#: _translatorinfo.cpp:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr "Ernst Martin Witte"
+
+#: _translatorinfo.cpp:3
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+msgstr "emw@nocabal.de"
+
+#: lirc-configuration.cpp:34
+msgid "digit 0"
+msgstr "Ziffer 0"
+
+#: lirc-configuration.cpp:35
+msgid "digit 1"
+msgstr "Ziffer 1"
+
+#: lirc-configuration.cpp:36
+msgid "digit 2"
+msgstr "Ziffer 2"
+
+#: lirc-configuration.cpp:37
+msgid "digit 3"
+msgstr "Ziffer 3"
+
+#: lirc-configuration.cpp:38
+msgid "digit 4"
+msgstr "Ziffer 4"
+
+#: lirc-configuration.cpp:39
+msgid "digit 5"
+msgstr "Ziffer 5"
+
+#: lirc-configuration.cpp:40
+msgid "digit 6"
+msgstr "Ziffer 6"
+
+#: lirc-configuration.cpp:41
+msgid "digit 7"
+msgstr "Ziffer 7"
+
+#: lirc-configuration.cpp:42
+msgid "digit 8"
+msgstr "Ziffer 8"
+
+#: lirc-configuration.cpp:43
+msgid "digit 9"
+msgstr "Ziffer 9"
+
+#: lirc-configuration.cpp:44
+msgid "Power On"
+msgstr "Einschalten"
+
+#: lirc-configuration.cpp:45
+msgid "Power Off"
+msgstr "Ausschalten"
+
+#: lirc-configuration.cpp:46
+msgid "Pause"
+msgstr "Pause"
+
+#: lirc-configuration.cpp:47
+msgid "Start Recording"
+msgstr "Aufnahme starten"
+
+#: lirc-configuration.cpp:48
+msgid "Stop Recording"
+msgstr "Aufnahme beenden"
+
+#: lirc-configuration.cpp:49
+msgid "Increase Volume"
+msgstr "Lautstärke erhöhen"
+
+#: lirc-configuration.cpp:50
+msgid "Decrease Volume"
+msgstr "Lautstärke senken"
+
+#: lirc-configuration.cpp:51
+msgid "Next Channel"
+msgstr "Nächster Sender"
+
+#: lirc-configuration.cpp:52
+msgid "Previous Channel"
+msgstr "Vorheriger Sender"
+
+#: lirc-configuration.cpp:53
+msgid "Search Next Channel"
+msgstr "Suche nächsten Sender"
+
+#: lirc-configuration.cpp:54
+msgid "Search Previous Channel"
+msgstr "Suche vorherigen Sender"
+
+#: lirc-configuration.cpp:55
+msgid "Enable Sleep Countdown"
+msgstr "Schlummer-Countdown aktivieren"
+
+#: lirc-configuration.cpp:56
+msgid "Quit TDERadio"
+msgstr "TDERadio Beenden"
+
+#: lirc-configuration.cpp:176
+msgid ""
+"Enter the key string of your remote or just press the button on your remote "
+"control"
+msgstr ""
+"Geben Sie die Zeichenkette Ihrer Fernsteuerung ein oder drücken Sie die "
+"Taste auf Ihrer Fernsteuerung"
+
+#: lirc-configuration.cpp:182
+msgid "Double Click on the entries to change the assignments"
+msgstr "Doppelklicken Sie auf die Einträge um die Zuordnung zu ändern"
+
+#: lircsupport.cpp:45
+msgid "Linux Infrared Control (LIRC) Support"
+msgstr "Unterstützung für die Fernsteuerung (LIRC)"
+
+#: lircsupport.cpp:51 lircsupport.cpp:330
+msgid "LIRC Plugin"
+msgstr "Plugin für die Fernsteuerung (LIRC)"
+
+#: lircsupport.cpp:56 lircsupport.cpp:57
+msgid "initializing kradio lirc plugin"
+msgstr "initialisiere das Plugin für die Fernsteuerung (LIRC)"
+
+#: lircsupport.cpp:65
+msgid ""
+"%1 does not exist. File was created with TDERadio's default .lircrc proposal"
+msgstr ""
+"Die Datei %1 existiert nicht. Die Datei wurde mit den Defaulteinstellungen "
+"für TDERadio erzeugt."
+
+#: lircsupport.cpp:94
+msgid "There is no entry for kradio in any of your .lircrc files."
+msgstr "Es gibt keinen Eintrag für TDERadio in jeglichen .lirc-Dateien"
+
+#: lircsupport.cpp:95
+msgid "Please setup your .lircrc files correctly."
+msgstr "Bitte konfigurieren Sie Ihre .lirc-Dateien richtig."
+
+#: lircsupport.cpp:106 lircsupport.cpp:107
+msgid "Initializing kradio lirc plugin failed"
+msgstr "Die Initialisierung des TDERadio LIRC Plugins schlug fehl"
+
+#: lircsupport.cpp:109 lircsupport.cpp:110
+msgid "Initializing kradio lirc plugin successful"
+msgstr "Die Initialisierung des LIRC Plugins war erfolgreich"
+
+#: lircsupport.cpp:167
+msgid ""
+"Reading from LIRC socket failed. Disabling LIRC Functions till next start of "
+"kradio"
+msgstr ""
+"Das Lesen vom LIRC-Socket ist fehlgeschlagen. Die LIRC-Funktion wird bis zum "
+"nächsten Start von TDERadio temporär abgeschaltet."
+
+#: lircsupport.cpp:329
+msgid "LIRC Support"
+msgstr "Fernsteuerung"
diff --git a/tderadio3/plugins/lirc/po/ru.po b/tderadio3/plugins/lirc/po/ru.po
new file mode 100644
index 0000000..3ac8f5b
--- /dev/null
+++ b/tderadio3/plugins/lirc/po/ru.po
@@ -0,0 +1,209 @@
+# translation of ru.po to
+# translation of kradio-lirc.po to
+# This file is put in the public domain.
+# Алексей Кузнецов <Alexey.Kouznetsov@GMail.com>, 2006.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ru\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2006-11-12 18:20+0100\n"
+"PO-Revision-Date: 2006-11-08 12:54+0300\n"
+"Last-Translator: Алексей Кузнецов <Alexey.Kouznetsov@GMail.com>\n"
+"Language-Team: <ru@li.org>\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 lirc-configuration-ui.ui line 17
+#: rc.cpp:3 rc.cpp:18 lirc-configuration-ui.cpp:75
+#, no-c-format
+msgid "LIRCConfigurationUI"
+msgstr "LIRCConfigurationUI"
+
+#. i18n: file lirc-configuration-ui.ui line 26
+#: rc.cpp:6 rc.cpp:21 lirc-configuration-ui.cpp:34
+#: lirc-configuration-ui.cpp:76
+#, no-c-format
+msgid "Action"
+msgstr "Действие"
+
+#. i18n: file lirc-configuration-ui.ui line 37
+#: rc.cpp:9 rc.cpp:24 lirc-configuration-ui.cpp:35
+#: lirc-configuration-ui.cpp:77
+#, no-c-format
+msgid "LIRC String"
+msgstr "Строка LIRC"
+
+#. i18n: file lirc-configuration-ui.ui line 48
+#: rc.cpp:12 rc.cpp:27 lirc-configuration-ui.cpp:36
+#: lirc-configuration-ui.cpp:78
+#, no-c-format
+msgid "Alternative LIRC String"
+msgstr "Альтернативная строка LIRC"
+
+#. i18n: file lirc-configuration-ui.ui line 98
+#: rc.cpp:15 rc.cpp:30 lirc-configuration-ui.cpp:79
+#, no-c-format
+msgid "textLabel1"
+msgstr "textLabel1"
+
+#: _translatorinfo.cpp:1
+msgid ""
+"_: NAME OF TRANSLATORS\n"
+"Your names"
+msgstr "Алексей Кузнецов"
+
+#: _translatorinfo.cpp:3
+msgid ""
+"_: EMAIL OF TRANSLATORS\n"
+"Your emails"
+msgstr "Alexey.Kouznetsov@GMail.com"
+
+#: lirc-configuration.cpp:34
+msgid "digit 0"
+msgstr "ноль"
+
+#: lirc-configuration.cpp:35
+msgid "digit 1"
+msgstr "один"
+
+#: lirc-configuration.cpp:36
+msgid "digit 2"
+msgstr "два"
+
+#: lirc-configuration.cpp:37
+msgid "digit 3"
+msgstr "три"
+
+#: lirc-configuration.cpp:38
+msgid "digit 4"
+msgstr "четыре"
+
+#: lirc-configuration.cpp:39
+msgid "digit 5"
+msgstr "пять"
+
+#: lirc-configuration.cpp:40
+msgid "digit 6"
+msgstr "шесть"
+
+#: lirc-configuration.cpp:41
+msgid "digit 7"
+msgstr "семь"
+
+#: lirc-configuration.cpp:42
+msgid "digit 8"
+msgstr "восемь"
+
+#: lirc-configuration.cpp:43
+msgid "digit 9"
+msgstr "девять"
+
+#: lirc-configuration.cpp:44
+msgid "Power On"
+msgstr "Включить"
+
+#: lirc-configuration.cpp:45
+msgid "Power Off"
+msgstr "Выключить"
+
+#: lirc-configuration.cpp:46
+msgid "Pause"
+msgstr "Приостановить"
+
+#: lirc-configuration.cpp:47
+msgid "Start Recording"
+msgstr "Начать запись"
+
+#: lirc-configuration.cpp:48
+msgid "Stop Recording"
+msgstr "Остановить запись"
+
+#: lirc-configuration.cpp:49
+msgid "Increase Volume"
+msgstr "Увеличить громкость"
+
+#: lirc-configuration.cpp:50
+msgid "Decrease Volume"
+msgstr "Уменьшить громкость"
+
+#: lirc-configuration.cpp:51
+msgid "Next Channel"
+msgstr "Следующий канал"
+
+#: lirc-configuration.cpp:52
+msgid "Previous Channel"
+msgstr "Предыдущий канал"
+
+#: lirc-configuration.cpp:53
+msgid "Search Next Channel"
+msgstr "Поиск следующего канала"
+
+#: lirc-configuration.cpp:54
+msgid "Search Previous Channel"
+msgstr "Поиск предыдущего канала"
+
+#: lirc-configuration.cpp:55
+msgid "Enable Sleep Countdown"
+msgstr "Включить таймер отключения"
+
+#: lirc-configuration.cpp:56
+msgid "Quit TDERadio"
+msgstr "Закрыть TDERadio"
+
+#: lirc-configuration.cpp:176
+msgid ""
+"Enter the key string of your remote or just press the button on your remote "
+"control"
+msgstr "Введите ключевую строку вашего ПДУ либо просто нажмите кнопку на нём"
+
+#: lirc-configuration.cpp:182
+msgid "Double Click on the entries to change the assignments"
+msgstr "Для изменения привязки дважды щёлкните по ней мышью"
+
+#: lircsupport.cpp:45
+msgid "Linux Infrared Control (LIRC) Support"
+msgstr "Поддержка ПДУ в Linux (LIRC)"
+
+#: lircsupport.cpp:51 lircsupport.cpp:330
+msgid "LIRC Plugin"
+msgstr "Модуль ДУ (LIRC)"
+
+#: lircsupport.cpp:56 lircsupport.cpp:57
+msgid "initializing kradio lirc plugin"
+msgstr "Инициализация модуля LIRC"
+
+#: lircsupport.cpp:65
+msgid ""
+"%1 does not exist. File was created with TDERadio's default .lircrc proposal"
+msgstr "%1 не существует. Был создан файл .lircrc для TDERadio по умолчанию"
+
+#: lircsupport.cpp:94
+msgid "There is no entry for kradio in any of your .lircrc files."
+msgstr "Ни в одном из ваших файлов .lircrc нет упоминания о TDERadio."
+
+#: lircsupport.cpp:95
+msgid "Please setup your .lircrc files correctly."
+msgstr "Настройте файлы .lircrc"
+
+#: lircsupport.cpp:106 lircsupport.cpp:107
+msgid "Initializing kradio lirc plugin failed"
+msgstr "Инициализация модуля LIRC не удалась"
+
+#: lircsupport.cpp:109 lircsupport.cpp:110
+msgid "Initializing kradio lirc plugin successful"
+msgstr "Модуль LIRC инициализирован"
+
+#: lircsupport.cpp:167
+msgid ""
+"Reading from LIRC socket failed. Disabling LIRC Functions till next start of "
+"kradio"
+msgstr ""
+"Чтение из сокета LIRC не удалось. Отключаю функции LIRC до следующего "
+"запуска TDERadio."
+
+#: lircsupport.cpp:329
+msgid "LIRC Support"
+msgstr "Поддержка LIRC"