path.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) version 3, or any
00008     later version accepted by the membership of KDE e.V. (or its
00009     successor approved by the membership of KDE e.V.), Nokia Corporation 
00010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
00011     act as a proxy defined in Section 6 of version 3 of the license.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public 
00019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef PHONON_PATH_H
00024 #define PHONON_PATH_H
00025 
00026 #include "phonon_export.h"
00027 #include "objectdescription.h"
00028 
00029 #include <QtCore/QExplicitlySharedDataPointer>
00030 
00031 QT_BEGIN_HEADER
00032 QT_BEGIN_NAMESPACE
00033 
00034 template<class T> class QList;
00035 
00036 namespace Phonon
00037 {
00038 
00039 class PathPrivate;
00040 class Effect;
00041 class MediaNode;
00042 
00063 class PHONON_EXPORT Path
00064 {
00065     friend class FactoryPrivate;
00066     public:
00073         ~Path();
00074 
00084         Path();
00085 
00091         Path(const Path &);
00092 
00099         bool isValid() const;
00100         //MediaStreamTypes mediaStreamTypes() const;
00101 
00102 #ifndef QT_NO_PHONON_EFFECT
00103 
00124         Effect *insertEffect(const EffectDescription &desc, Effect *insertBefore = 0);
00125 
00147         bool insertEffect(Effect *newEffect, Effect *insertBefore = 0);
00148 
00164         bool removeEffect(Effect *effect);
00165 
00176         QList<Effect *> effects() const;
00177 #endif //QT_NO_PHONON_EFFECT
00178 
00184         bool reconnect(MediaNode *source, MediaNode *sink);
00185 
00190         bool disconnect();
00191 
00197         Path &operator=(const Path &p);
00198 
00202         bool operator==(const Path &p) const;
00203 
00207         bool operator!=(const Path &p) const;
00208 
00212         MediaNode *source() const;
00213 
00217         MediaNode *sink() const;
00218 
00219 
00220     protected:
00221         friend class PathPrivate;
00222         QExplicitlySharedDataPointer<PathPrivate> d;
00223 };
00224 
00236 PHONON_EXPORT Path createPath(MediaNode *source, MediaNode *sink);
00237 
00238 } // namespace Phonon
00239 
00240 QT_END_NAMESPACE
00241 QT_END_HEADER
00242 
00243 #endif // PHONON_PATH_H