File indexing completed on 2024-04-21 15:32:32

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation 
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public 
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 
0021 */
0022 
0023 #ifndef PATH_P_H
0024 #define PATH_P_H
0025 
0026 #include "path.h"
0027 #include <QPair>
0028 #include <QList>
0029 #include <QSharedData>
0030 #include "effect.h"
0031 #include "medianodedestructionhandler_p.h"
0032 
0033 class QObject;
0034 
0035 namespace Phonon
0036 {
0037 
0038 class MediaNode;
0039 typedef QPair<QObject*, QObject*> QObjectPair;
0040 
0041 
0042 class PathPrivate : public QSharedData, private MediaNodeDestructionHandler
0043 {
0044     friend class Path;
0045     public:
0046         PathPrivate()
0047             : sourceNode(nullptr), sinkNode(nullptr)
0048 #ifndef QT_NO_PHONON_EFFECT
0049             , effectsParent(nullptr)
0050 #endif //QT_NO_PHONON_EFFECT
0051         {
0052         }
0053 
0054         ~PathPrivate() override;
0055 
0056         MediaNode *sourceNode;
0057         MediaNode *sinkNode;
0058 
0059     protected:
0060         void phononObjectDestroyed(MediaNodePrivate *) override;
0061 
0062 #ifndef QT_NO_PHONON_EFFECT
0063         QObject *effectsParent; // used as parent for Effects created in insertEffect
0064         QList<Effect *> effects;
0065 #endif
0066     private:
0067         bool executeTransaction( const QList<QObjectPair> &disconnections, const QList<QObjectPair> &connections);
0068 #ifndef QT_NO_PHONON_EFFECT
0069         bool removeEffect(Effect *effect);
0070 #endif
0071 };
0072 
0073 } // namespace Phonon
0074 
0075 #endif // PATH_P_H