mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
fix VLC Phonon backend build withouts effects support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
89f5a60815
commit
8751b27a01
10 changed files with 55 additions and 0 deletions
|
@ -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()";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ¶m, const QVariant &new
|
|||
} // Namespace Phonon::VLC
|
||||
|
||||
#include "phonon-vlc/moc_effect.h"
|
||||
|
||||
#endif // QT_NO_PHONON_EFFECT
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue