From f8808baa1d0e6ccfefe1d96cfc26683a4bdf8b2a Mon Sep 17 00:00:00 2001 From: David Sansome Date: Sun, 21 Feb 2010 21:55:03 +0000 Subject: [PATCH] Phonon on windows, xine on everything else --- src/player.cpp | 16 ++++++++++------ src/src.pro | 31 ++++++++++++++++++------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/player.cpp b/src/player.cpp index 29d353ce7..93a689822 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -1,9 +1,13 @@ #include "player.h" #include "playlist.h" -#include "xine-engine.h" -#include "phononengine.h" #include "lastfmservice.h" +#ifdef Q_OS_WIN32 +# include "phononengine.h" +#else +# include "xine-engine.h" +#endif + #include #include @@ -17,11 +21,11 @@ Player::Player(Playlist* playlist, LastFMService* lastfm, QObject* parent) engine_(NULL), init_engine_watcher_(new QFutureWatcher(this)) { -//#ifdef Q_OS_WIN32 +#ifdef Q_OS_WIN32 engine_ = new PhononEngine; -//#else -// engine_ = new XineEngine; -//#endif +#else + engine_ = new XineEngine; +#endif settings_.beginGroup("Player"); diff --git a/src/src.pro b/src/src.pro index aeca0da49..58ca00557 100644 --- a/src/src.pro +++ b/src/src.pro @@ -4,8 +4,7 @@ VERSION = 0.1 QT += sql \ network \ xml \ - opengl \ - phonon + opengl TARGET = clementine TEMPLATE = app SOURCES += main.cpp \ @@ -20,8 +19,6 @@ SOURCES += main.cpp \ analyzers/analyzerbase.cpp \ fht.cpp \ analyzers/blockanalyzer.cpp \ - xine-engine.cpp \ - xine-scope.c \ sliderwidget.cpp \ playlistview.cpp \ backgroundthread.cpp \ @@ -54,8 +51,7 @@ SOURCES += main.cpp \ librarydirectorymodel.cpp \ libraryconfigdialog.cpp \ lastfmconfigdialog.cpp \ - about.cpp \ - phononengine.cpp + about.cpp HEADERS += mainwindow.h \ player.h \ library.h \ @@ -68,8 +64,6 @@ HEADERS += mainwindow.h \ analyzers/analyzerbase.h \ fht.h \ analyzers/blockanalyzer.h \ - xine-engine.h \ - xine-scope.h \ sliderwidget.h \ playlistview.h \ backgroundthread.h \ @@ -109,8 +103,7 @@ HEADERS += mainwindow.h \ librarydirectorymodel.h \ libraryconfigdialog.h \ lastfmconfigdialog.h \ - about.h \ - phononengine.h + about.h FORMS += mainwindow.ui \ libraryconfig.ui \ fileview.ui \ @@ -128,6 +121,19 @@ OTHER_FILES += ../data/schema.sql \ ../data/mainwindow.css RC_FILE += ../dist/windres.rc +# Xine on unix, phonon on windows +win32|fedora-win32-cross { + QT += phonon + SOURCES += phononengine.cpp + HEADERS += phononengine.h +} +!win32:!fedora-win32-cross { + SOURCES += xine-engine.cpp \ + xine-scope.c + HEADERS += xine-engine.h \ + xine-scope.h +} + # Last.fm LIBS += -llastfm @@ -153,7 +159,6 @@ LIBS += -llastfm } } win32|fedora-win32-cross:LIBS += -ltag \ - -lxine \ -lpthreadGC2 # OSD @@ -187,8 +192,8 @@ unix:!fedora-win32-cross:SOURCES += ../3rdparty/qtsingleapplication/qtlockedfile win32|fedora-win32-cross:SOURCES += ../3rdparty/qtsingleapplication/qtlockedfile_win.cpp # Hide the console on windows -#win32|fedora-win32-cross:LIBS += -Wl,-subsystem,windows -CONFIG += console +win32|fedora-win32-cross:LIBS += -Wl,-subsystem,windows +#CONFIG += console # Installs target.path = $${install_prefix}/bin/