diff options
Diffstat (limited to 'kradio3/plugins/streaming/streaming.cpp')
-rw-r--r-- | kradio3/plugins/streaming/streaming.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/kradio3/plugins/streaming/streaming.cpp b/kradio3/plugins/streaming/streaming.cpp index 5f5431c..6b2d371 100644 --- a/kradio3/plugins/streaming/streaming.cpp +++ b/kradio3/plugins/streaming/streaming.cpp @@ -37,8 +37,8 @@ PLUGIN_LIBRARY_FUNCTIONS(StreamingDevice, "kradio-streaming", i18n("Streaming Su -StreamingDevice::StreamingDevice(const QString &name) - : QObject(NULL, NULL), +StreamingDevice::StreamingDevice(const TQString &name) + : TQObject(NULL, NULL), PluginBase(name, i18n("KRadio Streaming Plugin")) { m_CaptureChannels.setAutoDelete(true); @@ -92,41 +92,41 @@ void StreamingDevice::noticeConnectedI (ISoundStreamServer *s, bool pointer_vali void StreamingDevice::saveState (KConfig *c) const { - c->setGroup(QString("streaming-") + PluginBase::name()); + c->setGroup(TQString("streaming-") + PluginBase::name()); c->writeEntry("soundstreamclient-id", m_SoundStreamClientID); c->writeEntry("playback-channels", m_PlaybackChannelList.size()); for (unsigned int i = 0; i < m_PlaybackChannelList.size(); ++i) { - QString s = m_PlaybackChannelList[i]; + TQString s = m_PlaybackChannelList[i]; const StreamingJob *j = m_PlaybackChannels[s]; const SoundFormat &sf = j->getSoundFormat(); KURL url = j->getURL(); size_t buffer_size = j->getBufferSize(); - sf.saveConfig("playback-channel-" + QString::number(i), c); - c->writeEntry("playback-channel-" + QString::number(i) + "-url", url.url()); - c->writeEntry("playback-channel-" + QString::number(i) + "-buffer-size", buffer_size); + sf.saveConfig("playback-channel-" + TQString::number(i), c); + c->writeEntry("playback-channel-" + TQString::number(i) + "-url", url.url()); + c->writeEntry("playback-channel-" + TQString::number(i) + "-buffer-size", buffer_size); } c->writeEntry("capture-channels", m_CaptureChannelList.size()); for (unsigned int i = 0; i < m_CaptureChannelList.size(); ++i) { - QString s = m_CaptureChannelList[i]; + TQString s = m_CaptureChannelList[i]; const StreamingJob *j = m_CaptureChannels[s]; const SoundFormat &sf = j->getSoundFormat(); KURL url = j->getURL(); size_t buffer_size = j->getBufferSize(); - sf.saveConfig("capture-channel-" + QString::number(i), c); - c->writeEntry("capture-channel-" + QString::number(i) + "-url", url.url()); - c->writeEntry("capture-channel-" + QString::number(i) + "-buffer-size", buffer_size); + sf.saveConfig("capture-channel-" + TQString::number(i), c); + c->writeEntry("capture-channel-" + TQString::number(i) + "-url", url.url()); + c->writeEntry("capture-channel-" + TQString::number(i) + "-buffer-size", buffer_size); } } void StreamingDevice::restoreState (KConfig *c) { - c->setGroup(QString("streaming-") + PluginBase::name()); + c->setGroup(TQString("streaming-") + PluginBase::name()); setSoundStreamClientID(c->readEntry("soundstreamclient-id", getSoundStreamClientID())); resetPlaybackStreams(false); @@ -135,9 +135,9 @@ void StreamingDevice::restoreState (KConfig *c) int n = c->readNumEntry("playback-channels", 0); for (int i = 0; i < n; ++i) { SoundFormat sf; - sf.restoreConfig("playback-channel-" + QString::number(i), c); - QString url = c->readEntry("playback-channel-" + QString::number(i) + "-url", QString::null); - size_t buffer_size = c->readNum64Entry("playback-channel-" + QString::number(i) + "-buffer-size", 32*1024); + sf.restoreConfig("playback-channel-" + TQString::number(i), c); + TQString url = c->readEntry("playback-channel-" + TQString::number(i) + "-url", TQString()); + size_t buffer_size = c->readNum64Entry("playback-channel-" + TQString::number(i) + "-buffer-size", 32*1024); if (!url.isNull()) { addPlaybackStream(url, sf, buffer_size, i == n-1); @@ -147,9 +147,9 @@ void StreamingDevice::restoreState (KConfig *c) n = c->readNumEntry("capture-channels", 0); for (int i = 0; i < n; ++i) { SoundFormat sf; - sf.restoreConfig("capture-channel-" + QString::number(i), c); - QString url = c->readEntry("capture-channel-" + QString::number(i) + "-url", QString::null); - size_t buffer_size = c->readNum64Entry("capture-channel-" + QString::number(i) + "-buffer-size", 32*1024); + sf.restoreConfig("capture-channel-" + TQString::number(i), c); + TQString url = c->readEntry("capture-channel-" + TQString::number(i) + "-url", TQString()); + size_t buffer_size = c->readNum64Entry("capture-channel-" + TQString::number(i) + "-buffer-size", 32*1024); if (!url.isNull()) { addCaptureStream(url, sf, buffer_size, i == n-1); @@ -167,7 +167,7 @@ void StreamingDevice::restoreState (KConfig *c) ConfigPageInfo StreamingDevice::createConfigurationPage() { StreamingConfiguration *conf = new StreamingConfiguration(NULL, this); - QObject::connect(this, SIGNAL(sigUpdateConfig()), conf, SLOT(slotUpdateConfig())); + TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig())); return ConfigPageInfo (conf, i18n("Streaming"), i18n("Streaming Device Options"), @@ -182,9 +182,9 @@ AboutPageInfo StreamingDevice::createAboutPage() -bool StreamingDevice::preparePlayback(SoundStreamID id, const QString &channel, bool /*active_mode*/, bool start_immediately) +bool StreamingDevice::preparePlayback(SoundStreamID id, const TQString &channel, bool /*active_mode*/, bool start_immediately) { - if (id.isValid() && m_PlaybackChannels.find(channel)) { + if (id.isValid() && m_PlaybackChannels.tqfind(channel)) { m_AllPlaybackStreams.insert(id, channel); if (start_immediately) startPlayback(id); @@ -194,10 +194,10 @@ bool StreamingDevice::preparePlayback(SoundStreamID id, const QString &channel, } -bool StreamingDevice::prepareCapture(SoundStreamID id, const QString &channel) +bool StreamingDevice::prepareCapture(SoundStreamID id, const TQString &channel) { logDebug("StreamingDevice::prepareCapture"); - if (id.isValid() && m_CaptureChannels.find(channel)) { + if (id.isValid() && m_CaptureChannels.tqfind(channel)) { m_AllCaptureStreams.insert(id, channel); return true; } @@ -206,9 +206,9 @@ bool StreamingDevice::prepareCapture(SoundStreamID id, const QString &channel) bool StreamingDevice::releasePlayback(SoundStreamID id) { - if (id.isValid() && m_AllPlaybackStreams.contains(id)) { + if (id.isValid() && m_AllPlaybackStreams.tqcontains(id)) { stopPlayback(id); - if (!m_EnabledPlaybackStreams.contains(id)) + if (!m_EnabledPlaybackStreams.tqcontains(id)) m_AllPlaybackStreams.remove(id); return true; } @@ -218,9 +218,9 @@ bool StreamingDevice::releasePlayback(SoundStreamID id) bool StreamingDevice::releaseCapture(SoundStreamID id) { logDebug("StreamingDevice::releaseCapture"); - if (id.isValid() && m_AllCaptureStreams.contains(id)) { + if (id.isValid() && m_AllCaptureStreams.tqcontains(id)) { stopCapture(id); - if (!m_EnabledCaptureStreams.contains(id)) + if (!m_EnabledCaptureStreams.tqcontains(id)) m_AllCaptureStreams.remove(id); return true; } @@ -241,9 +241,9 @@ bool StreamingDevice::supportsCapture() const bool StreamingDevice::startPlayback(SoundStreamID id) { - if (id.isValid() && m_AllPlaybackStreams.contains(id)) { + if (id.isValid() && m_AllPlaybackStreams.tqcontains(id)) { m_EnabledPlaybackStreams.insert(id, m_AllPlaybackStreams[id]); - StreamingJob &x = *m_PlaybackChannels.find(m_AllPlaybackStreams[id]); + StreamingJob &x = *m_PlaybackChannels.tqfind(m_AllPlaybackStreams[id]); x.startPlayback(); return true; } else { @@ -261,8 +261,8 @@ bool StreamingDevice::pausePlayback(SoundStreamID /*id*/) bool StreamingDevice::stopPlayback(SoundStreamID id) { - if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) { - StreamingJob &x = *m_PlaybackChannels.find(m_AllPlaybackStreams[id]); + if (id.isValid() && m_EnabledPlaybackStreams.tqcontains(id)) { + StreamingJob &x = *m_PlaybackChannels.tqfind(m_AllPlaybackStreams[id]); if (x.stopPlayback()) { m_EnabledPlaybackStreams.remove(id); } @@ -275,7 +275,7 @@ bool StreamingDevice::stopPlayback(SoundStreamID id) bool StreamingDevice::isPlaybackRunning(SoundStreamID id, bool &b) const { - if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) { + if (id.isValid() && m_EnabledPlaybackStreams.tqcontains(id)) { b = true; return true; } else { @@ -289,9 +289,9 @@ bool StreamingDevice::startCaptureWithFormat(SoundStreamID id, bool force_format) { logDebug("StreamingDevice::startCaptureWithFormat"); - if (id.isValid() && m_AllCaptureStreams.contains(id)) { + if (id.isValid() && m_AllCaptureStreams.tqcontains(id)) { m_EnabledCaptureStreams.insert(id, m_AllCaptureStreams[id]); - StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]); + StreamingJob &x = *m_CaptureChannels.tqfind(m_AllCaptureStreams[id]); x.startCapture(proposed_format, real_format, force_format); return true; } else { @@ -302,8 +302,8 @@ bool StreamingDevice::startCaptureWithFormat(SoundStreamID id, bool StreamingDevice::stopCapture(SoundStreamID id) { - if (id.isValid() && m_EnabledCaptureStreams.contains(id)) { - StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]); + if (id.isValid() && m_EnabledCaptureStreams.tqcontains(id)) { + StreamingJob &x = *m_CaptureChannels.tqfind(m_AllCaptureStreams[id]); if (x.stopCapture()) { m_EnabledCaptureStreams.remove(id); } @@ -316,8 +316,8 @@ bool StreamingDevice::stopCapture(SoundStreamID id) bool StreamingDevice::isCaptureRunning(SoundStreamID id, bool &b, SoundFormat &sf) const { - if (id.isValid() && m_EnabledCaptureStreams.contains(id)) { - StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]); + if (id.isValid() && m_EnabledCaptureStreams.tqcontains(id)) { + StreamingJob &x = *m_CaptureChannels.tqfind(m_AllCaptureStreams[id]); sf = x.getSoundFormat(); b = true; return true; @@ -339,22 +339,22 @@ bool StreamingDevice::noticeSoundStreamRedirected(SoundStreamID oldID, SoundStre { bool found = false; if (newID != oldID) { - if (m_AllPlaybackStreams.contains(oldID)) { + if (m_AllPlaybackStreams.tqcontains(oldID)) { m_AllPlaybackStreams.insert(newID, m_AllPlaybackStreams[oldID]); m_AllPlaybackStreams.remove(oldID); found = true; } - if (m_EnabledPlaybackStreams.contains(oldID)) { + if (m_EnabledPlaybackStreams.tqcontains(oldID)) { m_EnabledPlaybackStreams.insert(newID, m_EnabledPlaybackStreams[oldID]); m_EnabledPlaybackStreams.remove(oldID); found = true; } - if (m_AllCaptureStreams.contains(oldID)) { + if (m_AllCaptureStreams.tqcontains(oldID)) { m_AllCaptureStreams.insert(newID, m_AllCaptureStreams[oldID]); m_AllCaptureStreams.remove(oldID); found = true; } - if (m_EnabledCaptureStreams.contains(oldID)) { + if (m_EnabledCaptureStreams.tqcontains(oldID)) { m_EnabledCaptureStreams.insert(newID, m_EnabledCaptureStreams[oldID]); m_EnabledCaptureStreams.remove(oldID); found = true; @@ -370,8 +370,8 @@ bool StreamingDevice::noticeSoundStreamData(SoundStreamID id, const SoundMetaData &/*md*/ ) { - if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) { - StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]); + if (id.isValid() && m_EnabledPlaybackStreams.tqcontains(id)) { + StreamingJob &x = *m_CaptureChannels.tqfind(m_AllCaptureStreams[id]); x.playData(data, size, consumed_size); return true; } @@ -382,15 +382,15 @@ bool StreamingDevice::noticeSoundStreamData(SoundStreamID id, bool StreamingDevice::noticeReadyForPlaybackData(SoundStreamID id, size_t free_size) { - if (!id.isValid() || !m_AllCaptureStreams.contains(id)) + if (!id.isValid() || !m_AllCaptureStreams.tqcontains(id)) return false; - StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]); + StreamingJob &x = *m_CaptureChannels.tqfind(m_AllCaptureStreams[id]); while (x.hasRecordedData() && free_size > 0) { const char *buffer = NULL; size_t size = SIZE_T_DONT_CARE; size_t consumed_size = SIZE_T_DONT_CARE; - SoundMetaData meta_data(0,0,0, i18n("internal stream, not stored (%1)").arg(m_AllCaptureStreams[id])); + SoundMetaData meta_data(0,0,0, i18n("internal stream, not stored (%1)").tqarg(m_AllCaptureStreams[id])); x.lockData(buffer, size, meta_data); // get pointer to data and meta-data content if (size > free_size) size = free_size; @@ -400,7 +400,7 @@ bool StreamingDevice::noticeReadyForPlaybackData(SoundStreamID id, size_t free_s x.removeData(consumed_size); free_size -= consumed_size; if (consumed_size < size) { - logWarning(i18n("StreamingDevice %1::notifySoundStreamData: Playback Clients skipped %2 bytes").arg(name()).arg(size-consumed_size)); + logWarning(i18n("StreamingDevice %1::notifySoundStreamData: Playback Clients skipped %2 bytes").tqarg(name()).tqarg(size-consumed_size)); break; } } @@ -409,38 +409,38 @@ bool StreamingDevice::noticeReadyForPlaybackData(SoundStreamID id, size_t free_s -const QStringList &StreamingDevice::getPlaybackChannels() const +const TQStringList &StreamingDevice::getPlaybackChannels() const { return m_PlaybackChannelList; } -const QStringList &StreamingDevice::getCaptureChannels() const +const TQStringList &StreamingDevice::getCaptureChannels() const { return m_CaptureChannelList; } -QString StreamingDevice::getSoundStreamClientDescription() const +TQString StreamingDevice::getSoundStreamClientDescription() const { - return i18n("Streaming Device %1").arg(PluginBase::name()); + return i18n("Streaming Device %1").tqarg(PluginBase::name()); } -void StreamingDevice::logStreamError(const KURL &url, const QString &s) +void StreamingDevice::logStreamError(const KURL &url, const TQString &s) { - logError(i18n("Streaming Device %1, %2: %3").arg(name()).arg(url.url()).arg(s)); + logError(i18n("Streaming Device %1, %2: %3").tqarg(name()).tqarg(url.url()).tqarg(s)); } -void StreamingDevice::logStreamWarning(const KURL &url, const QString &s) +void StreamingDevice::logStreamWarning(const KURL &url, const TQString &s) { - logWarning(i18n("Streaming Device %1, %2: %3").arg(name()).arg(url.url()).arg(s)); + logWarning(i18n("Streaming Device %1, %2: %3").tqarg(name()).tqarg(url.url()).tqarg(s)); } -bool StreamingDevice::getPlaybackStreamOptions(const QString &channel, QString &url, SoundFormat &sf, size_t &buffer_size) const +bool StreamingDevice::getPlaybackStreamOptions(const TQString &channel, TQString &url, SoundFormat &sf, size_t &buffer_size) const { - if (m_PlaybackChannels.find(channel)) { + if (m_PlaybackChannels.tqfind(channel)) { const StreamingJob *j = m_PlaybackChannels[channel]; url = j->getURL(); sf = j->getSoundFormat(); @@ -451,9 +451,9 @@ bool StreamingDevice::getPlaybackStreamOptions(const QString &channel, QString & } -bool StreamingDevice::getCaptureStreamOptions(const QString &channel, QString &url, SoundFormat &sf, size_t &buffer_size) const +bool StreamingDevice::getCaptureStreamOptions(const TQString &channel, TQString &url, SoundFormat &sf, size_t &buffer_size) const { - if (m_CaptureChannels.find(channel)) { + if (m_CaptureChannels.tqfind(channel)) { const StreamingJob *j = m_CaptureChannels[channel]; url = j->getURL(); sf = j->getSoundFormat(); @@ -495,11 +495,11 @@ void StreamingDevice::resetCaptureStreams(bool notification_enabled) } -void StreamingDevice::addPlaybackStream(const QString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled) +void StreamingDevice::addPlaybackStream(const TQString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled) { StreamingJob *x = new StreamingJob(url, sf, buffer_size); - connect(x, SIGNAL(logStreamError(const KURL &, const QString &)), - this, SLOT (logStreamError(const KURL &, const QString &))); + connect(x, TQT_SIGNAL(logStreamError(const KURL &, const TQString &)), + this, TQT_SLOT (logStreamError(const KURL &, const TQString &))); m_PlaybackChannelList.append(url); m_PlaybackChannels.insert(url, x); @@ -509,11 +509,11 @@ void StreamingDevice::addPlaybackStream(const QString &url, const SoundFormat &s } -void StreamingDevice::addCaptureStream (const QString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled) +void StreamingDevice::addCaptureStream (const TQString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled) { StreamingJob *x = new StreamingJob(url, sf, buffer_size); - connect(x, SIGNAL(logStreamError(const KURL &, const QString &)), - this, SLOT (logStreamError(const KURL &, const QString &))); + connect(x, TQT_SIGNAL(logStreamError(const KURL &, const TQString &)), + this, TQT_SLOT (logStreamError(const KURL &, const TQString &))); m_CaptureChannelList.append(url); m_CaptureChannels.insert(url, x); |