1
/* This file is part of the KDE project
2
Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
21
#include "sourcenode.h"
24
#include "keepreference.h"
25
#include "audiooutput.h"
32
SourceNodeXT::SourceNodeXT(const char *name)
33
: className(name), deleted(false)
37
SourceNodeXT::~SourceNodeXT()
42
xine_post_out_t *SourceNodeXT::audioOutputPort() const
47
xine_post_out_t *SourceNodeXT::videoOutputPort() const
52
SourceNode::SourceNode(SourceNodeXT *_xt)
53
: m_threadSafeObject(_xt)
58
SourceNode::~SourceNode()
60
if (!m_sinks.isEmpty()) {
61
foreach (SinkNode *s, m_sinks) {
65
KeepReference<0> *keep = new KeepReference<0>;
66
keep->addObject(m_threadSafeObject.data());
67
m_threadSafeObject = 0;
71
void SourceNode::addSink(SinkNode *s)
73
Q_ASSERT(!m_sinks.contains(s));
77
void SourceNode::removeSink(SinkNode *s)
79
Q_ASSERT(m_sinks.contains(s));
83
QSet<SinkNode *> SourceNode::sinks() const
88
SinkNode *SourceNode::sinkInterface()
93
void SourceNode::upstreamEvent(Event *e)
96
SinkNode *iface = sinkInterface();
98
iface->SinkNode::upstreamEvent(e);
106
void SourceNode::downstreamEvent(Event *e)
109
foreach (SinkNode *sink, m_sinks) {
111
sink->downstreamEvent(e);
119
} // namespace Phonon