mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Fix build without gstreamer.
Fixes issue #217 Thanks to christoph.gysin
This commit is contained in:
parent
baf59f4c8d
commit
4948050327
@ -35,8 +35,8 @@ else(WIN32)
|
||||
pkg_check_modules(TAGLIB REQUIRED taglib>=1.6)
|
||||
pkg_check_modules(GSTREAMER gstreamer-0.10)
|
||||
pkg_check_modules(GSTREAMER_BASE gstreamer-base-0.10)
|
||||
pkg_check_modules(VLC libvlc)
|
||||
pkg_check_modules(XINE libxine)
|
||||
pkg_check_modules(LIBVLC libvlc)
|
||||
pkg_check_modules(LIBXINE libxine)
|
||||
endif(WIN32)
|
||||
|
||||
find_library(LASTFM_LIBRARY_DIRS lastfm)
|
||||
|
@ -164,8 +164,8 @@ set(XINE_ENGINE_MOC
|
||||
# try to add engines
|
||||
include(AddEngine.cmake)
|
||||
add_engine(gst "${GST_ENGINE_LIB}" "${GST_ENGINE_SRC}" "${GST_ENGINE_MOC}" ON)
|
||||
add_engine(vlc VLC engines/vlcengine.cpp engines/vlcengine.h OFF)
|
||||
add_engine(xine XINE "${XINE_ENGINE_SRC}" "${XINE_ENGINE_MOC}" OFF)
|
||||
add_engine(vlc LIBVLC engines/vlcengine.cpp engines/vlcengine.h OFF)
|
||||
add_engine(xine LIBXINE "${XINE_ENGINE_SRC}" "${XINE_ENGINE_MOC}" OFF)
|
||||
add_engine(qt-phonon QT_PHONON engines/phononengine.cpp engines/phononengine.h OFF)
|
||||
print_engines()
|
||||
|
||||
|
@ -60,7 +60,15 @@ CommandlineOptions::CommandlineOptions(int argc, char** argv)
|
||||
seek_by_(0),
|
||||
play_track_at_(-1),
|
||||
show_osd_(false),
|
||||
#ifdef HAVE_GSTREAMER
|
||||
engine_(Engine::gstreamer)
|
||||
#elif defined(HAVE_LIBVLC)
|
||||
engine_(Engine::vlc)
|
||||
#elif defined(HAVE_LIBXINE)
|
||||
engine_(Engine::xine)
|
||||
#elif defined(HAVE_QT_PHONON)
|
||||
engine_(Engine::qt_phonon)
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
@ -173,9 +181,21 @@ bool CommandlineOptions::Parse() {
|
||||
engine_ = Engine::qt_phonon;
|
||||
else
|
||||
{
|
||||
qFatal("%s %s",
|
||||
qFatal("%s%s",
|
||||
tr("Unknown audio engine \"%1\". Choices are:").arg(engine).toAscii().data(),
|
||||
"gst vlc xine qt-phonon");
|
||||
#ifdef HAVE_GSTREAMER
|
||||
" gst"
|
||||
#endif
|
||||
#ifdef HAVE_LIBVLC
|
||||
" vlc"
|
||||
#endif
|
||||
#ifdef HAVE_LIBXINE
|
||||
" xine"
|
||||
#endif
|
||||
#ifdef HAVE_QT_PHONON
|
||||
" qt-phonon"
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -38,7 +38,9 @@
|
||||
#include "xspfparser.h"
|
||||
#include "playlistsequence.h"
|
||||
#include "groupbydialog.h"
|
||||
#include "engines/gstengine.h"
|
||||
#ifdef HAVE_GSTREAMER
|
||||
# include "engines/gstengine.h"
|
||||
#endif
|
||||
#include "equalizer.h"
|
||||
#include "commandlineoptions.h"
|
||||
#include "mac_startup.h"
|
||||
@ -115,8 +117,10 @@ MainWindow::MainWindow(QNetworkAccessManager* network, Engine::Type engine, QWid
|
||||
// Start initialising the player
|
||||
player_->Init();
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
if (GstEngine* engine = qobject_cast<GstEngine*>(player_->GetEngine()))
|
||||
settings_dialog_->SetGstEngine(engine);
|
||||
#endif
|
||||
|
||||
// Models
|
||||
library_sort_model_->setSourceModel(library_);
|
||||
|
@ -22,10 +22,10 @@
|
||||
#ifdef HAVE_GSTREAMER
|
||||
# include "engines/gstengine.h"
|
||||
#endif
|
||||
#ifdef HAVE_VLC
|
||||
#ifdef HAVE_LIBVLC
|
||||
# include "engines/vlcengine.h"
|
||||
#endif
|
||||
#ifdef HAVE_XINE
|
||||
#ifdef HAVE_LIBXINE
|
||||
# include "engines/xine-engine.h"
|
||||
#endif
|
||||
#ifdef HAVE_QT_PHONON
|
||||
@ -101,12 +101,12 @@ EngineBase* Player::createEngine(Engine::Type engine) {
|
||||
return new GstEngine();
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_VLC
|
||||
#ifdef HAVE_LIBVLC
|
||||
case Engine::vlc:
|
||||
return new VlcEngine();
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_XINE
|
||||
#ifdef HAVE_LIBXINE
|
||||
case Engine::xine:
|
||||
return new XineEngine();
|
||||
break;
|
||||
|
@ -19,7 +19,9 @@
|
||||
#include "osd.h"
|
||||
#include "osdpretty.h"
|
||||
#include "mainwindow.h"
|
||||
#include "engines/gstengine.h"
|
||||
#ifdef HAVE_GSTREAMER
|
||||
# include "engines/gstengine.h"
|
||||
#endif
|
||||
|
||||
#include <QSettings>
|
||||
#include <QColorDialog>
|
||||
@ -40,7 +42,9 @@ SettingsDialog::SettingsDialog(QWidget* parent)
|
||||
connect(ui_.fading_cross, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged()));
|
||||
connect(ui_.fading_out, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged()));
|
||||
connect(ui_.fading_auto, SIGNAL(toggled(bool)), SLOT(FadingOptionsChanged()));
|
||||
#ifdef HAVE_GSTREAMER
|
||||
connect(ui_.gst_plugin, SIGNAL(currentIndexChanged(int)), SLOT(GstPluginChanged(int)));
|
||||
#endif
|
||||
|
||||
// Behaviour
|
||||
connect(ui_.b_show_tray_icon_, SIGNAL(toggled(bool)), SLOT(ShowTrayIconToggled(bool)));
|
||||
@ -122,10 +126,12 @@ void SettingsDialog::accept() {
|
||||
s.setValue("AutoCrossfadeEnabled", ui_.fading_auto->isChecked());
|
||||
s.endGroup();
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
s.beginGroup(GstEngine::kSettingsGroup);
|
||||
s.setValue("sink", ui_.gst_plugin->itemData(ui_.gst_plugin->currentIndex()).toString());
|
||||
s.setValue("device", ui_.gst_device->text());
|
||||
s.endGroup();
|
||||
#endif
|
||||
|
||||
// Notifications
|
||||
OSD::Behaviour osd_behaviour;
|
||||
@ -181,6 +187,7 @@ void SettingsDialog::showEvent(QShowEvent*) {
|
||||
ui_.fading_duration->setValue(s.value("FadeoutDuration", 2000).toInt());
|
||||
s.endGroup();
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
s.beginGroup(GstEngine::kSettingsGroup);
|
||||
QString sink = s.value("sink", GstEngine::kAutoSink).toString();
|
||||
ui_.gst_plugin->setCurrentIndex(0);
|
||||
@ -192,6 +199,7 @@ void SettingsDialog::showEvent(QShowEvent*) {
|
||||
}
|
||||
ui_.gst_device->setText(s.value("device").toString());
|
||||
s.endGroup();
|
||||
#endif
|
||||
|
||||
// Notifications
|
||||
s.beginGroup(OSD::kSettingsGroup);
|
||||
@ -308,6 +316,7 @@ void SettingsDialog::ShowTrayIconToggled(bool on) {
|
||||
ui_.b_remember_->setChecked(true);
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
void SettingsDialog::SetGstEngine(const GstEngine *engine) {
|
||||
GstEngine::PluginDetailsList list = engine->GetOutputsList();
|
||||
|
||||
@ -329,6 +338,7 @@ void SettingsDialog::GstPluginChanged(int index) {
|
||||
ui_.gst_device->setEnabled(enabled);
|
||||
ui_.gst_device_label->setEnabled(enabled);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SettingsDialog::FadingOptionsChanged() {
|
||||
ui_.fading_options->setEnabled(
|
||||
|
@ -23,7 +23,9 @@
|
||||
|
||||
class LibraryDirectoryModel;
|
||||
class OSDPretty;
|
||||
#ifdef HAVE_GSTREAMER
|
||||
class GstEngine;
|
||||
#endif
|
||||
|
||||
class SettingsDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
@ -33,7 +35,9 @@ class SettingsDialog : public QDialog {
|
||||
~SettingsDialog();
|
||||
|
||||
void SetLibraryDirectoryModel(LibraryDirectoryModel* model);
|
||||
#ifdef HAVE_GSTREAMER
|
||||
void SetGstEngine(const GstEngine* engine);
|
||||
#endif
|
||||
|
||||
// QDialog
|
||||
void accept();
|
||||
@ -54,7 +58,9 @@ class SettingsDialog : public QDialog {
|
||||
|
||||
void UpdatePopupVisible();
|
||||
void ShowTrayIconToggled(bool on);
|
||||
#ifdef HAVE_GSTREAMER
|
||||
void GstPluginChanged(int index);
|
||||
#endif
|
||||
void FadingOptionsChanged();
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user