OSDN Git Service

fix VLC Phonon backend build withouts effects support
authorIvailo Monev <xakepa10@gmail.com>
Wed, 9 Mar 2016 06:50:20 +0000 (06:50 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 9 Mar 2016 06:50:20 +0000 (06:50 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/phonon/mediasource.cpp
src/phonon/phonon-vlc/audio/volumefadereffect.h
src/phonon/phonon-vlc/backend.cpp
src/phonon/phonon-vlc/backend.h
src/phonon/phonon-vlc/effect.cpp
src/phonon/phonon-vlc/effect.h
src/phonon/phonon-vlc/effectmanager.cpp
src/phonon/phonon-vlc/effectmanager.h
src/phonon/phonon-vlc/equalizereffect.cpp
src/phonon/phonon-vlc/equalizereffect.h

index 0c91840..5e00907 100644 (file)
@@ -422,8 +422,12 @@ QDebug operator <<(QDebug dbg, const Phonon::MediaSource &source)
     }
     case MediaSource::CaptureDevice:
     case MediaSource::AudioVideoCapture:
+#ifndef QT_NO_PHONON_EFFECT
         dbg.nospace() << "AudioVideoCapture(A:" << source.audioCaptureDevice().name()
                       << "/V: " << source.videoCaptureDevice().name() << ")";
+#else
+        dbg.nospace() << "AudioVideoCapture(A:/V: )";
+#endif
         break;
     case MediaSource::Empty:
         dbg.nospace() << "Empty()";
index e05ed94..b0e95f1 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef PHONON_VLC_VOLUMEFADEREFFECT_H
 #define PHONON_VLC_VOLUMEFADEREFFECT_H
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include <phonon/volumefaderinterface.h>
 
 #include <QtCore/QDateTime>
@@ -68,4 +70,6 @@ private:
 } // namespace VLC
 } // namespace Phonon
 
+#endif // QT_NO_PHONON_EFFECT
+
 #endif // PHONON_VLC_VOLUMEFADEREFFECT_H
index 6fc8459..306672b 100644 (file)
@@ -63,7 +63,9 @@ Backend *Backend::self;
 Backend::Backend(QObject *parent, const QVariantList &)
     : QObject(parent)
     , m_deviceManager(0)
+#ifndef QT_NO_PHONON_EFFECT
     , m_effectManager(0)
+#endif // QT_NO_PHONON_EFFECT
 {
     self = this;
 
@@ -135,7 +137,9 @@ Backend::Backend(QObject *parent, const QVariantList &)
     }
 
     m_deviceManager = new DeviceManager(this);
+#ifndef QT_NO_PHONON_EFFECT
     m_effectManager = new EffectManager(this);
+#endif // QT_NO_PHONON_EFFECT
 }
 
 Backend::~Backend()
@@ -172,8 +176,10 @@ QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const
     case VideoGraphicsObjectClass:
         return new VideoGraphicsObject(parent);
 #endif
+#ifndef QT_NO_PHONON_EFFECT
     case EffectClass:
         return effectManager()->createEffect(args[0].toInt(), parent);
+#endif // QT_NO_PHONON_EFFECT
     case VideoWidgetClass:
         return new VideoWidget(qobject_cast<QWidget *>(parent));
 //    case VolumeFaderEffectClass:
@@ -209,6 +215,7 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
         return deviceManager()->deviceIds(type);
     }
     break;
+#ifndef QT_NO_PHONON_EFFECT
     case Phonon::EffectType: {
         QList<EffectInfo> effectList = effectManager()->effects();
         for (int eff = 0; eff < effectList.size(); ++eff) {
@@ -216,6 +223,7 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
         }
     }
     break;
+#endif // QT_NO_PHONON_EFFECT
     case Phonon::SubtitleType: {
         list << GlobalSubtitles::instance()->globalIndexes();
     }
@@ -243,6 +251,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
         return deviceManager()->deviceProperties(index);
     }
     break;
+#ifndef QT_NO_PHONON_EFFECT
     case Phonon::EffectType: {
         const QList<EffectInfo> effectList = effectManager()->effects();
         if (index >= 0 && index <= effectList.size()) {
@@ -255,6 +264,7 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
         }
     }
     break;
+#endif // QT_NO_PHONON_EFFECT
     case Phonon::SubtitleType: {
         const SubtitleDescription description = GlobalSubtitles::instance()->fromIndex(index);
         ret.insert("name", description.name());
@@ -293,11 +303,13 @@ bool Backend::connectNodes(QObject *source, QObject *sink)
             return true;
         }
 
+#ifndef QT_NO_PHONON_EFFECT
         VolumeFaderEffect *effect = qobject_cast<VolumeFaderEffect *>(source);
         if (effect) {
             sinkNode->connectToMediaObject(effect->mediaObject());
             return true;
         }
+#endif // QT_NO_PHONON_EFFECT
     }
 
     warning() << "Linking" << source->metaObject()->className() << "to" << sink->metaObject()->className() << "failed";
