You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
527 lines
17 KiB
527 lines
17 KiB
15 years ago
|
/***************************************************************************
|
||
|
streaming.cpp - description
|
||
|
-------------------
|
||
|
begin : Sun Sept 3 2006
|
||
|
copyright : (C) 2006 by Martin Witte
|
||
|
email : witte@kawo1.rwth-aachen.de
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* This program is free software; you can redistribute it and/or modify *
|
||
|
* it under the terms of the GNU General Public License as published by *
|
||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||
|
* (at your option) any later version. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
|
||
|
#include "streaming.h"
|
||
|
|
||
|
#include "../../src/include/aboutwidget.h"
|
||
|
#include "../../src/include/utils.h"
|
||
12 years ago
|
#include <tdelocale.h>
|
||
12 years ago
|
#include <tdeaboutdata.h>
|
||
15 years ago
|
#include <kurl.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
15 years ago
|
|
||
|
#include "streaming-job.h"
|
||
|
#include "streaming-configuration.h"
|
||
|
|
||
|
///////////////////////////////////////////////////////////////////////
|
||
|
//// plugin library functions
|
||
|
|
||
12 years ago
|
PLUGIN_LIBRARY_FUNCTIONS(StreamingDevice, "tderadio-streaming", i18n("Streaming Support"));
|
||
15 years ago
|
|
||
|
/////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
StreamingDevice::StreamingDevice(const TQString &name)
|
||
|
: TQObject(NULL, NULL),
|
||
12 years ago
|
PluginBase(name, i18n("TDERadio Streaming Plugin"))
|
||
15 years ago
|
{
|
||
|
m_CaptureChannels.setAutoDelete(true);
|
||
|
m_PlaybackChannels.setAutoDelete(true);
|
||
|
}
|
||
|
|
||
|
|
||
|
StreamingDevice::~StreamingDevice()
|
||
|
{
|
||
|
resetPlaybackStreams();
|
||
|
resetCaptureStreams();
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::connectI(Interface *i)
|
||
|
{
|
||
|
bool a = PluginBase::connectI(i);
|
||
|
bool b = ISoundStreamClient::connectI(i);
|
||
|
return a || b;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::disconnectI(Interface *i)
|
||
|
{
|
||
|
bool a = PluginBase::disconnectI(i);
|
||
|
bool b = ISoundStreamClient::disconnectI(i);
|
||
|
return a || b;
|
||
|
}
|
||
|
|
||
|
void StreamingDevice::noticeConnectedI (ISoundStreamServer *s, bool pointer_valid)
|
||
|
{
|
||
|
ISoundStreamClient::noticeConnectedI(s, pointer_valid);
|
||
|
if (s && pointer_valid) {
|
||
|
s->register4_sendReleasePlayback(this);
|
||
|
s->register4_sendReleaseCapture(this);
|
||
|
s->register4_sendStartPlayback(this);
|
||
|
s->register4_sendPausePlayback(this);
|
||
|
s->register4_sendStopPlayback(this);
|
||
|
s->register4_queryIsPlaybackRunning(this);
|
||
|
s->register4_sendStartCaptureWithFormat(this);
|
||
|
s->register4_sendStopCapture(this);
|
||
|
s->register4_queryIsCaptureRunning(this);
|
||
|
s->register4_notifySoundStreamClosed(this);
|
||
|
s->register4_notifySoundStreamRedirected(this);
|
||
|
s->register4_notifySoundStreamData(this);
|
||
|
s->register4_notifyReadyForPlaybackData(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// PluginBase
|
||
|
|
||
12 years ago
|
void StreamingDevice::saveState (TDEConfig *c) const
|
||
15 years ago
|
{
|
||
14 years ago
|
c->setGroup(TQString("streaming-") + PluginBase::name());
|
||
15 years ago
|
c->writeEntry("soundstreamclient-id", m_SoundStreamClientID);
|
||
|
|
||
|
c->writeEntry("playback-channels", m_PlaybackChannelList.size());
|
||
|
for (unsigned int i = 0; i < m_PlaybackChannelList.size(); ++i) {
|
||
14 years ago
|
TQString s = m_PlaybackChannelList[i];
|
||
15 years ago
|
const StreamingJob *j = m_PlaybackChannels[s];
|
||
|
|
||
|
const SoundFormat &sf = j->getSoundFormat();
|
||
|
KURL url = j->getURL();
|
||
|
size_t buffer_size = j->getBufferSize();
|
||
|
|
||
14 years ago
|
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);
|
||
15 years ago
|
}
|
||
|
|
||
|
c->writeEntry("capture-channels", m_CaptureChannelList.size());
|
||
|
for (unsigned int i = 0; i < m_CaptureChannelList.size(); ++i) {
|
||
14 years ago
|
TQString s = m_CaptureChannelList[i];
|
||
15 years ago
|
const StreamingJob *j = m_CaptureChannels[s];
|
||
|
|
||
|
const SoundFormat &sf = j->getSoundFormat();
|
||
|
KURL url = j->getURL();
|
||
|
size_t buffer_size = j->getBufferSize();
|
||
|
|
||
14 years ago
|
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);
|
||
15 years ago
|
}
|
||
|
}
|
||
|
|
||
12 years ago
|
void StreamingDevice::restoreState (TDEConfig *c)
|
||
15 years ago
|
{
|
||
14 years ago
|
c->setGroup(TQString("streaming-") + PluginBase::name());
|
||
15 years ago
|
setSoundStreamClientID(c->readEntry("soundstreamclient-id", getSoundStreamClientID()));
|
||
|
|
||
|
resetPlaybackStreams(false);
|
||
|
resetCaptureStreams(false);
|
||
|
|
||
|
int n = c->readNumEntry("playback-channels", 0);
|
||
|
for (int i = 0; i < n; ++i) {
|
||
|
SoundFormat sf;
|
||
14 years ago
|
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);
|
||
15 years ago
|
|
||
|
if (!url.isNull()) {
|
||
|
addPlaybackStream(url, sf, buffer_size, i == n-1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
n = c->readNumEntry("capture-channels", 0);
|
||
|
for (int i = 0; i < n; ++i) {
|
||
|
SoundFormat sf;
|
||
14 years ago
|
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);
|
||
15 years ago
|
|
||
|
if (!url.isNull()) {
|
||
|
addCaptureStream(url, sf, buffer_size, i == n-1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (!m_CaptureChannelList.size()) {
|
||
|
addCaptureStream("/dev/video24", SoundFormat(48000, 2, 16, true, BYTE_ORDER, "raw"), 65536);
|
||
|
}
|
||
|
|
||
|
emit sigUpdateConfig();
|
||
|
}
|
||
|
|
||
|
|
||
|
ConfigPageInfo StreamingDevice::createConfigurationPage()
|
||
|
{
|
||
|
StreamingConfiguration *conf = new StreamingConfiguration(NULL, this);
|
||
14 years ago
|
TQObject::connect(this, TQT_SIGNAL(sigUpdateConfig()), conf, TQT_SLOT(slotUpdateConfig()));
|
||
15 years ago
|
return ConfigPageInfo (conf,
|
||
|
i18n("Streaming"),
|
||
|
i18n("Streaming Device Options"),
|
||
12 years ago
|
"tderadio_streaming");
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
|
AboutPageInfo StreamingDevice::createAboutPage()
|
||
|
{
|
||
|
return AboutPageInfo();
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
bool StreamingDevice::preparePlayback(SoundStreamID id, const TQString &channel, bool /*active_mode*/, bool start_immediately)
|
||
15 years ago
|
{
|
||
13 years ago
|
if (id.isValid() && m_PlaybackChannels.find(channel)) {
|
||
15 years ago
|
m_AllPlaybackStreams.insert(id, channel);
|
||
|
if (start_immediately)
|
||
|
startPlayback(id);
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
bool StreamingDevice::prepareCapture(SoundStreamID id, const TQString &channel)
|
||
15 years ago
|
{
|
||
|
logDebug("StreamingDevice::prepareCapture");
|
||
13 years ago
|
if (id.isValid() && m_CaptureChannels.find(channel)) {
|
||
15 years ago
|
m_AllCaptureStreams.insert(id, channel);
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
bool StreamingDevice::releasePlayback(SoundStreamID id)
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_AllPlaybackStreams.contains(id)) {
|
||
15 years ago
|
stopPlayback(id);
|
||
13 years ago
|
if (!m_EnabledPlaybackStreams.contains(id))
|
||
15 years ago
|
m_AllPlaybackStreams.remove(id);
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
bool StreamingDevice::releaseCapture(SoundStreamID id)
|
||
|
{
|
||
|
logDebug("StreamingDevice::releaseCapture");
|
||
13 years ago
|
if (id.isValid() && m_AllCaptureStreams.contains(id)) {
|
||
15 years ago
|
stopCapture(id);
|
||
13 years ago
|
if (!m_EnabledCaptureStreams.contains(id))
|
||
15 years ago
|
m_AllCaptureStreams.remove(id);
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
bool StreamingDevice::supportsPlayback() const
|
||
|
{
|
||
|
return m_PlaybackChannels.size() > 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::supportsCapture() const
|
||
|
{
|
||
|
return m_CaptureChannels.size() > 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::startPlayback(SoundStreamID id)
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_AllPlaybackStreams.contains(id)) {
|
||
15 years ago
|
m_EnabledPlaybackStreams.insert(id, m_AllPlaybackStreams[id]);
|
||
13 years ago
|
StreamingJob &x = *m_PlaybackChannels.find(m_AllPlaybackStreams[id]);
|
||
15 years ago
|
x.startPlayback();
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::pausePlayback(SoundStreamID /*id*/)
|
||
|
{
|
||
|
//return stopPlayback(id);
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::stopPlayback(SoundStreamID id)
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) {
|
||
|
StreamingJob &x = *m_PlaybackChannels.find(m_AllPlaybackStreams[id]);
|
||
15 years ago
|
if (x.stopPlayback()) {
|
||
|
m_EnabledPlaybackStreams.remove(id);
|
||
|
}
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::isPlaybackRunning(SoundStreamID id, bool &b) const
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) {
|
||
15 years ago
|
b = true;
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool StreamingDevice::startCaptureWithFormat(SoundStreamID id,
|
||
|
const SoundFormat &proposed_format,
|
||
|
SoundFormat &real_format,
|
||
|
bool force_format)
|
||
|
{
|
||
|
logDebug("StreamingDevice::startCaptureWithFormat");
|
||
13 years ago
|
if (id.isValid() && m_AllCaptureStreams.contains(id)) {
|
||
15 years ago
|
m_EnabledCaptureStreams.insert(id, m_AllCaptureStreams[id]);
|
||
13 years ago
|
StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]);
|
||
15 years ago
|
x.startCapture(proposed_format, real_format, force_format);
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::stopCapture(SoundStreamID id)
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_EnabledCaptureStreams.contains(id)) {
|
||
|
StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]);
|
||
15 years ago
|
if (x.stopCapture()) {
|
||
|
m_EnabledCaptureStreams.remove(id);
|
||
|
}
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::isCaptureRunning(SoundStreamID id, bool &b, SoundFormat &sf) const
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_EnabledCaptureStreams.contains(id)) {
|
||
|
StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]);
|
||
15 years ago
|
sf = x.getSoundFormat();
|
||
|
b = true;
|
||
|
return true;
|
||
|
} else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::noticeSoundStreamClosed(SoundStreamID id)
|
||
|
{
|
||
|
bool found = (stopCapture(id) && releaseCapture(id)) ||
|
||
|
(stopPlayback(id) && releasePlayback(id));
|
||
|
return found;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::noticeSoundStreamRedirected(SoundStreamID oldID, SoundStreamID newID)
|
||
|
{
|
||
|
bool found = false;
|
||
|
if (newID != oldID) {
|
||
13 years ago
|
if (m_AllPlaybackStreams.contains(oldID)) {
|
||
15 years ago
|
m_AllPlaybackStreams.insert(newID, m_AllPlaybackStreams[oldID]);
|
||
|
m_AllPlaybackStreams.remove(oldID);
|
||
|
found = true;
|
||
|
}
|
||
13 years ago
|
if (m_EnabledPlaybackStreams.contains(oldID)) {
|
||
15 years ago
|
m_EnabledPlaybackStreams.insert(newID, m_EnabledPlaybackStreams[oldID]);
|
||
|
m_EnabledPlaybackStreams.remove(oldID);
|
||
|
found = true;
|
||
|
}
|
||
13 years ago
|
if (m_AllCaptureStreams.contains(oldID)) {
|
||
15 years ago
|
m_AllCaptureStreams.insert(newID, m_AllCaptureStreams[oldID]);
|
||
|
m_AllCaptureStreams.remove(oldID);
|
||
|
found = true;
|
||
|
}
|
||
13 years ago
|
if (m_EnabledCaptureStreams.contains(oldID)) {
|
||
15 years ago
|
m_EnabledCaptureStreams.insert(newID, m_EnabledCaptureStreams[oldID]);
|
||
|
m_EnabledCaptureStreams.remove(oldID);
|
||
|
found = true;
|
||
|
}
|
||
|
}
|
||
|
return found;
|
||
|
}
|
||
|
|
||
|
|
||
|
bool StreamingDevice::noticeSoundStreamData(SoundStreamID id,
|
||
|
const SoundFormat &/*format*/,
|
||
|
const char *data, size_t size, size_t &consumed_size,
|
||
|
const SoundMetaData &/*md*/
|
||
|
)
|
||
|
{
|
||
13 years ago
|
if (id.isValid() && m_EnabledPlaybackStreams.contains(id)) {
|
||
|
StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]);
|
||
15 years ago
|
x.playData(data, size, consumed_size);
|
||
|
return true;
|
||
|
}
|
||
|
else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool StreamingDevice::noticeReadyForPlaybackData(SoundStreamID id, size_t free_size)
|
||
|
{
|
||
13 years ago
|
if (!id.isValid() || !m_AllCaptureStreams.contains(id))
|
||
15 years ago
|
return false;
|
||
13 years ago
|
StreamingJob &x = *m_CaptureChannels.find(m_AllCaptureStreams[id]);
|
||
15 years ago
|
|
||
|
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;
|
||
13 years ago
|
SoundMetaData meta_data(0,0,0, i18n("internal stream, not stored (%1)").arg(m_AllCaptureStreams[id]));
|
||
15 years ago
|
x.lockData(buffer, size, meta_data); // get pointer to data and meta-data content
|
||
|
if (size > free_size)
|
||
|
size = free_size;
|
||
|
notifySoundStreamData(id, x.getSoundFormat(), buffer, size, consumed_size, meta_data);
|
||
|
if (consumed_size == SIZE_T_DONT_CARE)
|
||
|
consumed_size = size;
|
||
|
x.removeData(consumed_size);
|
||
|
free_size -= consumed_size;
|
||
|
if (consumed_size < size) {
|
||
13 years ago
|
logWarning(i18n("StreamingDevice %1::notifySoundStreamData: Playback Clients skipped %2 bytes").arg(name()).arg(size-consumed_size));
|
||
15 years ago
|
break;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
14 years ago
|
const TQStringList &StreamingDevice::getPlaybackChannels() const
|
||
15 years ago
|
{
|
||
|
return m_PlaybackChannelList;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
const TQStringList &StreamingDevice::getCaptureChannels() const
|
||
15 years ago
|
{
|
||
|
return m_CaptureChannelList;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQString StreamingDevice::getSoundStreamClientDescription() const
|
||
15 years ago
|
{
|
||
13 years ago
|
return i18n("Streaming Device %1").arg(PluginBase::name());
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void StreamingDevice::logStreamError(const KURL &url, const TQString &s)
|
||
15 years ago
|
{
|
||
13 years ago
|
logError(i18n("Streaming Device %1, %2: %3").arg(name()).arg(url.url()).arg(s));
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void StreamingDevice::logStreamWarning(const KURL &url, const TQString &s)
|
||
15 years ago
|
{
|
||
13 years ago
|
logWarning(i18n("Streaming Device %1, %2: %3").arg(name()).arg(url.url()).arg(s));
|
||
15 years ago
|
}
|
||
|
|
||
|
|
||
14 years ago
|
bool StreamingDevice::getPlaybackStreamOptions(const TQString &channel, TQString &url, SoundFormat &sf, size_t &buffer_size) const
|
||
15 years ago
|
{
|
||
13 years ago
|
if (m_PlaybackChannels.find(channel)) {
|
||
15 years ago
|
const StreamingJob *j = m_PlaybackChannels[channel];
|
||
|
url = j->getURL();
|
||
|
sf = j->getSoundFormat();
|
||
|
buffer_size = j->getBufferSize();
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
bool StreamingDevice::getCaptureStreamOptions(const TQString &channel, TQString &url, SoundFormat &sf, size_t &buffer_size) const
|
||
15 years ago
|
{
|
||
13 years ago
|
if (m_CaptureChannels.find(channel)) {
|
||
15 years ago
|
const StreamingJob *j = m_CaptureChannels[channel];
|
||
|
url = j->getURL();
|
||
|
sf = j->getSoundFormat();
|
||
|
buffer_size = j->getBufferSize();
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
void StreamingDevice::resetPlaybackStreams(bool notification_enabled)
|
||
|
{
|
||
|
while (m_EnabledPlaybackStreams.begin() != m_EnabledPlaybackStreams.end()) {
|
||
|
sendStopPlayback(m_EnabledPlaybackStreams.begin().key());
|
||
|
}
|
||
|
while (m_AllPlaybackStreams.begin() != m_AllPlaybackStreams.end()) {
|
||
|
releasePlayback(m_AllPlaybackStreams.begin().key());
|
||
|
}
|
||
|
m_PlaybackChannelList.clear();
|
||
|
m_PlaybackChannels.clear();
|
||
|
if (notification_enabled) {
|
||
|
notifyPlaybackChannelsChanged(m_SoundStreamClientID, m_PlaybackChannelList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
void StreamingDevice::resetCaptureStreams(bool notification_enabled)
|
||
|
{
|
||
|
while (m_EnabledCaptureStreams.begin() != m_EnabledCaptureStreams.end()) {
|
||
|
sendStopCapture(m_EnabledCaptureStreams.begin().key());
|
||
|
}
|
||
|
while (m_AllCaptureStreams.begin() != m_AllCaptureStreams.end()) {
|
||
|
releaseCapture(m_AllCaptureStreams.begin().key());
|
||
|
}
|
||
|
m_CaptureChannelList.clear();
|
||
|
m_CaptureChannels.clear();
|
||
|
if (notification_enabled) {
|
||
|
notifyCaptureChannelsChanged(m_SoundStreamClientID, m_CaptureChannelList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void StreamingDevice::addPlaybackStream(const TQString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled)
|
||
15 years ago
|
{
|
||
|
StreamingJob *x = new StreamingJob(url, sf, buffer_size);
|
||
14 years ago
|
connect(x, TQT_SIGNAL(logStreamError(const KURL &, const TQString &)),
|
||
|
this, TQT_SLOT (logStreamError(const KURL &, const TQString &)));
|
||
15 years ago
|
|
||
|
m_PlaybackChannelList.append(url);
|
||
|
m_PlaybackChannels.insert(url, x);
|
||
|
if (notification_enabled) {
|
||
|
notifyPlaybackChannelsChanged(m_SoundStreamClientID, m_PlaybackChannelList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
void StreamingDevice::addCaptureStream (const TQString &url, const SoundFormat &sf, size_t buffer_size, bool notification_enabled)
|
||
15 years ago
|
{
|
||
|
StreamingJob *x = new StreamingJob(url, sf, buffer_size);
|
||
14 years ago
|
connect(x, TQT_SIGNAL(logStreamError(const KURL &, const TQString &)),
|
||
|
this, TQT_SLOT (logStreamError(const KURL &, const TQString &)));
|
||
15 years ago
|
|
||
|
m_CaptureChannelList.append(url);
|
||
|
m_CaptureChannels.insert(url, x);
|
||
|
if (notification_enabled) {
|
||
|
notifyCaptureChannelsChanged(m_SoundStreamClientID, m_CaptureChannelList);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
#include "streaming.moc"
|