1 /* This file is part of the KDE project
2 Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
20 #ifndef PHONON_MEDIANODE_P_H
21 #define PHONON_MEDIANODE_P_H
23 #include <QtCore/QtGlobal>
24 #include <QtCore/QList>
25 #include <QtCore/QObject>
26 #include <phonon/path.h>
27 #include <phonon/phonon_export.h>
36 class MediaNodeDestructionHandler
;
38 class PHONON_EXPORT MediaNodePrivate
40 Q_DECLARE_PUBLIC(MediaNode
)
42 friend class AudioOutputPrivate
;
43 friend class FactoryPrivate
;
48 AbstractAudioOutputPrivateType
,
53 * Returns the backend object. If the object does not exist it tries to
54 * create it before returning.
56 * \return the Iface object, might return \c 0
58 QObject
*backendObject();
63 MediaNodePrivate(CastId _castId
= MediaNodePrivateType
);
65 virtual ~MediaNodePrivate();
69 * This method cleanly deletes the Iface object. It is called on
70 * destruction and before a backend change.
72 void deleteBackendObject();
74 virtual bool aboutToDeleteBackendObject() = 0;
78 * Creates the Iface object belonging to this class. For most cases the
82 * m_iface = Factory::createClassName(this);
86 * This function should not be called except from slotCreateIface.
88 * \see slotCreateIface
90 virtual void createBackendObject() = 0;
95 * This class has its own destroyed signal since some cleanup calls
96 * need the pointer to the backend object intact. The
97 * QObject::destroyed signals comes after the backend object was
100 * As this class cannot derive from QObject a simple handler
103 void addDestructionHandler(MediaNodeDestructionHandler
*handler
);
107 * This class has its own destroyed signal since some cleanup calls
108 * need the pointer to the backend object intact. The
109 * QObject::destroyed signals comes after the backend object was
112 * As this class cannot derive from QObject a simple handler
115 void removeDestructionHandler(MediaNodeDestructionHandler
*handler
);
117 void addOutputPath(const Path
&);
118 void addInputPath(const Path
&);
119 void removeOutputPath(const Path
&);
120 void removeInputPath(const Path
&);
122 const QObject
*qObject() const { return const_cast<MediaNodePrivate
*>(this)->qObject(); }
123 virtual QObject
*qObject() = 0;
128 QObject
*m_backendObject
;
130 QList
<Path
> outputPaths
;
131 QList
<Path
> inputPaths
;
134 QList
<MediaNodeDestructionHandler
*> handlers
;
135 Q_DISABLE_COPY(MediaNodePrivate
)
138 } // namespace Phonon
142 #endif // PHONON_MEDIANODE_P_H