diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 03:43:07 +0000 |
commit | 70b9eea2ba01c3691497f49e4c45cb070c16193c (patch) | |
tree | 9a6df61aa247a27275aad9c5245e419e89c2c640 /kradio3/plugins/alsa-sound | |
parent | 998c1384ace4ae4655997c181fa33242148cd0a4 (diff) | |
download | tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.tar.gz tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.zip |
TQt4 port kradio
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/alsa-sound')
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-config-mixer-setting.cpp | 14 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-config-mixer-setting.h | 14 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-mixer-element-ui.ui | 46 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-mixer-element.cpp | 62 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-mixer-element.h | 9 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound-configuration-ui.ui | 38 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp | 110 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound-configuration.h | 35 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound.cpp | 252 | ||||
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound.h | 77 |
10 files changed, 330 insertions, 327 deletions
diff --git a/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.cpp b/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.cpp index 873b29e..2377337 100644 --- a/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.cpp +++ b/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.cpp @@ -21,23 +21,23 @@ AlsaConfigMixerSetting::AlsaConfigMixerSetting() : m_card(-1), - m_name(QString::null), + m_name(TQString()), m_use(false), m_active(false), m_volume(-1) { } -AlsaConfigMixerSetting::AlsaConfigMixerSetting(KConfig *c, const QString &prefix) +AlsaConfigMixerSetting::AlsaConfigMixerSetting(KConfig *c, const TQString &prefix) { m_card = c->readNumEntry (prefix+"card", -1); - m_name = c->readEntry (prefix+"name", QString::null); + m_name = c->readEntry (prefix+"name", TQString()); m_use = c->readBoolEntry (prefix+"use", false); m_active = c->readBoolEntry (prefix+"active", false); m_volume = c->readDoubleNumEntry(prefix+"volume", 0); } -AlsaConfigMixerSetting::AlsaConfigMixerSetting(int card, const QString &name, bool use, bool active, float volume) +AlsaConfigMixerSetting::AlsaConfigMixerSetting(int card, const TQString &name, bool use, bool active, float volume) : m_card(card), m_name(name), m_use(use), @@ -50,12 +50,12 @@ AlsaConfigMixerSetting::~AlsaConfigMixerSetting() { } -QString AlsaConfigMixerSetting::getIDString(int card, const QString &name) +TQString AlsaConfigMixerSetting::getIDString(int card, const TQString &name) { - return QString::number(card) + "-" + name; + return TQString::number(card) + "-" + name; } -void AlsaConfigMixerSetting::saveState(KConfig *c, const QString &prefix) const +void AlsaConfigMixerSetting::saveState(KConfig *c, const TQString &prefix) const { c->writeEntry(prefix+"card", m_card); c->writeEntry(prefix+"name", m_name); diff --git a/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.h b/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.h index a9f5d88..88140e8 100644 --- a/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.h +++ b/kradio3/plugins/alsa-sound/alsa-config-mixer-setting.h @@ -18,7 +18,7 @@ #ifndef __KRADIO_ALSA_CONFIG_MIXER_SETTING_H #define __KRADIO_ALSA_CONFIG_MIXER_SETTING_H -#include <qstring.h> +#include <tqstring.h> class KConfig; @@ -26,17 +26,17 @@ class AlsaConfigMixerSetting { public: AlsaConfigMixerSetting(); - AlsaConfigMixerSetting(KConfig *c, const QString &prefix); - AlsaConfigMixerSetting(int card, const QString &name, bool use, bool active, float volume); + AlsaConfigMixerSetting(KConfig *c, const TQString &prefix); + AlsaConfigMixerSetting(int card, const TQString &name, bool use, bool active, float volume); ~AlsaConfigMixerSetting(); - QString getIDString() const { return getIDString(m_card, m_name); } - static QString getIDString(int card, const QString &m_name); + TQString getIDString() const { return getIDString(m_card, m_name); } + static TQString getIDString(int card, const TQString &m_name); - void saveState(KConfig *c, const QString &prefix) const; + void saveState(KConfig *c, const TQString &prefix) const; int m_card; - QString m_name; + TQString m_name; bool m_use; bool m_active; float m_volume; diff --git a/kradio3/plugins/alsa-sound/alsa-mixer-element-ui.ui b/kradio3/plugins/alsa-sound/alsa-mixer-element-ui.ui index e2c170d..7faf941 100644 --- a/kradio3/plugins/alsa-sound/alsa-mixer-element-ui.ui +++ b/kradio3/plugins/alsa-sound/alsa-mixer-element-ui.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>AlsaMixerElementUI</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AlsaMixerElementUI</cstring> </property> @@ -19,9 +19,9 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout16</cstring> + <cstring>tqlayout16</cstring> </property> <hbox> <property name="name"> @@ -37,7 +37,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -54,14 +54,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>1</width> <height>40</height> </size> </property> </spacer> - <widget class="QSlider"> + <widget class="TQSlider"> <property name="name"> <cstring>m_sliderVolume</cstring> </property> @@ -85,7 +85,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>1</width> <height>40</height> @@ -102,7 +102,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -111,9 +111,9 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout7</cstring> + <cstring>tqlayout7</cstring> </property> <hbox> <property name="name"> @@ -129,7 +129,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>11</width> <height>20</height> @@ -157,7 +157,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>11</width> <height>20</height> @@ -166,9 +166,9 @@ </spacer> </hbox> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout5</cstring> + <cstring>tqlayout5</cstring> </property> <hbox> <property name="name"> @@ -184,22 +184,22 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> </size> </property> </spacer> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>m_checkboxActive</cstring> </property> @@ -213,7 +213,7 @@ <string>Alt+N</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>m_checkboxOverride</cstring> </property> @@ -236,7 +236,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -245,7 +245,7 @@ </spacer> </hbox> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>m_labelMixerElementName</cstring> </property> @@ -255,7 +255,7 @@ <property name="text"> <string>MixerName</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignCenter</set> </property> </widget> @@ -263,7 +263,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="2"/> +<tqlayoutdefaults spacing="6" margin="2"/> <includehints> <includehint>knuminput.h</includehint> </includehints> diff --git a/kradio3/plugins/alsa-sound/alsa-mixer-element.cpp b/kradio3/plugins/alsa-sound/alsa-mixer-element.cpp index 1fbc75a..0843961 100644 --- a/kradio3/plugins/alsa-sound/alsa-mixer-element.cpp +++ b/kradio3/plugins/alsa-sound/alsa-mixer-element.cpp @@ -18,14 +18,14 @@ #include "alsa-mixer-element.h" #include <knuminput.h> -#include <qslider.h> -#include <qlabel.h> -#include <qcheckbox.h> +#include <tqslider.h> +#include <tqlabel.h> +#include <tqcheckbox.h> #include <math.h> -QAlsaMixerElement::QAlsaMixerElement(QWidget *parent, const QString &label, bool has_switch, bool has_volume) - : AlsaMixerElementUI(parent), +TQAlsaMixerElement::TQAlsaMixerElement(TQWidget *tqparent, const TQString &label, bool has_switch, bool has_volume) + : AlsaMixerElementUI(tqparent), m_HasVolume(has_volume), m_HasSwitch(has_switch), m_dirty(false), @@ -34,75 +34,75 @@ QAlsaMixerElement::QAlsaMixerElement(QWidget *parent, const QString &label, bool setLabel(label); setVolume(0); - QObject::connect(m_spinboxVolume, SIGNAL(valueChanged(int)), - this, SLOT (slotSpinboxValueChanged(int))); - QObject::connect(m_sliderVolume, SIGNAL(valueChanged(int)), - this, SLOT (slotSliderValueChanged(int))); + TQObject::connect(m_spinboxVolume, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT (slotSpinboxValueChanged(int))); + TQObject::connect(m_sliderVolume, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT (slotSliderValueChanged(int))); if (m_HasVolume) { - QObject::connect(m_checkboxOverride, SIGNAL(toggled(bool)), - m_spinboxVolume, SLOT (setEnabled(bool))); - QObject::connect(m_checkboxOverride, SIGNAL(toggled(bool)), - m_sliderVolume, SLOT (setEnabled(bool))); + TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), + m_spinboxVolume, TQT_SLOT (setEnabled(bool))); + TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), + m_sliderVolume, TQT_SLOT (setEnabled(bool))); } else { m_spinboxVolume->hide(); m_sliderVolume->hide(); } if (m_HasSwitch) { - QObject::connect(m_checkboxOverride, SIGNAL(toggled(bool)), - m_checkboxActive, SLOT (setEnabled(bool))); + TQObject::connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), + m_checkboxActive, TQT_SLOT (setEnabled(bool))); } else { //m_checkboxActive->hide(); m_checkboxActive->setEnabled(false); m_checkboxActive->setChecked(true); } - connect(m_checkboxOverride, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - connect(m_checkboxActive, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - connect(m_spinboxVolume, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); - connect(m_sliderVolume, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); + connect(m_checkboxOverride, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + connect(m_checkboxActive, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + connect(m_spinboxVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); + connect(m_sliderVolume, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); } -QAlsaMixerElement::~QAlsaMixerElement() +TQAlsaMixerElement::~TQAlsaMixerElement() { } -float QAlsaMixerElement::getVolume() const +float TQAlsaMixerElement::getVolume() const { return ((float)m_spinboxVolume->value())/100.0; } -bool QAlsaMixerElement::getActive() const +bool TQAlsaMixerElement::getActive() const { return m_checkboxActive->isChecked(); } -bool QAlsaMixerElement::getOverride() const +bool TQAlsaMixerElement::getOverride() const { return m_checkboxOverride->isChecked(); } -void QAlsaMixerElement::setLabel(const QString &label) +void TQAlsaMixerElement::setLabel(const TQString &label) { m_labelMixerElementName->setText(label); } -void QAlsaMixerElement::setOverride(bool ov) +void TQAlsaMixerElement::setOverride(bool ov) { m_ignore_updates = true; m_checkboxOverride->setChecked(ov); m_ignore_updates = false; } -void QAlsaMixerElement::setActive(bool active) +void TQAlsaMixerElement::setActive(bool active) { m_ignore_updates = true; m_checkboxActive->setChecked(active); m_ignore_updates = false; } -void QAlsaMixerElement::setVolume(float vol) +void TQAlsaMixerElement::setVolume(float vol) { m_ignore_updates = true; int v = (int)rint(vol*100 + 0.5); @@ -111,18 +111,18 @@ void QAlsaMixerElement::setVolume(float vol) m_ignore_updates = false; } -void QAlsaMixerElement::slotSpinboxValueChanged(int v) +void TQAlsaMixerElement::slotSpinboxValueChanged(int v) { m_sliderVolume->setValue(100-v); } -void QAlsaMixerElement::slotSliderValueChanged(int v) +void TQAlsaMixerElement::slotSliderValueChanged(int v) { m_spinboxVolume->setValue(100-v); } -void QAlsaMixerElement::slotSetDirty() +void TQAlsaMixerElement::slotSetDirty() { if (!m_dirty && !m_ignore_updates) { m_dirty = true; @@ -131,7 +131,7 @@ void QAlsaMixerElement::slotSetDirty() } -void QAlsaMixerElement::slotResetDirty() +void TQAlsaMixerElement::slotResetDirty() { m_dirty = false; } diff --git a/kradio3/plugins/alsa-sound/alsa-mixer-element.h b/kradio3/plugins/alsa-sound/alsa-mixer-element.h index 149e0b9..3dd7849 100644 --- a/kradio3/plugins/alsa-sound/alsa-mixer-element.h +++ b/kradio3/plugins/alsa-sound/alsa-mixer-element.h @@ -20,12 +20,13 @@ #include "alsa-mixer-element-ui.h" -class QAlsaMixerElement : public AlsaMixerElementUI +class TQAlsaMixerElement : public AlsaMixerElementUI { Q_OBJECT + TQ_OBJECT public: - QAlsaMixerElement(QWidget *parent, const QString &label, bool has_switch, bool has_volume); - ~QAlsaMixerElement(); + TQAlsaMixerElement(TQWidget *tqparent, const TQString &label, bool has_switch, bool has_volume); + ~TQAlsaMixerElement(); float getVolume() const; @@ -36,7 +37,7 @@ public: public slots: - void setLabel(const QString &label); + void setLabel(const TQString &label); void setOverride(bool ov); void setActive(bool active); void setVolume(float vol); diff --git a/kradio3/plugins/alsa-sound/alsa-sound-configuration-ui.ui b/kradio3/plugins/alsa-sound/alsa-sound-configuration-ui.ui index d1d2105..f0f9535 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound-configuration-ui.ui +++ b/kradio3/plugins/alsa-sound/alsa-sound-configuration-ui.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>AlsaSoundConfigurationUI</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>AlsaSoundConfigurationUI</cstring> </property> @@ -22,11 +22,11 @@ <property name="margin"> <number>0</number> </property> - <widget class="QTabWidget" row="0" column="0"> + <widget class="TQTabWidget" row="0" column="0"> <property name="name"> <cstring>kTabWidget8</cstring> </property> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>TabPage</cstring> </property> @@ -50,22 +50,22 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>5</height> </size> </property> </spacer> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout58</cstring> + <cstring>tqlayout58</cstring> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -86,7 +86,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="4" column="0"> + <widget class="TQLabel" row="4" column="0"> <property name="name"> <cstring>textLabel2_2_2</cstring> </property> @@ -164,7 +164,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="5" column="0"> + <widget class="TQLabel" row="5" column="0"> <property name="name"> <cstring>textLabel2_2_2_2</cstring> </property> @@ -185,7 +185,7 @@ </sizepolicy> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2_3</cstring> </property> @@ -193,7 +193,7 @@ <string>PCM Playback Device</string> </property> </widget> - <widget class="QLabel" row="3" column="0"> + <widget class="TQLabel" row="3" column="0"> <property name="name"> <cstring>textLabel2_4</cstring> </property> @@ -201,7 +201,7 @@ <string>PCM Capture Device</string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -213,7 +213,7 @@ </widget> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>TabPage</cstring> </property> @@ -227,7 +227,7 @@ <property name="margin"> <number>11</number> </property> - <widget class="QCheckBox" row="0" column="0"> + <widget class="TQCheckBox" row="0" column="0"> <property name="name"> <cstring>chkDisablePlayback</cstring> </property> @@ -238,7 +238,7 @@ <string>Alt+Y</string> </property> </widget> - <widget class="QCheckBox" row="1" column="0"> + <widget class="TQCheckBox" row="1" column="0"> <property name="name"> <cstring>chkDisableCapture</cstring> </property> @@ -259,7 +259,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>40</height> @@ -268,7 +268,7 @@ </spacer> </grid> </widget> - <widget class="QWidget"> + <widget class="TQWidget"> <property name="name"> <cstring>TabPage</cstring> </property> @@ -282,7 +282,7 @@ <property name="margin"> <number>11</number> </property> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>m_groupMixer</cstring> </property> @@ -311,7 +311,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="0"/> +<tqlayoutdefaults spacing="6" margin="0"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>kcombobox.h</includehint> diff --git a/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp b/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp index f4914f2..f7d3bf4 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp +++ b/kradio3/plugins/alsa-sound/alsa-sound-configuration.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qlayout.h> -#include <qscrollview.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqlayout.h> +#include <tqscrollview.h> #include <kurlrequester.h> #include <knuminput.h> @@ -32,8 +32,8 @@ #include "alsa-sound.h" -AlsaSoundConfiguration::AlsaSoundConfiguration (QWidget *parent, AlsaSoundDevice *dev) - : AlsaSoundConfigurationUI(parent), +AlsaSoundConfiguration::AlsaSoundConfiguration (TQWidget *tqparent, AlsaSoundDevice *dev) + : AlsaSoundConfigurationUI(tqparent), m_SoundDevice (dev), m_groupMixerLayout(NULL), m_groupMixerScrollView(NULL), @@ -41,30 +41,30 @@ AlsaSoundConfiguration::AlsaSoundConfiguration (QWidget *parent, AlsaSoundDevice m_dirty(true), m_ignore_updates(false) { - QObject::connect(m_comboPlaybackCard, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboCaptureCard, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboPlaybackDevice, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(m_comboCaptureDevice, SIGNAL(activated(int)), this, SLOT(slotSetDirty())); - QObject::connect(editHWBufferSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); - QObject::connect(editBufferSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty())); - QObject::connect(chkDisablePlayback, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - QObject::connect(chkDisableCapture, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty())); - - QObject::connect(m_comboPlaybackCard, SIGNAL(activated(const QString &)), - this, SLOT(slotPlaybackCardSelected(const QString &))); - QObject::connect(m_comboCaptureCard, SIGNAL(activated(const QString &)), - this, SLOT(slotCaptureCardSelected(const QString &))); + TQObject::connect(m_comboPlaybackCard, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboCaptureCard, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboPlaybackDevice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(m_comboCaptureDevice, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(editHWBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(editBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(chkDisablePlayback, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + TQObject::connect(chkDisableCapture, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty())); + + TQObject::connect(m_comboPlaybackCard, TQT_SIGNAL(activated(const TQString &)), + this, TQT_SLOT(slotPlaybackCardSelected(const TQString &))); + TQObject::connect(m_comboCaptureCard, TQT_SIGNAL(activated(const TQString &)), + this, TQT_SLOT(slotCaptureCardSelected(const TQString &))); m_groupMixer->setColumnLayout(0, Qt::Horizontal ); - QHBoxLayout *tmp_layout = new QHBoxLayout( m_groupMixer->layout() ); + TQHBoxLayout *tmp_layout = new TQHBoxLayout( m_groupMixer->tqlayout() ); - m_groupMixerScrollView = new QScrollView (m_groupMixer); - m_groupMixerScrollView->setFrameShape(QFrame::NoFrame); - m_groupMixerScrollView->setFrameShadow(QFrame::Plain); + m_groupMixerScrollView = new TQScrollView (m_groupMixer); + m_groupMixerScrollView->setFrameShape(TQFrame::NoFrame); + m_groupMixerScrollView->setFrameShadow(TQFrame::Plain); m_groupMixerScrollView->enableClipper(true); - m_groupMixerScrollView->setResizePolicy(QScrollView::AutoOneFit); - //m_groupMixerScrollView->setHScrollBarMode(QScrollView::AlwaysOn); + m_groupMixerScrollView->setResizePolicy(TQScrollView::AutoOneFit); + //m_groupMixerScrollView->setHScrollBarMode(TQScrollView::AlwaysOn); tmp_layout->addWidget(m_groupMixerScrollView); @@ -102,18 +102,18 @@ AlsaSoundConfiguration::~AlsaSoundConfiguration () } -void AlsaSoundConfiguration::slotPlaybackCardSelected(const QString &cardname) +void AlsaSoundConfiguration::slotPlaybackCardSelected(const TQString &cardname) { - if (!m_name2card.contains(cardname)) + if (!m_name2card.tqcontains(cardname)) return; listSoundDevices(m_comboPlaybackDevice, &m_playbackDeviceName2dev, &m_dev2playbackDeviceName, &m_playbackDevice2idx, m_name2card[cardname], SND_PCM_STREAM_PLAYBACK); } -void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) +void AlsaSoundConfiguration::slotCaptureCardSelected(const TQString &cardname) { - if (!m_name2card.contains(cardname)) + if (!m_name2card.tqcontains(cardname)) return; saveCaptureMixerSettings(); @@ -122,11 +122,11 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) m_currentCaptureCard = m_name2card[cardname]; - QStringList vol_list, sw_list, all_list; - QMap<QString, AlsaMixerElement> vol_ch2id, sw_ch2id; + TQStringList vol_list, sw_list, all_list; + TQMap<TQString, AlsaMixerElement> vol_ch2id, sw_ch2id; AlsaSoundDevice::getCaptureMixerChannels(m_name2card[cardname], NULL, vol_list, vol_ch2id, sw_list, sw_ch2id, &all_list); - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { delete *it; } m_MixerElements.clear(); @@ -134,20 +134,20 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) if (m_groupMixerSubFrame) delete m_groupMixerSubFrame; - m_groupMixerSubFrame = new QFrame(m_groupMixerScrollView->viewport()); - m_groupMixerSubFrame->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); + m_groupMixerSubFrame = new TQFrame(m_groupMixerScrollView->viewport()); + m_groupMixerSubFrame->tqsetSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Maximum); m_groupMixerScrollView->addChild(m_groupMixerSubFrame); int rows = 1; int cols = (all_list.count()+rows-1)/rows; - m_groupMixerLayout = new QGridLayout( m_groupMixerSubFrame, rows, cols, 0, 0 ); - m_groupMixerLayout->setAlignment( Qt::AlignBottom ); + m_groupMixerLayout = new TQGridLayout( m_groupMixerSubFrame, rows, cols, 0, 0 ); + m_groupMixerLayout->tqsetAlignment( TQt::AlignBottom ); int idx = 0; - for (QValueListConstIterator<QString> it = all_list.begin(); it != all_list.end(); ++it, ++idx) { - QAlsaMixerElement *e = new QAlsaMixerElement(m_groupMixerSubFrame, *it, - sw_list.contains(*it), vol_list.contains(*it)); - QObject::connect(e, SIGNAL(sigDirty()), this, SLOT(slotSetDirty())); + for (TQValueListConstIterator<TQString> it = all_list.begin(); it != all_list.end(); ++it, ++idx) { + TQAlsaMixerElement *e = new TQAlsaMixerElement(m_groupMixerSubFrame, *it, + sw_list.tqcontains(*it), vol_list.tqcontains(*it)); + TQObject::connect(e, TQT_SIGNAL(sigDirty()), this, TQT_SLOT(slotSetDirty())); m_groupMixerLayout->addWidget(e, idx > cols, idx % cols); e->show(); m_MixerElements.insert(*it, e); @@ -158,11 +158,11 @@ void AlsaSoundConfiguration::slotCaptureCardSelected(const QString &cardname) void AlsaSoundConfiguration::saveCaptureMixerSettings() { - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { - const QString &name = it.key(); + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + const TQString &name = it.key(); int card = m_currentCaptureCard; - QString id = AlsaConfigMixerSetting::getIDString(card, name); - QAlsaMixerElement *e = *it; + TQString id = AlsaConfigMixerSetting::getIDString(card, name); + TQAlsaMixerElement *e = *it; float vol = e->getVolume(); bool use = e->getOverride(); bool active = e->getActive(); @@ -173,13 +173,13 @@ void AlsaSoundConfiguration::saveCaptureMixerSettings() void AlsaSoundConfiguration::restoreCaptureMixerSettings() { - for (QMapIterator<QString, QAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { - const QString &name = it.key(); + for (TQMapIterator<TQString, TQAlsaMixerElement*> it = m_MixerElements.begin(); it != m_MixerElements.end(); ++it) { + const TQString &name = it.key(); int card = m_currentCaptureCard; - QString id = AlsaConfigMixerSetting::getIDString(card, name); - QAlsaMixerElement *e = *it; + TQString id = AlsaConfigMixerSetting::getIDString(card, name); + TQAlsaMixerElement *e = *it; - if (m_MixerSettings.contains(id)) { + if (m_MixerSettings.tqcontains(id)) { const AlsaConfigMixerSetting &s = m_MixerSettings[id]; e->setVolume(s.m_volume); e->setOverride(s.m_use); @@ -211,7 +211,7 @@ void AlsaSoundConfiguration::restoreCaptureMixerSettings() } } -int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, int> *devname2dev, QMap<int, QString> *dev2devname, QMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream) +int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, TQMap<TQString, int> *devname2dev, TQMap<int, TQString> *dev2devname, TQMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream) { snd_ctl_t *handle = NULL; int dev = -1; @@ -221,7 +221,7 @@ int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, snd_ctl_card_info_alloca(&info); snd_pcm_info_alloca (&pcminfo); - QString ctlname = "hw:"+QString::number(card); + TQString ctlname = "hw:"+TQString::number(card); if (combobox) combobox->clear(); @@ -250,12 +250,12 @@ int AlsaSoundConfiguration::listSoundDevices(KComboBox *combobox, QMap<QString, int err = 0; if ((err = snd_ctl_pcm_info(handle, pcminfo)) < 0) { if (err != -ENOENT) { - //logError(QString("control digital audio info (%1): %2").arg(card).arg(snd_strerror(err))); + //logError(TQString("control digital audio info (%1): %2").tqarg(card).tqarg(snd_strerror(err))); } continue; } const char *dev_name = snd_pcm_info_get_name(pcminfo); - QString devname = i18n("context-card-plus-device-number", "%1 device %2").arg(dev_name).arg(dev); + TQString devname = i18n("context-card-plus-device-number", "%1 device %2").tqarg(dev_name).tqarg(dev); if (combobox) combobox->insertItem(devname); if (devname2dev) @@ -315,14 +315,14 @@ void AlsaSoundConfiguration::slotCancel() slotCaptureCardSelected(m_comboCaptureCard->currentText()); m_comboCaptureDevice->setCurrentItem(m_captureDevice2idx[dev]); - //IErrorLogClient::staticLogDebug(QString("capture: card = %1(%2), dev = %3").arg(card).arg(m_captureCard2idx[card]).arg(dev)); + //IErrorLogClient::staticLogDebug(TQString("capture: card = %1(%2), dev = %3").tqarg(card).tqarg(m_captureCard2idx[card]).tqarg(dev)); editHWBufferSize ->setValue (m_SoundDevice ? m_SoundDevice->getHWBufferSize()/1024 : 4); editBufferSize ->setValue (m_SoundDevice ? m_SoundDevice->getBufferSize()/1024 : 4); chkDisablePlayback->setChecked(m_SoundDevice ? !m_SoundDevice->isPlaybackEnabled() : false); chkDisableCapture ->setChecked(m_SoundDevice ? !m_SoundDevice->isCaptureEnabled() : false); - //IErrorLogClient::staticLogDebug(QString("capture: card = %1").arg(m_comboCaptureCard->currentText())); + //IErrorLogClient::staticLogDebug(TQString("capture: card = %1").tqarg(m_comboCaptureCard->currentText())); if (m_SoundDevice) diff --git a/kradio3/plugins/alsa-sound/alsa-sound-configuration.h b/kradio3/plugins/alsa-sound/alsa-sound-configuration.h index 0dd361a..39eda64 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound-configuration.h +++ b/kradio3/plugins/alsa-sound/alsa-sound-configuration.h @@ -26,17 +26,18 @@ #include "alsa-sound.h" #include "alsa-config-mixer-setting.h" -class QHBoxLayout; -class QGridLayout; -class QAlsaMixerElement; -class QScrollView; -class QFrame; +class TQHBoxLayout; +class TQGridLayout; +class TQAlsaMixerElement; +class TQScrollView; +class TQFrame; class AlsaSoundConfiguration : public AlsaSoundConfigurationUI { Q_OBJECT + TQ_OBJECT public : - AlsaSoundConfiguration (QWidget *parent, AlsaSoundDevice *); + AlsaSoundConfiguration (TQWidget *tqparent, AlsaSoundDevice *); ~AlsaSoundConfiguration (); protected slots: @@ -48,33 +49,33 @@ protected slots: void slotUpdateConfig(); - void slotPlaybackCardSelected(const QString &cardname); - void slotCaptureCardSelected(const QString &cardname); + void slotPlaybackCardSelected(const TQString &cardname); + void slotCaptureCardSelected(const TQString &cardname); protected: - int listSoundDevices(KComboBox *combobox, QMap<QString, int> *devname2dev, QMap<int, QString> *dev2devname, QMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream); + int listSoundDevices(KComboBox *combobox, TQMap<TQString, int> *devname2dev, TQMap<int, TQString> *dev2devname, TQMap<int, int> *dev2idx, int card, snd_pcm_stream_t stream); void saveCaptureMixerSettings(); void restoreCaptureMixerSettings(); AlsaSoundDevice *m_SoundDevice; int m_currentCaptureCard; - QMap<QString, int> m_name2card, + TQMap<TQString, int> m_name2card, m_name2capturedevice, m_playbackDeviceName2dev, m_captureDeviceName2dev; - QMap<int, QString> m_card2name, + TQMap<int, TQString> m_card2name, m_dev2playbackDeviceName, m_dev2captureDeviceName; - QMap<int, int> m_captureCard2idx, + TQMap<int, int> m_captureCard2idx, m_captureDevice2idx, m_playbackCard2idx, m_playbackDevice2idx; - QGridLayout *m_groupMixerLayout; - QScrollView *m_groupMixerScrollView; - QFrame *m_groupMixerSubFrame; - QMap<QString, QAlsaMixerElement*> m_MixerElements; + TQGridLayout *m_groupMixerLayout; + TQScrollView *m_groupMixerScrollView; + TQFrame *m_groupMixerSubFrame; + TQMap<TQString, TQAlsaMixerElement*> m_MixerElements; - QMap<QString, AlsaConfigMixerSetting> m_MixerSettings; + TQMap<TQString, AlsaConfigMixerSetting> m_MixerSettings; bool m_dirty; bool m_ignore_updates; diff --git a/kradio3/plugins/alsa-sound/alsa-sound.cpp b/kradio3/plugins/alsa-sound/alsa-sound.cpp index d67d5c8..1b4625e 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound.cpp +++ b/kradio3/plugins/alsa-sound/alsa-sound.cpp @@ -43,8 +43,8 @@ PLUGIN_LIBRARY_FUNCTIONS(AlsaSoundDevice, "kradio-alsa-sound", i18n("Advanced Li struct _lrvol { unsigned char l, r; short dummy; }; -AlsaSoundDevice::AlsaSoundDevice(const QString &name) - : QObject(NULL, NULL), +AlsaSoundDevice::AlsaSoundDevice(const TQString &name) + : TQObject(NULL, NULL), PluginBase(name, i18n("KRadio ALSA Sound Plugin")), m_hPlayback(NULL), m_hCapture(NULL), @@ -74,8 +74,8 @@ AlsaSoundDevice::AlsaSoundDevice(const QString &name) m_EnableCapture(true)//, // m_captureThread(NULL) { - QObject::connect(&m_PlaybackPollingTimer, SIGNAL(timeout()), this, SLOT(slotPollPlayback())); - QObject::connect(&m_CapturePollingTimer, SIGNAL(timeout()), this, SLOT(slotPollCapture())); + TQObject::connect(&m_PlaybackPollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotPollPlayback())); + TQObject::connect(&m_CapturePollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotPollCapture())); } @@ -134,7 +134,7 @@ void AlsaSoundDevice::noticeConnectedI (ISoundStreamServer *s, bool pointer_vali void AlsaSoundDevice::saveState (KConfig *c) const { - c->setGroup(QString("alsa-sound-") + PluginBase::name()); + c->setGroup(TQString("alsa-sound-") + PluginBase::name()); c->writeEntry("playback-card", m_PlaybackCard); c->writeEntry("playback-device", m_PlaybackDevice); @@ -148,9 +148,9 @@ void AlsaSoundDevice::saveState (KConfig *c) const c->writeEntry("mixer-settings", m_CaptureMixerSettings.count()); int i = 0; - for (QMapConstIterator<QString, AlsaConfigMixerSetting> it = m_CaptureMixerSettings.begin(); it != m_CaptureMixerSettings.end(); ++it, ++i) { + for (TQMapConstIterator<TQString, AlsaConfigMixerSetting> it = m_CaptureMixerSettings.begin(); it != m_CaptureMixerSettings.end(); ++it, ++i) { - QString prefix = QString("mixer-setting-%1-").arg(i); + TQString prefix = TQString("mixer-setting-%1-").tqarg(i); (*it).saveState(c, prefix); } @@ -159,7 +159,7 @@ void AlsaSoundDevice::saveState (KConfig *c) const void AlsaSoundDevice::restoreState (KConfig *c) { - c->setGroup(QString("alsa-sound-") + PluginBase::name()); + c->setGroup(TQString("alsa-sound-") + PluginBase::name()); m_EnablePlayback = c->readBoolEntry("enable-playback", true); m_EnableCapture = c->readBoolEntry("enable-capture", true); @@ -179,7 +179,7 @@ void AlsaSoundDevice::restoreState (KConfig *c) int n = c->readNumEntry("mixer-settings", 0); for (int i = 0; i < n; ++i) { - QString prefix = QString("mixer-setting-%1-").arg(i); + TQString prefix = TQString("mixer-setting-%1-").tqarg(i); AlsaConfigMixerSetting s(c, prefix); m_CaptureMixerSettings.insert(s.getIDString(), s); } @@ -191,7 +191,7 @@ void AlsaSoundDevice::restoreState (KConfig *c) ConfigPageInfo AlsaSoundDevice::createConfigurationPage() { AlsaSoundConfiguration *conf = new AlsaSoundConfiguration(NULL, this); - QObject::connect(this, SIGNAL(sigUpdateConfig()), conf, SLOT(slotUpdateConfig())); + TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig())); return ConfigPageInfo (conf, i18n("ALSA Sound"), i18n("ALSA Sound Device Options"), @@ -224,7 +224,7 @@ AboutPageInfo AlsaSoundDevice::createAboutPage() -bool AlsaSoundDevice::preparePlayback(SoundStreamID id, const QString &channel, bool active_mode, bool start_immediately) +bool AlsaSoundDevice::preparePlayback(SoundStreamID id, const TQString &channel, bool active_mode, bool start_immediately) { if (id.isValid()) { m_PlaybackStreams.insert(id, SoundStreamConfig(channel, active_mode)); @@ -236,7 +236,7 @@ bool AlsaSoundDevice::preparePlayback(SoundStreamID id, const QString &channel, return false; } -bool AlsaSoundDevice::prepareCapture(SoundStreamID id, const QString &channel) +bool AlsaSoundDevice::prepareCapture(SoundStreamID id, const TQString &channel) { if (id.isValid()) { m_CaptureStreams.insert(id, SoundStreamConfig(channel)); @@ -248,8 +248,8 @@ bool AlsaSoundDevice::prepareCapture(SoundStreamID id, const QString &channel) bool AlsaSoundDevice::releasePlayback(SoundStreamID id) { - if (id.isValid() && m_PlaybackStreams.contains(id)) { - if (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id)) { + if (id.isValid() && m_PlaybackStreams.tqcontains(id)) { + if (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id)) { stopPlayback(id); } m_PlaybackStreams.remove(id); @@ -260,7 +260,7 @@ bool AlsaSoundDevice::releasePlayback(SoundStreamID id) bool AlsaSoundDevice::releaseCapture(SoundStreamID id) { - if (id.isValid() && m_CaptureStreams.contains(id)) { + if (id.isValid() && m_CaptureStreams.tqcontains(id)) { if (m_CaptureStreamID == id) { stopCapture(id); } @@ -284,7 +284,7 @@ bool AlsaSoundDevice::supportsCapture() const bool AlsaSoundDevice::startPlayback(SoundStreamID id) { - if (id.isValid() && m_PlaybackStreams.contains(id) && m_EnablePlayback) { + if (id.isValid() && m_PlaybackStreams.tqcontains(id) && m_EnablePlayback) { SoundStreamConfig &cfg = m_PlaybackStreams[id]; @@ -295,7 +295,7 @@ bool AlsaSoundDevice::startPlayback(SoundStreamID id) ok = true; } } else { - if (!m_PassivePlaybackStreams.contains(id)) + if (!m_PassivePlaybackStreams.tqcontains(id)) m_PassivePlaybackStreams.append(id); ok = true; } @@ -326,12 +326,12 @@ bool AlsaSoundDevice::pausePlayback(SoundStreamID /*id*/) bool AlsaSoundDevice::stopPlayback(SoundStreamID id) { - if (id.isValid() && m_PlaybackStreams.contains(id)) { + if (id.isValid() && m_PlaybackStreams.tqcontains(id)) { SoundStreamConfig &cfg = m_PlaybackStreams[id]; if (!cfg.m_ActiveMode) { - if (m_PassivePlaybackStreams.contains(id)) { + if (m_PassivePlaybackStreams.tqcontains(id)) { /* float tmp = 0; writePlaybackMixerVolume(cfg.m_Channel, tmp, true);*/ m_PassivePlaybackStreams.remove(id); @@ -351,7 +351,7 @@ bool AlsaSoundDevice::stopPlayback(SoundStreamID id) bool AlsaSoundDevice::isPlaybackRunning(SoundStreamID id, bool &b) const { - if (id.isValid() && m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id)) { + if (id.isValid() && m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id)) { b = true; return true; } else { @@ -364,7 +364,7 @@ bool AlsaSoundDevice::startCaptureWithFormat(SoundStreamID id, SoundFormat &real_format, bool force_format) { - if (m_CaptureStreams.contains(id) && m_EnableCapture) { + if (m_CaptureStreams.tqcontains(id) && m_EnableCapture) { if (m_CaptureStreamID != id) { m_CapturePos = 0; @@ -418,9 +418,9 @@ bool AlsaSoundDevice::stopCapture(SoundStreamID id) slotPollCapture(); // if (m_captureThread->error()) { -// logError(i18n("ALSA Plugin, device plughw:%1,%2: %3").arg(m_CaptureCard) -// .arg(m_CaptureDevice) -// .arg(i18n("unknown error"))); +// logError(i18n("ALSA Plugin, device plughw:%1,%2: %3").tqarg(m_CaptureCard) +// .tqarg(m_CaptureDevice) +// .tqarg(i18n("unknown error"))); // } // // delete m_captureThread; @@ -454,7 +454,7 @@ bool AlsaSoundDevice::isCaptureRunning(SoundStreamID id, bool &b, SoundFormat &s bool AlsaSoundDevice::noticeSoundStreamClosed(SoundStreamID id) { bool found = false; - if (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id)) { + if (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id)) { stopPlayback(id); found = true; } @@ -471,13 +471,13 @@ bool AlsaSoundDevice::noticeSoundStreamClosed(SoundStreamID id) bool AlsaSoundDevice::noticeSoundStreamRedirected(SoundStreamID oldID, SoundStreamID newID) { bool found = false; - if (m_PlaybackStreams.contains(oldID)) { + if (m_PlaybackStreams.tqcontains(oldID)) { m_PlaybackStreams.insert(newID, m_PlaybackStreams[oldID]); if (newID != oldID) m_PlaybackStreams.remove(oldID); found = true; } - if (m_CaptureStreams.contains(oldID)) { + if (m_CaptureStreams.tqcontains(oldID)) { m_CaptureStreams.insert(newID, m_CaptureStreams[oldID]); if (newID != oldID) m_CaptureStreams.remove(oldID); @@ -488,7 +488,7 @@ bool AlsaSoundDevice::noticeSoundStreamRedirected(SoundStreamID oldID, SoundStre m_PlaybackStreamID = newID; if (m_CaptureStreamID == oldID) m_CaptureStreamID = newID; - if (m_PassivePlaybackStreams.contains(oldID)) { + if (m_PassivePlaybackStreams.tqcontains(oldID)) { m_PassivePlaybackStreams.remove(oldID); m_PassivePlaybackStreams.append(newID); } @@ -526,7 +526,7 @@ bool AlsaSoundDevice::noticeSoundStreamData(SoundStreamID id, /* if (n < size) { m_PlaybackSkipCount += size - n; } else if (m_PlaybackSkipCount > 0) { - logWarning(i18n("plughw:%1,%2: Playback buffer overflow. Skipped %3 bytes").arg(m_PlaybackCard).arg(m_PlaybackDevice).arg(QString::number(m_PlaybackSkipCount))); + logWarning(i18n("plughw:%1,%2: Playback buffer overflow. Skipped %3 bytes").tqarg(m_PlaybackCard).tqarg(m_PlaybackDevice).tqarg(TQString::number(m_PlaybackSkipCount))); m_PlaybackSkipCount = 0; } return m_PlaybackSkipCount == 0;*/ @@ -550,12 +550,12 @@ void AlsaSoundDevice::slotPollPlayback() if (framesWritten > 0) { m_PlaybackBuffer.removeData(bytesWritten); } else if (framesWritten == 0) { - logError(i18n("ALSA Plugin: cannot write data for device plughw:%1,%2").arg(m_PlaybackCard).arg(m_PlaybackDevice)); + logError(i18n("ALSA Plugin: cannot write data for device plughw:%1,%2").tqarg(m_PlaybackCard).tqarg(m_PlaybackDevice)); } else if (framesWritten == -EAGAIN) { // do nothing } else { snd_pcm_prepare(m_hPlayback); - logWarning(i18n("ALSA Plugin: buffer underrun for device plughw:%1,%2").arg(m_PlaybackCard).arg(m_PlaybackDevice)); + logWarning(i18n("ALSA Plugin: buffer underrun for device plughw:%1,%2").tqarg(m_PlaybackCard).tqarg(m_PlaybackDevice)); } } @@ -566,8 +566,8 @@ void AlsaSoundDevice::slotPollPlayback() checkMixerVolume(m_PlaybackStreamID); } - QValueListConstIterator<SoundStreamID> end = m_PassivePlaybackStreams.end(); - for (QValueListConstIterator<SoundStreamID> it = m_PassivePlaybackStreams.begin(); it != end; ++it) + TQValueListConstIterator<SoundStreamID> end = m_PassivePlaybackStreams.end(); + for (TQValueListConstIterator<SoundStreamID> it = m_PassivePlaybackStreams.begin(); it != end; ++it) checkMixerVolume(*it); } @@ -577,7 +577,7 @@ void AlsaSoundDevice::slotPollCapture() if (m_CaptureStreamID.isValid() && m_hCapture) { // while (m_captureThread && m_captureThread->getAvailableReadBuffers()) { -// QString dev = QString("alsa://plughw:%1,%2").arg(m_CaptureCard).arg(m_CaptureDevice); +// TQString dev = TQString("alsa://plughw:%1,%2").tqarg(m_CaptureCard).tqarg(m_CaptureDevice); // size_t size = 0; // char *buffer = m_captureThread->getReadBuffer(size); // time_t cur_time = time(NULL); @@ -608,22 +608,22 @@ void AlsaSoundDevice::slotPollCapture() m_CaptureBuffer.removeFreeSpace(bytesRead); } else if (framesRead == 0) { snd_pcm_prepare(m_hCapture); - logError(i18n("ALSA Plugin: cannot read data from device plughw:%1,%2").arg(m_CaptureCard).arg(m_CaptureDevice)); + logError(i18n("ALSA Plugin: cannot read data from device plughw:%1,%2").tqarg(m_CaptureCard).tqarg(m_CaptureDevice)); } else if (framesRead == -EAGAIN) { // do nothing } else { snd_pcm_prepare(m_hCapture); - logWarning(i18n("ALSA Plugin: buffer overrun for device plughw:%1,%2 (buffersize=%3, buffer=%4)").arg(m_CaptureCard).arg(m_CaptureDevice).arg(bufferSize).arg((long long unsigned)buffer)); + logWarning(i18n("ALSA Plugin: buffer overrun for device plughw:%1,%2 (buffersize=%3, buffer=%4)").tqarg(m_CaptureCard).tqarg(m_CaptureDevice).tqarg(bufferSize).tqarg((long long unsigned)buffer)); } - QString dev = QString("alsa://plughw:%1,%2").arg(m_CaptureCard).arg(m_CaptureDevice); + TQString dev = TQString("alsa://plughw:%1,%2").tqarg(m_CaptureCard).tqarg(m_CaptureDevice); while (m_CaptureBuffer.getFillSize() > m_CaptureBuffer.getSize() / 3) { size_t size = 0; buffer = m_CaptureBuffer.getData(size); time_t cur_time = time(NULL); size_t consumed_size = SIZE_T_DONT_CARE; - notifySoundStreamData(m_CaptureStreamID, m_CaptureFormat, buffer, size, consumed_size, SoundMetaData(m_CapturePos, cur_time - m_CaptureStartTime, cur_time, i18n("internal stream, not stored (%1)").arg(dev))); + notifySoundStreamData(m_CaptureStreamID, m_CaptureFormat, buffer, size, consumed_size, SoundMetaData(m_CapturePos, cur_time - m_CaptureStartTime, cur_time, i18n("internal stream, not stored (%1)").tqarg(dev))); if (consumed_size == SIZE_T_DONT_CARE) consumed_size = size; @@ -664,7 +664,7 @@ bool AlsaSoundDevice::openPlaybackDevice(const SoundFormat &format, bool reopen) m_PlaybackFormat = format; - QString dev = QString("plughw:%1,%2").arg(m_PlaybackCard).arg(m_PlaybackDevice); + TQString dev = TQString("plughw:%1,%2").tqarg(m_PlaybackCard).tqarg(m_PlaybackDevice); bool error = !openAlsaDevice(m_hPlayback, m_PlaybackFormat, dev.ascii(), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK, m_PlaybackLatency); if (!error) { @@ -704,7 +704,7 @@ bool AlsaSoundDevice::openCaptureDevice(const SoundFormat &format, bool reopen) m_CaptureFormat = format; - QString dev = QString("plughw:%1,%2").arg(m_CaptureCard).arg(m_CaptureDevice); + TQString dev = TQString("plughw:%1,%2").tqarg(m_CaptureCard).tqarg(m_CaptureDevice); // bool error = !openAlsaDevice(m_hCapture, m_CaptureFormat, dev.ascii(), SND_PCM_STREAM_CAPTURE, /*flags = block*/0, m_CaptureLatency); bool error = !openAlsaDevice(m_hCapture, m_CaptureFormat, dev.ascii(), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK, m_CaptureLatency); @@ -733,19 +733,19 @@ bool AlsaSoundDevice::openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &forma /* OPEN */ if (!error && snd_pcm_open(&alsa_handle, pcm_name, stream, flags) < 0) { - logError(i18n("ALSA Plugin: Error opening PCM device %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error opening PCM device %1").tqarg(pcm_name)); error = true; } if (!error && snd_pcm_hw_params_any(alsa_handle, hwparams) < 0) { - logError(i18n("ALSA Plugin: Can not configure PCM device %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Can not configure PCM device %1").tqarg(pcm_name)); error = true; } /* interleaved access type */ if (!error && snd_pcm_hw_params_set_access(alsa_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0) { - logError(i18n("ALSA Plugin: Error setting access for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error setting access for %1").tqarg(pcm_name)); error = true; } @@ -755,30 +755,30 @@ bool AlsaSoundDevice::openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &forma !format.m_IsSigned, format.m_Endianess == BIG_ENDIAN); if (!error && snd_pcm_hw_params_set_format(alsa_handle, hwparams, sample_format) < 0) { - logError(i18n("ALSA Plugin: Error setting sample format for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error setting sample format for %1").tqarg(pcm_name)); error = true; } /* channels */ if (!error && snd_pcm_hw_params_set_channels(alsa_handle, hwparams, format.m_Channels) < 0) { - logError(i18n("ALSA Plugin: Error setting channels for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error setting channels for %1").tqarg(pcm_name)); error = true; } /* sample rate */ int rate = format.m_SampleRate; if (!error && snd_pcm_hw_params_set_rate_near(alsa_handle, hwparams, &format.m_SampleRate, &dir) < 0) { - logError(i18n("ALSA Plugin: Error setting rate for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error setting rate for %1").tqarg(pcm_name)); error = true; } if (!error && format.m_SampleRate != format.m_SampleRate) { - logWarning(i18n("ALSA Plugin: The rate %1 Hz is not supported by your hardware %2. Using %3 Hz instead").arg(rate).arg(pcm_name).arg(format.m_SampleRate)); + logWarning(i18n("ALSA Plugin: The rate %1 Hz is not supported by your hardware %2. Using %3 Hz instead").tqarg(rate).tqarg(pcm_name).tqarg(format.m_SampleRate)); } snd_pcm_uframes_t period_size = m_HWBufferSize / format.frameSize(); if (!error && snd_pcm_hw_params_set_period_size_near(alsa_handle, hwparams, &period_size, &dir) < 0) { - logError(i18n("ALSA Plugin: Error setting period size for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error setting period size for %1").tqarg(pcm_name)); error = true; } @@ -788,7 +788,7 @@ bool AlsaSoundDevice::openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &forma // // /* fragments */ // if (!error && snd_pcm_hw_params_set_periods(alsa_handle, hwparams, periods, 0) < 0) { -// logError(i18n("ALSA Plugin: Error setting periods for %1").arg(pcm_name)); +// logError(i18n("ALSA Plugin: Error setting periods for %1").tqarg(pcm_name)); // error = true; // } @@ -798,17 +798,17 @@ bool AlsaSoundDevice::openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &forma // if (!error && snd_pcm_hw_params_set_buffer_size_near(alsa_handle, hwparams, &exact_buffersize_frames) < 0) { // exact_buffersize_frames = 4096; // if (!error && snd_pcm_hw_params_set_buffer_size_near(alsa_handle, hwparams, &exact_buffersize_frames) < 0) { -// logError(i18n("ALSA Plugin: Error setting buffersize for %1").arg(pcm_name)); +// logError(i18n("ALSA Plugin: Error setting buffersize for %1").tqarg(pcm_name)); // error = true; // } // } // size_t exact_buffersize = exact_buffersize_frames * format.frameSize(); // if (!error && m_HWBufferSize != exact_buffersize) { -// logWarning(i18n("ALSA Plugin: Hardware %1 does not support buffer size of %2. Using buffer size of %3 instead.").arg(pcm_name).arg(m_HWBufferSize).arg(exact_buffersize)); +// logWarning(i18n("ALSA Plugin: Hardware %1 does not support buffer size of %2. Using buffer size of %3 instead.").tqarg(pcm_name).tqarg(m_HWBufferSize).tqarg(exact_buffersize)); // size_t tmp = (((m_HWBufferSize - 1) / exact_buffersize) + 1) * exact_buffersize; // setHWBufferSize(tmp); -// logInfo(i18n("ALSA Plugin: adjusted buffer size for %1 to %2 bytes").arg(pcm_name).arg(QString::number(tmp))); +// logInfo(i18n("ALSA Plugin: adjusted buffer size for %1 to %2 bytes").tqarg(pcm_name).tqarg(TQString::number(tmp))); // } /* set all params */ @@ -819,7 +819,7 @@ bool AlsaSoundDevice::openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &forma } if (!error && snd_pcm_hw_params_get_period_size(hwparams, &period_size, &dir) < 0) { - logError(i18n("ALSA Plugin: Error getting period size for %1").arg(pcm_name)); + logError(i18n("ALSA Plugin: Error getting period size for %1").tqarg(pcm_name)); error = true; } @@ -884,7 +884,7 @@ bool AlsaSoundDevice::openPlaybackMixerDevice(bool reopen) bool AlsaSoundDevice::openCaptureMixerDevice(bool reopen) { -// logDebug("AlsaSoundDevice::openCaptureMixerDevice: card == " + QString::number(m_CaptureCard)); +// logDebug("AlsaSoundDevice::openCaptureMixerDevice: card == " + TQString::number(m_CaptureCard)); return openMixerDevice(m_hCaptureMixer, m_CaptureCard, reopen, &m_CapturePollingTimer, m_CaptureLatency); } @@ -900,12 +900,12 @@ bool AlsaSoundDevice::closeCaptureMixerDevice(bool force) } -static int mixer_dummy_callback(snd_mixer_t *, unsigned int /*mask*/, snd_mixer_elem_t */*elem*/) +static int mixer_dummy_callback(snd_mixer_t *, unsigned int /*tqmask*/, snd_mixer_elem_t */*elem*/) { return 0; } -bool AlsaSoundDevice::openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, QTimer *timer, int timer_latency) +bool AlsaSoundDevice::openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, TQTimer *timer, int timer_latency) { if (reopen) { if (mixer_handle >= 0) @@ -920,22 +920,22 @@ bool AlsaSoundDevice::openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool staticLogError(i18n("ALSA Plugin: Error opening mixer")); error = true; } - QString cardid = "hw:" + QString::number(card); + TQString cardid = "hw:" + TQString::number(card); bool attached = false; if (!error) { if (snd_mixer_attach (mixer_handle, cardid.ascii()) < 0) { - staticLogError(i18n("ALSA Plugin: ERROR: snd_mixer_attach for card %1").arg(card)); + staticLogError(i18n("ALSA Plugin: ERROR: snd_mixer_attach for card %1").tqarg(card)); error = true; } else { attached = true; } } if (!error && snd_mixer_selem_register(mixer_handle, NULL, NULL) < 0) { - staticLogError(i18n("ALSA Plugin: Error: snd_mixer_selem_register for card %1").arg(card)); + staticLogError(i18n("ALSA Plugin: Error: snd_mixer_selem_register for card %1").tqarg(card)); error = true; } if (!error && snd_mixer_load (mixer_handle) < 0) { - staticLogError(i18n("ALSA Plugin: Error: snd_mixer_load for card %1").arg(card)); + staticLogError(i18n("ALSA Plugin: Error: snd_mixer_load for card %1").tqarg(card)); error = true; } if (mixer_handle) { @@ -958,7 +958,7 @@ bool AlsaSoundDevice::openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool } -bool AlsaSoundDevice::closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, QTimer *timer) +bool AlsaSoundDevice::closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, TQTimer *timer) { if (!id.isValid() || force) { @@ -966,7 +966,7 @@ bool AlsaSoundDevice::closeMixerDevice(snd_mixer_t *&mixer_handle, int card, Sou timer->stop(); if (mixer_handle) { - QString cardid = "hw:" + QString::number(card); + TQString cardid = "hw:" + TQString::number(card); snd_mixer_free(mixer_handle); snd_mixer_detach(mixer_handle, cardid.ascii()); snd_mixer_close (mixer_handle); @@ -979,7 +979,7 @@ bool AlsaSoundDevice::closeMixerDevice(snd_mixer_t *&mixer_handle, int card, Sou void AlsaSoundDevice::getPlaybackMixerChannels( int card, snd_mixer_t *__mixer_handle, - QStringList &retval, QMap<QString, AlsaMixerElement> &ch2id) + TQStringList &retval, TQMap<TQString, AlsaMixerElement> &ch2id) { retval.clear(); ch2id.clear(); @@ -1000,10 +1000,10 @@ void AlsaSoundDevice::getPlaybackMixerChannels( if (!snd_mixer_selem_is_active(elem)) continue; snd_mixer_selem_get_id(elem, sid); - QString name = snd_mixer_selem_id_get_name(sid); + TQString name = snd_mixer_selem_id_get_name(sid); int idx = snd_mixer_selem_id_get_index(sid); if (idx) - name = i18n("context-mixername-number", "%1 %2").arg(name).arg(idx); + name = i18n("context-mixername-number", "%1 %2").tqarg(name).tqarg(idx); if (snd_mixer_selem_has_playback_volume(elem)) { ch2id[name] = sid; retval.append(name); @@ -1019,9 +1019,9 @@ void AlsaSoundDevice::getPlaybackMixerChannels( void AlsaSoundDevice::getCaptureMixerChannels( int card, snd_mixer_t *__mixer_handle, - QStringList &vol_list, QMap<QString, AlsaMixerElement> &vol_ch2id, - QStringList &sw_list, QMap<QString, AlsaMixerElement> &sw_ch2id, - QStringList *all_list + TQStringList &vol_list, TQMap<TQString, AlsaMixerElement> &vol_ch2id, + TQStringList &sw_list, TQMap<TQString, AlsaMixerElement> &sw_ch2id, + TQStringList *all_list ) { vol_list.clear(); @@ -1034,7 +1034,7 @@ void AlsaSoundDevice::getCaptureMixerChannels( bool use_tmp_handle = false; if (!mixer_handle) { -// staticLogDebug("AlsaSoundDevice::getCaptureMixerChannels: card == " + QString::number(card/*m_CaptureCard*/)); +// staticLogDebug("AlsaSoundDevice::getCaptureMixerChannels: card == " + TQString::number(card/*m_CaptureCard*/)); openMixerDevice(mixer_handle, card /*m_CaptureCard*/, false, NULL, 0); use_tmp_handle = true; } @@ -1047,10 +1047,10 @@ void AlsaSoundDevice::getCaptureMixerChannels( if (!snd_mixer_selem_is_active(elem)) continue; snd_mixer_selem_get_id(elem, sid); - QString name = snd_mixer_selem_id_get_name(sid); + TQString name = snd_mixer_selem_id_get_name(sid); int idx = snd_mixer_selem_id_get_index(sid); if (idx) - name = i18n("context-mixerelement-name-number", "%1 %2").arg(name).arg(idx); + name = i18n("context-mixerelement-name-number", "%1 %2").tqarg(name).tqarg(idx); bool add2all = false; if (snd_mixer_selem_has_capture_switch(elem)) { @@ -1074,13 +1074,13 @@ void AlsaSoundDevice::getCaptureMixerChannels( } } -const QStringList &AlsaSoundDevice::getPlaybackChannels() const +const TQStringList &AlsaSoundDevice::getPlaybackChannels() const { return m_PlaybackChannels; } -const QStringList &AlsaSoundDevice::getCaptureChannels() const +const TQStringList &AlsaSoundDevice::getCaptureChannels() const { return m_CaptureChannelsSwitch; } @@ -1088,7 +1088,7 @@ const QStringList &AlsaSoundDevice::getCaptureChannels() const bool AlsaSoundDevice::setPlaybackVolume(SoundStreamID id, float volume) { - if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id))) { + if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id))) { SoundStreamConfig &cfg = m_PlaybackStreams[id]; if (rint(100*volume) != rint(100*cfg.m_Volume)) { @@ -1120,7 +1120,7 @@ bool AlsaSoundDevice::setCaptureVolume(SoundStreamID id, float volume) bool AlsaSoundDevice::getPlaybackVolume(SoundStreamID id, float &volume) const { - if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id))) { + if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id))) { const SoundStreamConfig &cfg = m_PlaybackStreams[id]; volume = cfg.m_Volume; return true; @@ -1144,7 +1144,7 @@ void AlsaSoundDevice::checkMixerVolume(SoundStreamID id) { if (id.isValid()) { - if (m_hPlaybackMixer && m_PassivePlaybackStreams.contains(id) || m_PlaybackStreamID == id) { + if (m_hPlaybackMixer && m_PassivePlaybackStreams.tqcontains(id) || m_PlaybackStreamID == id) { snd_mixer_handle_events(m_hPlaybackMixer); SoundStreamConfig &cfg = m_PlaybackStreams[id]; @@ -1164,7 +1164,7 @@ void AlsaSoundDevice::checkMixerVolume(SoundStreamID id) snd_mixer_handle_events(m_hCaptureMixer); SoundStreamConfig &cfg = m_CaptureStreams[id]; - if (m_CaptureChannels2ID.contains(cfg.m_Channel)) { + if (m_CaptureChannels2ID.tqcontains(cfg.m_Channel)) { float v = readCaptureMixerVolume(cfg.m_Channel); if (rint(100*cfg.m_Volume) != rint(100*v)) { cfg.m_Volume = v; @@ -1176,12 +1176,12 @@ void AlsaSoundDevice::checkMixerVolume(SoundStreamID id) } -float AlsaSoundDevice::readPlaybackMixerVolume(const QString &channel, bool &muted) const +float AlsaSoundDevice::readPlaybackMixerVolume(const TQString &channel, bool &muted) const { if (!m_hPlaybackMixer) return 0; // without error - if (m_PlaybackChannels2ID.contains(channel) && m_hPlaybackMixer) { + if (m_PlaybackChannels2ID.tqcontains(channel) && m_hPlaybackMixer) { AlsaMixerElement sid = m_PlaybackChannels2ID[channel]; snd_mixer_elem_t *elem = snd_mixer_find_selem(m_hPlaybackMixer, sid); if (elem) { @@ -1204,18 +1204,18 @@ float AlsaSoundDevice::readPlaybackMixerVolume(const QString &channel, bool &mut } logError("AlsaSound::readPlaybackMixerVolume: " + i18n("error while reading volume from hwplug:%1,%2") - .arg(m_PlaybackCard) - .arg(m_PlaybackDevice)); + .tqarg(m_PlaybackCard) + .tqarg(m_PlaybackDevice)); return 0; } -float AlsaSoundDevice::readCaptureMixerVolume(const QString &channel) const +float AlsaSoundDevice::readCaptureMixerVolume(const TQString &channel) const { if (!m_hCaptureMixer) return 0; // without error - if (m_CaptureChannels2ID.contains(channel) && m_hCaptureMixer) { + if (m_CaptureChannels2ID.tqcontains(channel) && m_hCaptureMixer) { AlsaMixerElement sid = m_CaptureChannels2ID[channel]; snd_mixer_elem_t *elem = snd_mixer_find_selem(m_hCaptureMixer, sid); if (elem) { @@ -1234,13 +1234,13 @@ float AlsaSoundDevice::readCaptureMixerVolume(const QString &channel) const } logError("AlsaSound::readCaptureMixerVolume: " + i18n("error while reading volume from hwplug:%1,%2") - .arg(m_CaptureCard) - .arg(m_CaptureDevice)); + .tqarg(m_CaptureCard) + .tqarg(m_CaptureDevice)); return 0; } -bool AlsaSoundDevice::writePlaybackMixerVolume (const QString &channel, float &vol, bool muted) +bool AlsaSoundDevice::writePlaybackMixerVolume (const TQString &channel, float &vol, bool muted) { if (vol > 1.0) vol = 1.0; if (vol < 0) vol = 0.0; @@ -1248,7 +1248,7 @@ bool AlsaSoundDevice::writePlaybackMixerVolume (const QString &channel, float &v if (!m_hPlaybackMixer) return false; - if (m_PlaybackChannels2ID.contains(channel) && m_hPlaybackMixer) { + if (m_PlaybackChannels2ID.tqcontains(channel) && m_hPlaybackMixer) { AlsaMixerElement sid = m_PlaybackChannels2ID[channel]; snd_mixer_elem_t *elem = snd_mixer_find_selem(m_hPlaybackMixer, sid); if (elem) { @@ -1267,16 +1267,16 @@ bool AlsaSoundDevice::writePlaybackMixerVolume (const QString &channel, float &v } logError("AlsaSound::writePlaybackMixerVolume: " + i18n("error while writing volume %1 to hwplug:%2,%3") - .arg(vol) - .arg(m_PlaybackCard) - .arg(m_PlaybackDevice)); + .tqarg(vol) + .tqarg(m_PlaybackCard) + .tqarg(m_PlaybackDevice)); return false; } -bool AlsaSoundDevice::writeCaptureMixerVolume (const QString &channel, float &vol) +bool AlsaSoundDevice::writeCaptureMixerVolume (const TQString &channel, float &vol) { if (vol > 1.0) vol = 1.0; if (vol < 0) vol = 0.0; @@ -1284,7 +1284,7 @@ bool AlsaSoundDevice::writeCaptureMixerVolume (const QString &channel, float &vo if (!m_hCaptureMixer) return false; - if (m_CaptureChannels2ID.contains(channel) && m_hCaptureMixer) { + if (m_CaptureChannels2ID.tqcontains(channel) && m_hCaptureMixer) { AlsaMixerElement sid = m_CaptureChannels2ID[channel]; snd_mixer_elem_t *elem = snd_mixer_find_selem(m_hCaptureMixer, sid); if (elem) { @@ -1302,19 +1302,19 @@ bool AlsaSoundDevice::writeCaptureMixerVolume (const QString &channel, float &vo } logError("AlsaSound::writeCaptureMixerVolume: " + i18n("error while writing volume %1 to hwplug:%2,%3") - .arg(vol) - .arg(m_CaptureCard) - .arg(m_CaptureDevice)); + .tqarg(vol) + .tqarg(m_CaptureCard) + .tqarg(m_CaptureDevice)); return false; } -bool AlsaSoundDevice::writeCaptureMixerSwitch (const QString &channel, bool capture) +bool AlsaSoundDevice::writeCaptureMixerSwitch (const TQString &channel, bool capture) { if (!m_hCaptureMixer) return false; - if (m_CaptureChannelsSwitch2ID.contains(channel) && m_hCaptureMixer) { + if (m_CaptureChannelsSwitch2ID.tqcontains(channel) && m_hCaptureMixer) { AlsaMixerElement sid = m_CaptureChannelsSwitch2ID[channel]; snd_mixer_elem_t *elem = snd_mixer_find_selem(m_hCaptureMixer, sid); if (elem) { @@ -1325,50 +1325,50 @@ bool AlsaSoundDevice::writeCaptureMixerSwitch (const QString &channel, bool capt } logError("AlsaSound::writeCaptureMixerSwitch: " + i18n("error while setting capture switch %1 for hwplug:%2,%3") - .arg(channel) - .arg(m_CaptureCard) - .arg(m_CaptureDevice)); + .tqarg(channel) + .tqarg(m_CaptureCard) + .tqarg(m_CaptureDevice)); return false; } -void AlsaSoundDevice::selectCaptureChannel (const QString &channel) +void AlsaSoundDevice::selectCaptureChannel (const TQString &channel) { writeCaptureMixerSwitch(channel, true); - const QString ADC = "ADC"; - if (m_CaptureChannels2ID.contains(ADC)) { + const TQString ADC = "ADC"; + if (m_CaptureChannels2ID.tqcontains(ADC)) { float v = readCaptureMixerVolume(ADC); if (rint(v*100) == 0) { float tmp_vol = 1.0; writeCaptureMixerVolume(ADC, tmp_vol); } } - const QString Digital = "Digital"; - if (m_CaptureChannels2ID.contains(Digital)) { + const TQString Digital = "Digital"; + if (m_CaptureChannels2ID.tqcontains(Digital)) { float v = readCaptureMixerVolume(Digital); if (rint(v*100) == 0) { float tmp_vol = 1.0; writeCaptureMixerVolume(Digital, tmp_vol); } } - const QString WAVE = "Wave"; - if (m_CaptureChannels2ID.contains(WAVE)) { + const TQString WAVE = "Wave"; + if (m_CaptureChannels2ID.tqcontains(WAVE)) { float x = 0; writeCaptureMixerVolume(WAVE, x); } - const QString Capture = "Capture"; - if (m_CaptureChannelsSwitch2ID.contains(Capture)) { + const TQString Capture = "Capture"; + if (m_CaptureChannelsSwitch2ID.tqcontains(Capture)) { writeCaptureMixerSwitch(Capture, true); } - for (QMapConstIterator<QString, AlsaConfigMixerSetting> it = m_CaptureMixerSettings.begin(); it != m_CaptureMixerSettings.end(); ++it) { + for (TQMapConstIterator<TQString, AlsaConfigMixerSetting> it = m_CaptureMixerSettings.begin(); it != m_CaptureMixerSettings.end(); ++it) { const AlsaConfigMixerSetting &s = *it; if (s.m_card == m_CaptureCard && s.m_use) { float vol = s.m_volume; - if (m_CaptureChannels2ID.contains(s.m_name)) + if (m_CaptureChannels2ID.tqcontains(s.m_name)) writeCaptureMixerVolume(s.m_name, vol); - if (m_CaptureChannelsSwitch2ID.contains(s.m_name)) + if (m_CaptureChannelsSwitch2ID.tqcontains(s.m_name)) writeCaptureMixerSwitch(s.m_name, s.m_active); } } @@ -1423,10 +1423,10 @@ void AlsaSoundDevice::setPlaybackDevice(int card, int dev) void AlsaSoundDevice::setCaptureDevice(int card, int dev) { -// logDebug("AlsaSoundDevice::setCaptureDevice-1: m_CaptureCard == " + QString::number(m_CaptureCard) + ", card == " + QString::number(card)); +// logDebug("AlsaSoundDevice::setCaptureDevice-1: m_CaptureCard == " + TQString::number(m_CaptureCard) + ", card == " + TQString::number(card)); if (m_CaptureCard == card && m_CaptureDevice == dev) return; -// logDebug("AlsaSoundDevice::setCaptureDevice-2: m_CaptureCard == " + QString::number(m_CaptureCard) + ", card == " + QString::number(card)); +// logDebug("AlsaSoundDevice::setCaptureDevice-2: m_CaptureCard == " + TQString::number(m_CaptureCard) + ", card == " + TQString::number(card)); m_CaptureCard = card; m_CaptureDevice = dev; @@ -1443,15 +1443,15 @@ void AlsaSoundDevice::setCaptureDevice(int card, int dev) } -QString AlsaSoundDevice::getSoundStreamClientDescription() const +TQString AlsaSoundDevice::getSoundStreamClientDescription() const { - return i18n("ALSA Sound Device %1").arg(PluginBase::name()); + return i18n("ALSA Sound Device %1").tqarg(PluginBase::name()); } bool AlsaSoundDevice::mute (SoundStreamID id, bool mute) { - if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id))) { + if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id))) { SoundStreamConfig &cfg = m_PlaybackStreams[id]; if (mute != cfg.m_Muted) { if (writePlaybackMixerVolume(cfg.m_Channel, cfg.m_Volume, cfg.m_Muted = mute)) { @@ -1465,7 +1465,7 @@ bool AlsaSoundDevice::mute (SoundStreamID id, bool mute) bool AlsaSoundDevice::unmute (SoundStreamID id, bool unmute) { - if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id))) { + if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id))) { SoundStreamConfig &cfg = m_PlaybackStreams[id]; bool mute = !unmute; if (mute != cfg.m_Muted) { @@ -1480,7 +1480,7 @@ bool AlsaSoundDevice::unmute (SoundStreamID id, bool unmute) bool AlsaSoundDevice::isMuted(SoundStreamID id, bool &m) const { - if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.contains(id))) { + if (id.isValid() && (m_PlaybackStreamID == id || m_PassivePlaybackStreams.tqcontains(id))) { const SoundStreamConfig &cfg = m_PlaybackStreams[id]; m = cfg.m_Muted; return true; @@ -1489,14 +1489,14 @@ bool AlsaSoundDevice::isMuted(SoundStreamID id, bool &m) const } -void AlsaSoundDevice::setCaptureMixerSettings(const QMap<QString, AlsaConfigMixerSetting> &map) +void AlsaSoundDevice::setCaptureMixerSettings(const TQMap<TQString, AlsaConfigMixerSetting> &map) { m_CaptureMixerSettings = map; } -// bool AlsaSoundDevice::event(QEvent *_e) +// bool AlsaSoundDevice::event(TQEvent *_e) // { // bool retval = false; // @@ -1519,10 +1519,10 @@ void AlsaSoundDevice::setCaptureMixerSettings(const QMap<QString, AlsaConfigMixe // case CaptureDebug : // if (m_captureThread) { // AlsaCaptureEvent *e = static_cast<AlsaCaptureEvent*>(_e); -// QString msg = i18n("ALSA Plugin, device plughw:%1,%2: %3") -// .arg(m_CaptureCard) -// .arg(m_CaptureDevice) -// .arg(e->message()); +// TQString msg = i18n("ALSA Plugin, device plughw:%1,%2: %3") +// .tqarg(m_CaptureCard) +// .tqarg(m_CaptureDevice) +// .tqarg(e->message()); // switch (_e->type()) { // case CaptureError : // logError(msg); @@ -1545,7 +1545,7 @@ void AlsaSoundDevice::setCaptureMixerSettings(const QMap<QString, AlsaConfigMixe // break; // // default: -// retval = QObject::event(_e); +// retval = TQObject::event(_e); // break; // } // diff --git a/kradio3/plugins/alsa-sound/alsa-sound.h b/kradio3/plugins/alsa-sound/alsa-sound.h index 93a9fc8..0e4b83a 100644 --- a/kradio3/plugins/alsa-sound/alsa-sound.h +++ b/kradio3/plugins/alsa-sound/alsa-sound.h @@ -28,8 +28,8 @@ #include "alsa-config-mixer-setting.h" -#include <qobject.h> -#include <qtimer.h> +#include <tqobject.h> +#include <tqtimer.h> #include <alsa/asoundlib.h> enum DUPLEX_MODE { DUPLEX_UNKNOWN, DUPLEX_FULL, DUPLEX_HALF }; @@ -39,12 +39,12 @@ struct SoundStreamConfig { SoundStreamConfig() : m_ActiveMode(false), - m_Channel(QString::null), + m_Channel(TQString()), m_Volume(-1), m_Muted(false) {} - SoundStreamConfig(const QString &_channel, bool active_mode = true) + SoundStreamConfig(const TQString &_channel, bool active_mode = true) : m_ActiveMode(active_mode), m_Channel(_channel), m_Volume(-1), @@ -59,7 +59,7 @@ struct SoundStreamConfig {} bool m_ActiveMode; - QString m_Channel; + TQString m_Channel; float m_Volume; bool m_Muted; }; @@ -84,14 +84,15 @@ protected: }; -class AlsaSoundDevice : public QObject, +class AlsaSoundDevice : public TQObject, public PluginBase, public ISoundStreamClient { Q_OBJECT + TQ_OBJECT public: - AlsaSoundDevice (const QString &name); + AlsaSoundDevice (const TQString &name); virtual ~AlsaSoundDevice (); virtual bool connectI(Interface *i); @@ -103,10 +104,10 @@ public: virtual void saveState (KConfig *) const; virtual void restoreState (KConfig *); - virtual QString pluginClassName() const { return "AlsaSoundDevice"; } + virtual TQString pluginClassName() const { return "AlsaSoundDevice"; } - virtual const QString &name() const { return PluginBase::name(); } - virtual QString &name() { return PluginBase::name(); } + virtual const TQString &name() const { return PluginBase::name(); } + virtual TQString &name() { return PluginBase::name(); } virtual ConfigPageInfo createConfigurationPage(); virtual AboutPageInfo createAboutPage(); @@ -115,8 +116,8 @@ public: RECEIVERS: void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid); - bool preparePlayback(SoundStreamID id, const QString &channel, bool active_mode, bool start_immediately); - bool prepareCapture(SoundStreamID id, const QString &channel); + bool preparePlayback(SoundStreamID id, const TQString &channel, bool active_mode, bool start_immediately); + bool prepareCapture(SoundStreamID id, const TQString &channel); bool releasePlayback(SoundStreamID id); bool releaseCapture(SoundStreamID id); @@ -124,23 +125,23 @@ ANSWERS: bool supportsPlayback() const; bool supportsCapture() const; - QString getSoundStreamClientDescription() const; + TQString getSoundStreamClientDescription() const; // ISoundStreamClient: mixer access public: static void getPlaybackMixerChannels(int card, snd_mixer_t *mixer_handle, - QStringList &retval, QMap<QString, AlsaMixerElement> &int2id); + TQStringList &retval, TQMap<TQString, AlsaMixerElement> &int2id); static void getCaptureMixerChannels (int card, snd_mixer_t *mixer_handle, - QStringList &vol_list, QMap<QString, AlsaMixerElement> &vol_ch2id, - QStringList &sw_list, QMap<QString, AlsaMixerElement> &sw_ch2id, - QStringList *all_list = NULL); + TQStringList &vol_list, TQMap<TQString, AlsaMixerElement> &vol_ch2id, + TQStringList &sw_list, TQMap<TQString, AlsaMixerElement> &sw_ch2id, + TQStringList *all_list = NULL); ANSWERS: - const QStringList &getPlaybackChannels() const; - const QStringList &getCaptureChannels() const; + const TQStringList &getPlaybackChannels() const; + const TQStringList &getCaptureChannels() const; RECEIVERS: bool setPlaybackVolume(SoundStreamID id, float volume); @@ -188,7 +189,7 @@ RECEIVERS: int getPlaybackDevice() const { return m_PlaybackDevice; } int getCaptureCard() const { return m_CaptureCard; } int getCaptureDevice() const { return m_CaptureDevice; } - const QMap<QString, AlsaConfigMixerSetting> & + const TQMap<TQString, AlsaConfigMixerSetting> & getCaptureMixerSettings() const { return m_CaptureMixerSettings; } void setHWBufferSize(int s); @@ -197,7 +198,7 @@ RECEIVERS: void enableCapture(bool on); void setPlaybackDevice(int card, int device); void setCaptureDevice(int card, int device); - void setCaptureMixerSettings(const QMap<QString, AlsaConfigMixerSetting> &map); + void setCaptureMixerSettings(const TQMap<TQString, AlsaConfigMixerSetting> &map); protected slots: @@ -209,7 +210,7 @@ signals: void sigUpdateConfig(); protected: -// bool event(QEvent *_e); +// bool event(TQEvent *_e); bool openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &format, const char *pcm_name, snd_pcm_stream_t stream, int flags, unsigned &latency); @@ -220,19 +221,19 @@ protected: bool openPlaybackMixerDevice (bool reopen = false); bool openCaptureMixerDevice (bool reopen = false); - static bool openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, QTimer *timer, int timer_latency); + static bool openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, TQTimer *timer, int timer_latency); bool closeCaptureMixerDevice (bool force = false); bool closePlaybackMixerDevice(bool force = false); - static bool closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, QTimer *timer); + static bool closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, TQTimer *timer); void checkMixerVolume(SoundStreamID id); - float readPlaybackMixerVolume(const QString &channel, bool &muted) const; - float readCaptureMixerVolume(const QString &channel) const; - bool writePlaybackMixerVolume(const QString &channel, float &vol, bool muted); - bool writeCaptureMixerVolume(const QString &channel, float &vol); - bool writeCaptureMixerSwitch(const QString &channel, bool capture); + float readPlaybackMixerVolume(const TQString &channel, bool &muted) const; + float readCaptureMixerVolume(const TQString &channel) const; + bool writePlaybackMixerVolume(const TQString &channel, float &vol, bool muted); + bool writeCaptureMixerVolume(const TQString &channel, float &vol); + bool writeCaptureMixerSwitch(const TQString &channel, bool capture); - void selectCaptureChannel (const QString &channel); + void selectCaptureChannel (const TQString &channel); /* ALSA HANDLES */ snd_pcm_t *m_hPlayback; @@ -250,19 +251,19 @@ protected: unsigned m_PlaybackLatency; unsigned m_CaptureLatency; - QStringList m_PlaybackChannels, + TQStringList m_PlaybackChannels, m_CaptureChannels, m_CaptureChannelsSwitch; - QMap<QString, AlsaMixerElement> m_PlaybackChannels2ID, + TQMap<TQString, AlsaMixerElement> m_PlaybackChannels2ID, m_CaptureChannels2ID, m_CaptureChannelsSwitch2ID; - QMap<SoundStreamID, SoundStreamConfig> + TQMap<SoundStreamID, SoundStreamConfig> m_PlaybackStreams, m_CaptureStreams; - QValueList<SoundStreamID> + TQValueList<SoundStreamID> m_PassivePlaybackStreams; SoundStreamID m_PlaybackStreamID, m_CaptureStreamID; @@ -273,7 +274,7 @@ protected: m_CaptureBuffer; unsigned m_CaptureRequestCounter; - Q_UINT64 m_CapturePos; + TQ_UINT64 m_CapturePos; time_t m_CaptureStartTime; size_t //m_PlaybackSkipCount, @@ -282,12 +283,12 @@ protected: bool m_EnablePlayback, m_EnableCapture; - QTimer m_PlaybackPollingTimer; - QTimer m_CapturePollingTimer; + TQTimer m_PlaybackPollingTimer; + TQTimer m_CapturePollingTimer; // AlsaCaptureThread *m_captureThread; - QMap<QString, AlsaConfigMixerSetting> m_CaptureMixerSettings; + TQMap<TQString, AlsaConfigMixerSetting> m_CaptureMixerSettings; }; |