@@ -316,11 +328,13 @@ bool Backend::disconnectNodes(QObject *source, QObject *sink)
             return true;
         }
 
+#ifndef QT_NO_PHONON_EFFECT
         VolumeFaderEffect *const effect = qobject_cast<VolumeFaderEffect *>(source);
         if (effect) {
             sinkNode->disconnectFromMediaObject(effect->mediaObject());
             return true;
         }
+#endif // QT_NO_PHONON_EFFECT
     }
 
     return false;
@@ -339,10 +353,12 @@ DeviceManager *Backend::deviceManager() const
     return m_deviceManager;
 }
 
+#ifndef QT_NO_PHONON_EFFECT
 EffectManager *Backend::effectManager() const
 {
     return m_effectManager;
 }
+#endif // QT_NO_PHONON_EFFECT
 
 } // namespace VLC
 } // namespace Phonon
index c4403d6..bdd32a3 100644 (file)
@@ -34,7 +34,9 @@ namespace Phonon
 namespace VLC
 {
 class DeviceManager;
+#ifndef QT_NO_PHONON_EFFECT
 class EffectManager;
+#endif // QT_NO_PHONON_EFFECT
 
 /** \brief Backend class for Phonon-VLC.
  *
@@ -75,8 +77,10 @@ public:
     /// \return The device manager that is associated with this backend object
     DeviceManager *deviceManager() const;
 
+#ifndef QT_NO_PHONON_EFFECT
     /// \return The effect manager that is associated with this backend object.
     EffectManager *effectManager() const;
+#endif // QT_NO_PHONON_EFFECT
 
     /**
      * Creates a backend object of the desired class and with the desired parent. Extra arguments can be provided.
@@ -148,7 +152,9 @@ private:
     mutable QStringList m_supportedMimeTypes;
 
     DeviceManager *m_deviceManager;
+#ifndef QT_NO_PHONON_EFFECT
     EffectManager *m_effectManager;
+#endif // QT_NO_PHONON_EFFECT
 };
 
 } // namespace VLC
index 6939365..620133d 100644 (file)
@@ -18,6 +18,8 @@
     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include "effect.h"
 
 #include "effectmanager.h"
@@ -225,3 +227,5 @@ void Effect::setParameterValue(const EffectParameter &param, const QVariant &new
 } // Namespace Phonon::VLC
 
 #include "phonon-vlc/moc_effect.h"
+
+#endif // QT_NO_PHONON_EFFECT
\ No newline at end of file
index 74f3f02..60ff376 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef PHONON_VLC_EFFECT_H
 #define PHONON_VLC_EFFECT_H
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include "sinknode.h"
 #include "effectmanager.h"
 
@@ -77,4 +79,6 @@ private:
 }
 } // Namespace Phonon::VLC
 
+#endif // QT_NO_PHONON_EFFECT
+
 #endif // PHONON_VLC_EFFECT_H
index 94293bf..abea19a 100644 (file)
@@ -19,6 +19,8 @@
     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include "effectmanager.h"
 
 #include <vlc/vlc.h>
@@ -133,4 +135,7 @@ void EffectManager::updateEffects()
 
 } // namespace VLC
 } // namespace Phonon
+
 #include "phonon-vlc/moc_effectmanager.h"
+
+#endif // QT_NO_PHONON_EFFECT
index 5293cd4..60f15e6 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef Phonon_VLC_EFFECTMANAGER_H
 #define Phonon_VLC_EFFECTMANAGER_H
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include <QtCore/QObject>
 
 namespace Phonon {
@@ -116,4 +118,6 @@ private:
 } // namespace VLC
 } // namespace Phonon
 
+#endif // QT_NO_PHONON_EFFECT
+
 #endif // Phonon_VLC_EFFECTMANAGER_H
index dc68e72..3f562f4 100644 (file)
@@ -15,6 +15,8 @@
     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include <vlc/libvlc_version.h>
 #if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 2, 0, 0))
 
@@ -84,3 +86,5 @@ void EqualizerEffect::handleConnectToMediaObject(MediaObject *mediaObject)
 #include "phonon-vlc/moc_equalizereffect.h"
 
 #endif // LIBVLC_VERSION
+
+#endif // QT_NO_PHONON_EFFECT
\ No newline at end of file
index a1b050d..b6bd37b 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef PHONON_VLC_EQUALIZEREFFECT_H
 #define PHONON_VLC_EQUALIZEREFFECT_H
 
+#ifndef QT_NO_PHONON_EFFECT
+
 #include <QtCore/QObject>
 
 #include <phonon/effectinterface.h>
@@ -52,4 +54,6 @@ private:
 } // namespace VLC
 } // namespace Phonon
 
+#endif // QT_NO_PHONON_EFFECT
+
 #endif // PHONON_VLC_EQUALIZEREFFECT_H