diff options
Diffstat (limited to 'kradio3/plugins/alsa-sound/alsa-sound.cpp')
-rw-r--r-- | kradio3/plugins/alsa-sound/alsa-sound.cpp | 252 |
1 files changed, 126 insertions, 126 deletions
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; // } // |