summaryrefslogtreecommitdiffstats
path: root/kradio3/plugins/oss-sound
diff options
context:
space:
mode:
Diffstat (limited to 'kradio3/plugins/oss-sound')
-rw-r--r--kradio3/plugins/oss-sound/oss-sound-configuration-ui.ui18
-rw-r--r--kradio3/plugins/oss-sound/oss-sound-configuration.cpp20
-rw-r--r--kradio3/plugins/oss-sound/oss-sound-configuration.h3
-rw-r--r--kradio3/plugins/oss-sound/oss-sound.cpp148
-rw-r--r--kradio3/plugins/oss-sound/oss-sound.h49
5 files changed, 120 insertions, 118 deletions
diff --git a/kradio3/plugins/oss-sound/oss-sound-configuration-ui.ui b/kradio3/plugins/oss-sound/oss-sound-configuration-ui.ui
index 7cf3483..12f3051 100644
--- a/kradio3/plugins/oss-sound/oss-sound-configuration-ui.ui
+++ b/kradio3/plugins/oss-sound/oss-sound-configuration-ui.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>OSSSoundConfigurationUI</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>OSSSoundConfigurationUI</cstring>
</property>
@@ -19,7 +19,7 @@
<property name="margin">
<number>0</number>
</property>
- <widget class="QGroupBox" row="0" column="0">
+ <widget class="TQGroupBox" row="0" column="0">
<property name="name">
<cstring>groupBox20</cstring>
</property>
@@ -43,7 +43,7 @@
<cstring>editDSPDevice</cstring>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@@ -51,7 +51,7 @@
<string>PCM Device</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel2_2</cstring>
</property>
@@ -59,7 +59,7 @@
<string>Mixer Device</string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>textLabel2_2_2</cstring>
</property>
@@ -83,7 +83,7 @@
</widget>
</grid>
</widget>
- <widget class="QGroupBox" row="1" column="0">
+ <widget class="TQGroupBox" row="1" column="0">
<property name="name">
<cstring>groupBox21</cstring>
</property>
@@ -97,7 +97,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>
@@ -105,7 +105,7 @@
<string>Disable Playback</string>
</property>
</widget>
- <widget class="QCheckBox" row="1" column="0">
+ <widget class="TQCheckBox" row="1" column="0">
<property name="name">
<cstring>chkDisableCapture</cstring>
</property>
@@ -119,7 +119,7 @@
</widget>
<customwidgets>
</customwidgets>
-<layoutdefaults spacing="6" margin="0"/>
+<tqlayoutdefaults spacing="6" margin="0"/>
<includehints>
<includehint>kurlrequester.h</includehint>
<includehint>klineedit.h</includehint>
diff --git a/kradio3/plugins/oss-sound/oss-sound-configuration.cpp b/kradio3/plugins/oss-sound/oss-sound-configuration.cpp
index 5665114..1aca790 100644
--- a/kradio3/plugins/oss-sound/oss-sound-configuration.cpp
+++ b/kradio3/plugins/oss-sound/oss-sound-configuration.cpp
@@ -15,7 +15,7 @@
* *
***************************************************************************/
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include <kurlrequester.h>
#include <knuminput.h>
@@ -23,17 +23,17 @@
#include "oss-sound-configuration.h"
#include "oss-sound.h"
-OSSSoundConfiguration::OSSSoundConfiguration (QWidget *parent, OSSSoundDevice *dev)
- : OSSSoundConfigurationUI(parent),
+OSSSoundConfiguration::OSSSoundConfiguration (TQWidget *tqparent, OSSSoundDevice *dev)
+ : OSSSoundConfigurationUI(tqparent),
m_SoundDevice (dev),
m_dirty(true),
m_ignore_gui_updates(false)
{
- connect(editDSPDevice, SIGNAL(textChanged(const QString &)), this, SLOT(slotSetDirty()));
- connect(editMixerDevice, SIGNAL(textChanged(const QString &)), this, SLOT(slotSetDirty()));
- connect(editBufferSize, SIGNAL(valueChanged(int)), this, SLOT(slotSetDirty()));
- connect(chkDisablePlayback, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty()));
- connect(chkDisableCapture, SIGNAL(toggled(bool)), this, SLOT(slotSetDirty()));
+ connect(editDSPDevice, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotSetDirty()));
+ connect(editMixerDevice, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotSetDirty()));
+ connect(editBufferSize, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSetDirty()));
+ connect(chkDisablePlayback, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
+ connect(chkDisableCapture, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetDirty()));
slotCancel();
}
@@ -60,8 +60,8 @@ void OSSSoundConfiguration::slotCancel()
{
if (m_dirty) {
m_ignore_gui_updates = true;
- editDSPDevice ->setURL (m_SoundDevice ? m_SoundDevice->getDSPDeviceName() : QString::null);
- editMixerDevice ->setURL (m_SoundDevice ? m_SoundDevice->getMixerDeviceName() : QString::null);
+ editDSPDevice ->setURL (m_SoundDevice ? m_SoundDevice->getDSPDeviceName() : TQString());
+ editMixerDevice ->setURL (m_SoundDevice ? m_SoundDevice->getMixerDeviceName() : TQString());
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);
diff --git a/kradio3/plugins/oss-sound/oss-sound-configuration.h b/kradio3/plugins/oss-sound/oss-sound-configuration.h
index 9106821..fdbcd26 100644
--- a/kradio3/plugins/oss-sound/oss-sound-configuration.h
+++ b/kradio3/plugins/oss-sound/oss-sound-configuration.h
@@ -28,8 +28,9 @@
class OSSSoundConfiguration : public OSSSoundConfigurationUI
{
Q_OBJECT
+ TQ_OBJECT
public :
- OSSSoundConfiguration (QWidget *parent, OSSSoundDevice *);
+ OSSSoundConfiguration (TQWidget *tqparent, OSSSoundDevice *);
~OSSSoundConfiguration ();
protected slots:
diff --git a/kradio3/plugins/oss-sound/oss-sound.cpp b/kradio3/plugins/oss-sound/oss-sound.cpp
index 760399e..e640191 100644
--- a/kradio3/plugins/oss-sound/oss-sound.cpp
+++ b/kradio3/plugins/oss-sound/oss-sound.cpp
@@ -41,8 +41,8 @@ PLUGIN_LIBRARY_FUNCTIONS(OSSSoundDevice, "kradio-oss-sound", i18n("Open Sound Sy
struct _lrvol { unsigned char l, r; short dummy; };
-OSSSoundDevice::OSSSoundDevice(const QString &name)
- : QObject(NULL, NULL),
+OSSSoundDevice::OSSSoundDevice(const TQString &name)
+ : TQObject(NULL, NULL),
PluginBase(name, i18n("KRadio OSS Sound Plugin")),
m_DSPDeviceName(""),
m_MixerDeviceName(""),
@@ -64,7 +64,7 @@ OSSSoundDevice::OSSSoundDevice(const QString &name)
m_EnablePlayback(true),
m_EnableCapture(true)
{
- QObject::connect(&m_PollingTimer, SIGNAL(timeout()), this, SLOT(slotPoll()));
+ TQObject::connect(&m_PollingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotPoll()));
}
@@ -119,7 +119,7 @@ void OSSSoundDevice::noticeConnectedI (ISoundStreamServer *s, bool pointer_valid
void OSSSoundDevice::saveState (KConfig *c) const
{
- c->setGroup(QString("oss-sound-") + PluginBase::name());
+ c->setGroup(TQString("oss-sound-") + PluginBase::name());
c->writeEntry("dsp-device", m_DSPDeviceName);
c->writeEntry("mixer-device", m_MixerDeviceName);
@@ -132,7 +132,7 @@ void OSSSoundDevice::saveState (KConfig *c) const
void OSSSoundDevice::restoreState (KConfig *c)
{
- c->setGroup(QString("oss-sound-") + PluginBase::name());
+ c->setGroup(TQString("oss-sound-") + PluginBase::name());
m_EnablePlayback = c->readBoolEntry("enable-playback", true);
m_EnableCapture = c->readBoolEntry("enable-capture", true);
@@ -150,7 +150,7 @@ void OSSSoundDevice::restoreState (KConfig *c)
}
-void OSSSoundDevice::setMixerDeviceName(const QString &dev_name)
+void OSSSoundDevice::setMixerDeviceName(const TQString &dev_name)
{
if (m_MixerDeviceName != dev_name) {
m_MixerDeviceName = dev_name;
@@ -167,7 +167,7 @@ void OSSSoundDevice::setMixerDeviceName(const QString &dev_name)
ConfigPageInfo OSSSoundDevice::createConfigurationPage()
{
OSSSoundConfiguration *conf = new OSSSoundConfiguration(NULL, this);
- QObject::connect(this, SIGNAL(sigUpdateConfig()), conf, SLOT(slotUpdateConfig()));
+ TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig()));
return ConfigPageInfo (conf,
i18n("OSS Sound"),
i18n("OSS Sound Device Options"),
@@ -200,9 +200,9 @@ AboutPageInfo OSSSoundDevice::createAboutPage()
-bool OSSSoundDevice::preparePlayback(SoundStreamID id, const QString &channel, bool active_mode, bool start_immediately)
+bool OSSSoundDevice::preparePlayback(SoundStreamID id, const TQString &channel, bool active_mode, bool start_immediately)
{
- if (id.isValid() && m_revPlaybackChannels.contains(channel)) {
+ if (id.isValid() && m_revPlaybackChannels.tqcontains(channel)) {
m_PlaybackStreams.insert(id, SoundStreamConfig(m_revPlaybackChannels[channel], active_mode));
if (start_immediately)
startPlayback(id);
@@ -213,9 +213,9 @@ bool OSSSoundDevice::preparePlayback(SoundStreamID id, const QString &channel, b
}
-bool OSSSoundDevice::prepareCapture(SoundStreamID id, const QString &channel)
+bool OSSSoundDevice::prepareCapture(SoundStreamID id, const TQString &channel)
{
- if (id.isValid() && m_revCaptureChannels.contains(channel)) {
+ if (id.isValid() && m_revCaptureChannels.tqcontains(channel)) {
m_CaptureStreams.insert(id, SoundStreamConfig(m_revCaptureChannels[channel]));
return true;
// FIXME: what to do if stream is already playing?
@@ -225,8 +225,8 @@ bool OSSSoundDevice::prepareCapture(SoundStreamID id, const QString &channel)
bool OSSSoundDevice::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);
@@ -237,7 +237,7 @@ bool OSSSoundDevice::releasePlayback(SoundStreamID id)
bool OSSSoundDevice::releaseCapture(SoundStreamID id)
{
- if (id.isValid() && m_CaptureStreams.contains(id)) {
+ if (id.isValid() && m_CaptureStreams.tqcontains(id)) {
if (m_CaptureStreamID == id) {
stopCapture(id);
}
@@ -261,7 +261,7 @@ bool OSSSoundDevice::supportsCapture() const
bool OSSSoundDevice::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];
@@ -272,7 +272,7 @@ bool OSSSoundDevice::startPlayback(SoundStreamID id)
ok = true;
}
} else {
- if (!m_PassivePlaybackStreams.contains(id))
+ if (!m_PassivePlaybackStreams.tqcontains(id))
m_PassivePlaybackStreams.append(id);
ok = true;
}
@@ -300,12 +300,12 @@ bool OSSSoundDevice::pausePlayback(SoundStreamID /*id*/)
bool OSSSoundDevice::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)) {
// writeMixerVolume(cfg.m_Channel, 0);
m_PassivePlaybackStreams.remove(id);
}
@@ -324,7 +324,7 @@ bool OSSSoundDevice::stopPlayback(SoundStreamID id)
bool OSSSoundDevice::isPlaybackRunning(SoundStreamID id, bool &b) const
{
- if (id.isValid() && m_PlaybackStreams.contains(id)) {
+ if (id.isValid() && m_PlaybackStreams.tqcontains(id)) {
b = true;
return true;
} else {
@@ -337,7 +337,7 @@ bool OSSSoundDevice::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;
@@ -402,7 +402,7 @@ bool OSSSoundDevice::isCaptureRunning(SoundStreamID id, bool &b, SoundFormat &sf
bool OSSSoundDevice::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;
}
@@ -419,13 +419,13 @@ bool OSSSoundDevice::noticeSoundStreamClosed(SoundStreamID id)
bool OSSSoundDevice::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);
@@ -436,7 +436,7 @@ bool OSSSoundDevice::noticeSoundStreamRedirected(SoundStreamID oldID, SoundStrea
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);
}
@@ -478,7 +478,7 @@ bool OSSSoundDevice::noticeSoundStreamData(SoundStreamID id,
// if (n < size) {
// m_PlaybackSkipCount += size - n;
// } else if (m_PlaybackSkipCount > 0) {
-// logWarning(i18n("%1: Playback buffer overflow. Skipped %1 bytes").arg(m_DSPDeviceName).arg(QString::number(m_PlaybackSkipCount)));
+// logWarning(i18n("%1: Playback buffer overflow. Skipped %1 bytes").tqarg(m_DSPDeviceName).tqarg(TQString::number(m_PlaybackSkipCount)));
// m_PlaybackSkipCount = 0;
// }
@@ -504,7 +504,7 @@ void OSSSoundDevice::slotPoll()
bytesRead = 0;
} else if (bytesRead == 0) {
err = -1;
- logError(i18n("OSS device %1: No data to record").arg(m_DSPDeviceName));
+ logError(i18n("OSS device %1: No data to record").tqarg(m_DSPDeviceName));
} else {
err = errno;
}
@@ -514,7 +514,7 @@ void OSSSoundDevice::slotPoll()
buffer = m_CaptureBuffer.getData(size);
time_t cur_time = time(NULL);
size_t consumed_size = SIZE_T_DONT_CARE;
- notifySoundStreamData(m_CaptureStreamID, m_DSPFormat, buffer, size, consumed_size, SoundMetaData(m_CapturePos, cur_time - m_CaptureStartTime, cur_time, i18n("internal stream, not stored (%1)").arg(m_DSPDeviceName)));
+ notifySoundStreamData(m_CaptureStreamID, m_DSPFormat, buffer, size, consumed_size, SoundMetaData(m_CapturePos, cur_time - m_CaptureStartTime, cur_time, i18n("internal stream, not stored (%1)").tqarg(m_DSPDeviceName)));
if (consumed_size == SIZE_T_DONT_CARE)
consumed_size = size;
m_CaptureBuffer.removeData(consumed_size);
@@ -546,7 +546,7 @@ void OSSSoundDevice::slotPoll()
}
if (err) {
- logError(i18n("Error %1 while handling OSS device %2").arg(QString().setNum(err)).arg(m_DSPDeviceName));
+ logError(i18n("Error %1 while handling OSS device %2").tqarg(TQString().setNum(err)).tqarg(m_DSPDeviceName));
}
if (m_PlaybackStreamID.isValid())
@@ -554,8 +554,8 @@ void OSSSoundDevice::slotPoll()
if (m_CaptureStreamID.isValid())
checkMixerVolume(m_CaptureStreamID);
- 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);
}
@@ -590,13 +590,13 @@ bool OSSSoundDevice::openDSPDevice(const SoundFormat &format, bool reopen)
m_DSP_fd = open(m_DSPDeviceName.ascii(), O_NONBLOCK | O_RDONLY);
bool err = m_DSP_fd < 0;
if (err) {
- logError(i18n("Cannot open DSP device %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot open DSP device %1").tqarg(m_DSPDeviceName));
return false;
}
int caps = 0;
err |= (ioctl (m_DSP_fd, SNDCTL_DSP_GETCAPS, &caps) != 0);
if (err)
- logError(i18n("Cannot read DSP capabilities for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot read DSP capabilities for %1").tqarg(m_DSPDeviceName));
m_DuplexMode = (caps & DSP_CAP_DUPLEX) ? DUPLEX_FULL : DUPLEX_HALF;
close (m_DSP_fd);
@@ -616,60 +616,60 @@ bool OSSSoundDevice::openDSPDevice(const SoundFormat &format, bool reopen)
err = m_DSP_fd < 0;
if (err) {
- logError(i18n("Cannot open DSP device %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot open DSP device %1").tqarg(m_DSPDeviceName));
return false;
}
int oss_format = getOSSFormat(m_DSPFormat);
err |= (ioctl(m_DSP_fd, SNDCTL_DSP_SETFMT, &oss_format) != 0);
if (err)
- logError(i18n("Cannot set DSP sample format for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set DSP sample format for %1").tqarg(m_DSPDeviceName));
int channels = m_DSPFormat.m_Channels;
err |= (ioctl(m_DSP_fd, SNDCTL_DSP_CHANNELS, &channels) != 0);
if (err)
- logError(i18n("Cannot set number of channels for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set number of channels for %1").tqarg(m_DSPDeviceName));
int rate = m_DSPFormat.m_SampleRate;
err |= (ioctl(m_DSP_fd, SNDCTL_DSP_SPEED, &rate) != 0);
if (err)
- logError(i18n("Cannot set sampling rate for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set sampling rate for %1").tqarg(m_DSPDeviceName));
if (rate != (int)m_DSPFormat.m_SampleRate) {
logWarning(i18n("Asking for %1 Hz but %2 uses %3 Hz").
- arg(QString::number(m_DSPFormat.m_SampleRate)).
+ arg(TQString::number(m_DSPFormat.m_SampleRate)).
arg(m_DSPDeviceName).
- arg(QString::number(rate)));
+ arg(TQString::number(rate)));
m_DSPFormat.m_SampleRate = rate;
}
int stereo = m_DSPFormat.m_Channels == 2;
err |= (ioctl(m_DSP_fd, SNDCTL_DSP_STEREO, &stereo) != 0);
if (err)
- logError(i18n("Cannot set stereo mode for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set stereo mode for %1").tqarg(m_DSPDeviceName));
unsigned sampleSize = m_DSPFormat.m_SampleBits;
err |= (ioctl(m_DSP_fd, SNDCTL_DSP_SAMPLESIZE, &sampleSize) != 0);
if (err || sampleSize != m_DSPFormat.m_SampleBits)
- logError(i18n("Cannot set sample size for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set sample size for %1").tqarg(m_DSPDeviceName));
// setup buffer, ask for 40ms latency
int tmp = (400 * m_DSPFormat.frameSize() * m_DSPFormat.m_SampleRate) / 1000;
- int mask = -1; for (; tmp; tmp >>= 1) ++mask;
- if (mask < 8) mask = 12; // default 4kB
- mask |= 0x7FFF0000;
- err |= ioctl (m_DSP_fd, SNDCTL_DSP_SETFRAGMENT, &mask);
+ int tqmask = -1; for (; tmp; tmp >>= 1) ++tqmask;
+ if (tqmask < 8) tqmask = 12; // default 4kB
+ tqmask |= 0x7FFF0000;
+ err |= ioctl (m_DSP_fd, SNDCTL_DSP_SETFRAGMENT, &tqmask);
if (err)
- logError(i18n("Cannot set buffers for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot set buffers for %1").tqarg(m_DSPDeviceName));
int bufferBlockSize = 0;
err |= ioctl (m_DSP_fd, SNDCTL_DSP_GETBLKSIZE, &bufferBlockSize);
if (err) {
- logError(i18n("Cannot read buffer size for %1").arg(m_DSPDeviceName));
+ logError(i18n("Cannot read buffer size for %1").tqarg(m_DSPDeviceName));
} else {
- logInfo(i18n("%1 uses buffer blocks of %2 bytes").arg(m_DSPDeviceName).arg(QString::number(bufferBlockSize)));
+ logInfo(i18n("%1 uses buffer blocks of %2 bytes").tqarg(m_DSPDeviceName).tqarg(TQString::number(bufferBlockSize)));
size_t tmp = (((m_BufferSize - 1) / bufferBlockSize) + 1) * bufferBlockSize;
setBufferSize(tmp);
- logInfo(i18n("adjusted own buffer size to %1 bytes").arg(QString::number(tmp)));
+ logInfo(i18n("adjusted own buffer size to %1 bytes").tqarg(TQString::number(tmp)));
}
int trigger = ~PCM_ENABLE_INPUT & ~PCM_ENABLE_OUTPUT;
@@ -721,7 +721,7 @@ bool OSSSoundDevice::openMixerDevice(bool reopen)
m_Mixer_fd = open(m_MixerDeviceName.ascii(), O_RDONLY);
if (m_Mixer_fd < 0) {
- logError(i18n("Cannot open mixer device %1").arg(m_MixerDeviceName));
+ logError(i18n("Cannot open mixer device %1").tqarg(m_MixerDeviceName));
} else {
m_PollingTimer.start(40);
}
@@ -744,7 +744,7 @@ bool OSSSoundDevice::closeMixerDevice(bool force)
}
-void OSSSoundDevice::getMixerChannels(int query, QStringList &retval, QMap<QString, int> &revmap) const
+void OSSSoundDevice::getMixerChannels(int query, TQStringList &retval, TQMap<TQString, int> &revmap) const
{
retval.clear();
revmap.clear();
@@ -754,21 +754,21 @@ void OSSSoundDevice::getMixerChannels(int query, QStringList &retval, QMap<QStri
fd = open(m_MixerDeviceName.ascii(), O_RDONLY);
if (fd < 0) {
- logError(i18n("OSSSoundDevice::getMixerChannels: Cannot open mixer device %1").arg(m_MixerDeviceName));
+ logError(i18n("OSSSoundDevice::getMixerChannels: Cannot open mixer device %1").tqarg(m_MixerDeviceName));
}
if (fd >= 0) {
- int mask = 0;
- if ( ioctl(fd, MIXER_READ(query), &mask) == 0 ) {
+ int tqmask = 0;
+ if ( ioctl(fd, MIXER_READ(query), &tqmask) == 0 ) {
for (int i = 0; i < SOUND_MIXER_NRDEVICES; ++i) {
- if (mask & (1 << i)) {
+ if (tqmask & (1 << i)) {
static const char *labels[] = SOUND_DEVICE_LABELS;
retval.append(i18n(labels[i]));
revmap.insert(i18n(labels[i]), i);
}
}
} else {
- logError(i18n("OSSSoundDevice::getMixerChannels: Cannot read mixer device mask on device %1").arg(m_MixerDeviceName));
+ logError(i18n("OSSSoundDevice::getMixerChannels: Cannot read mixer device tqmask on device %1").tqarg(m_MixerDeviceName));
}
}
if (fd != m_Mixer_fd)
@@ -776,13 +776,13 @@ void OSSSoundDevice::getMixerChannels(int query, QStringList &retval, QMap<QStri
}
-const QStringList &OSSSoundDevice::getPlaybackChannels() const
+const TQStringList &OSSSoundDevice::getPlaybackChannels() const
{
return m_PlaybackChannels;
}
-const QStringList &OSSSoundDevice::getCaptureChannels() const
+const TQStringList &OSSSoundDevice::getCaptureChannels() const
{
return m_CaptureChannels;
}
@@ -790,7 +790,7 @@ const QStringList &OSSSoundDevice::getCaptureChannels() const
bool OSSSoundDevice::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)) {
@@ -820,7 +820,7 @@ bool OSSSoundDevice::setCaptureVolume(SoundStreamID id, float volume)
bool OSSSoundDevice::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;
@@ -844,7 +844,7 @@ void OSSSoundDevice::checkMixerVolume(SoundStreamID id)
{
if (m_Mixer_fd >= 0 && id.isValid()) {
- if (m_PassivePlaybackStreams.contains(id) || m_PlaybackStreamID == id) {
+ if (m_PassivePlaybackStreams.tqcontains(id) || m_PlaybackStreamID == id) {
SoundStreamConfig &cfg = m_PlaybackStreams[id];
float v = readMixerVolume(cfg.m_Channel);
@@ -874,8 +874,8 @@ float OSSSoundDevice::readMixerVolume(int channel) const
if (err) {
logError("OSSSound::readMixerVolume: " +
i18n("error %1 while reading volume from %2")
- .arg(QString().setNum(err))
- .arg(m_MixerDeviceName));
+ .tqarg(TQString().setNum(err))
+ .tqarg(m_MixerDeviceName));
tmpvol.l = tmpvol.r = 0;
}
return float(tmpvol.l) / 100.0;
@@ -897,9 +897,9 @@ float OSSSoundDevice::writeMixerVolume (int channel, float vol)
if (err != 0) {
logError("OSSSoundDevice::writeMixerVolume: " +
i18n("error %1 while setting volume to %2 on device %3")
- .arg(QString().setNum(err))
- .arg(QString().setNum(vol))
- .arg(m_MixerDeviceName));
+ .tqarg(TQString().setNum(err))
+ .tqarg(TQString().setNum(vol))
+ .tqarg(m_MixerDeviceName));
return -1;
}
}
@@ -913,21 +913,21 @@ void OSSSoundDevice::selectCaptureChannel (int channel)
int err = ioctl(m_Mixer_fd, SOUND_MIXER_WRITE_RECSRC, &x);
if (err)
logError(i18n("Selecting recording source on device %1 failed with error code %2")
- .arg(m_MixerDeviceName)
- .arg(QString::number(err)));
+ .tqarg(m_MixerDeviceName)
+ .tqarg(TQString::number(err)));
_lrvol tmpvol;
err = ioctl(m_Mixer_fd, MIXER_READ(SOUND_MIXER_IGAIN), &tmpvol);
if (err)
logError(i18n("Reading igain volume on device %1 failed with error code %2")
- .arg(m_MixerDeviceName)
- .arg(QString::number(err)));
+ .tqarg(m_MixerDeviceName)
+ .tqarg(TQString::number(err)));
if (tmpvol.r == 0 && tmpvol.l == 0) {
tmpvol.r = tmpvol.l = 1;
err = ioctl(m_Mixer_fd, MIXER_WRITE(SOUND_MIXER_IGAIN), &tmpvol);
if (err)
logError(i18n("Setting igain volume on device %1 failed with error code %2")
- .arg(m_MixerDeviceName)
- .arg(QString::number(err)));
+ .tqarg(m_MixerDeviceName)
+ .tqarg(TQString::number(err)));
}
}
@@ -972,7 +972,7 @@ void OSSSoundDevice::enableCapture(bool on)
}
-void OSSSoundDevice::setDSPDeviceName(const QString &s)
+void OSSSoundDevice::setDSPDeviceName(const TQString &s)
{
m_DSPDeviceName = s;
SoundFormat f = m_DSPFormat;
@@ -981,9 +981,9 @@ void OSSSoundDevice::setDSPDeviceName(const QString &s)
}
-QString OSSSoundDevice::getSoundStreamClientDescription() const
+TQString OSSSoundDevice::getSoundStreamClientDescription() const
{
- return i18n("OSS Sound Device %1").arg(PluginBase::name());
+ return i18n("OSS Sound Device %1").tqarg(PluginBase::name());
}
diff --git a/kradio3/plugins/oss-sound/oss-sound.h b/kradio3/plugins/oss-sound/oss-sound.h
index 139ee64..c8dadfd 100644
--- a/kradio3/plugins/oss-sound/oss-sound.h
+++ b/kradio3/plugins/oss-sound/oss-sound.h
@@ -26,8 +26,8 @@
#include "../../src/include/plugins.h"
#include "../../src/include/soundstreamclient_interfaces.h"
-#include <qobject.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqtimer.h>
enum DUPLEX_MODE { DUPLEX_UNKNOWN, DUPLEX_FULL, DUPLEX_HALF };
@@ -58,14 +58,15 @@ struct SoundStreamConfig
};
-class OSSSoundDevice : public QObject,
+class OSSSoundDevice : public TQObject,
public PluginBase,
public ISoundStreamClient
{
Q_OBJECT
+ TQ_OBJECT
public:
- OSSSoundDevice (const QString &name);
+ OSSSoundDevice (const TQString &name);
virtual ~OSSSoundDevice ();
virtual bool connectI(Interface *i);
@@ -77,10 +78,10 @@ public:
virtual void saveState (KConfig *) const;
virtual void restoreState (KConfig *);
- virtual QString pluginClassName() const { return "OSSSoundDevice"; }
+ virtual TQString pluginClassName() const { return "OSSSoundDevice"; }
- 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();
@@ -89,8 +90,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);
@@ -98,16 +99,16 @@ ANSWERS:
bool supportsPlayback() const;
bool supportsCapture() const;
- QString getSoundStreamClientDescription() const;
+ TQString getSoundStreamClientDescription() const;
// ISoundStreamClient: mixer access
protected:
- void getMixerChannels(int query_playback_or_rec_mask, QStringList &retval, QMap<QString, int> &revmap) const;
+ void getMixerChannels(int query_playback_or_rec_tqmask, TQStringList &retval, TQMap<TQString, int> &revmap) const;
ANSWERS:
- const QStringList &getPlaybackChannels() const;
- const QStringList &getCaptureChannels() const;
+ const TQStringList &getPlaybackChannels() const;
+ const TQStringList &getCaptureChannels() const;
RECEIVERS:
bool setPlaybackVolume(SoundStreamID id, float volume);
@@ -145,14 +146,14 @@ RECEIVERS:
int getBufferSize() const { return m_BufferSize; }
bool isPlaybackEnabled() const { return m_EnablePlayback; }
bool isCaptureEnabled() const { return m_EnableCapture; }
- const QString &getDSPDeviceName() const { return m_DSPDeviceName; }
- const QString &getMixerDeviceName() const { return m_MixerDeviceName; }
+ const TQString &getDSPDeviceName() const { return m_DSPDeviceName; }
+ const TQString &getMixerDeviceName() const { return m_MixerDeviceName; }
void setBufferSize(int s);
void enablePlayback(bool on);
void enableCapture(bool on);
- void setDSPDeviceName(const QString &s);
- void setMixerDeviceName(const QString &dev_name);
+ void setDSPDeviceName(const TQString &s);
+ void setMixerDeviceName(const TQString &dev_name);
// own functions
@@ -180,23 +181,23 @@ protected:
void selectCaptureChannel (int channel);
- QString m_DSPDeviceName,
+ TQString m_DSPDeviceName,
m_MixerDeviceName;
int m_DSP_fd,
m_Mixer_fd;
DUPLEX_MODE m_DuplexMode;
SoundFormat m_DSPFormat;
- QStringList m_PlaybackChannels,
+ TQStringList m_PlaybackChannels,
m_CaptureChannels;
- QMap<QString, int> m_revPlaybackChannels,
+ TQMap<TQString, int> m_revPlaybackChannels,
m_revCaptureChannels;
- QMap<SoundStreamID, SoundStreamConfig>
+ TQMap<SoundStreamID, SoundStreamConfig>
m_PlaybackStreams,
m_CaptureStreams;
- QValueList<SoundStreamID>
+ TQValueList<SoundStreamID>
m_PassivePlaybackStreams;
SoundStreamID m_PlaybackStreamID,
m_CaptureStreamID;
@@ -206,7 +207,7 @@ protected:
m_CaptureBuffer;
unsigned m_CaptureRequestCounter;
- Q_UINT64 m_CapturePos;
+ TQ_UINT64 m_CapturePos;
time_t m_CaptureStartTime;
@@ -216,7 +217,7 @@ protected:
bool m_EnablePlayback,
m_EnableCapture;
- QTimer m_PollingTimer;
+ TQTimer m_PollingTimer;
};