1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-05 21:53:28 +01:00

Use the vlc engine on Windows

This commit is contained in:
David Sansome 2010-04-05 15:50:53 +00:00
parent f1f4584da0
commit 1c5b6c6b05
4 changed files with 19 additions and 36 deletions

View File

@ -7,16 +7,8 @@ if (CMAKE_FIND_ROOT_PATH)
# CMAKE_FIND_ROOT_PATH should get set by your cmake toolchain file # CMAKE_FIND_ROOT_PATH should get set by your cmake toolchain file
set(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include) set(QT_HEADERS_DIR ${CMAKE_FIND_ROOT_PATH}/include)
set(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib) set(QT_LIBRARY_DIR ${CMAKE_FIND_ROOT_PATH}/lib)
set(QT_PHONON_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/include/phonon)
endif (CMAKE_FIND_ROOT_PATH) endif (CMAKE_FIND_ROOT_PATH)
option(FORCE_PHONON "Use the Phonon audio backend even on Unix")
if (FORCE_PHONON OR WIN32)
set(USE_PHONON 1)
add_definitions(-DUSE_PHONON)
endif (FORCE_PHONON OR WIN32)
find_package(Qt4 REQUIRED) find_package(Qt4 REQUIRED)
set(QT_USE_QTOPENGL 1) set(QT_USE_QTOPENGL 1)
set(QT_USE_QTSQL 1) set(QT_USE_QTSQL 1)
@ -25,15 +17,16 @@ set(QT_USE_QTXML 1)
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
set(QT_USE_QTDBUS 1) set(QT_USE_QTDBUS 1)
endif(UNIX AND NOT APPLE) endif(UNIX AND NOT APPLE)
if(USE_PHONON)
set(QT_USE_PHONON 1)
endif(USE_PHONON)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost REQUIRED) find_package(Boost REQUIRED)
if(WIN32) if(WIN32)
find_library(TAGLIB_LIBRARIES tag) find_library(TAGLIB_LIBRARIES tag)
find_path(VLC_PLUGIN_INCLUDE_DIRS vlc_arrays.h
PATH_SUFFIXES vlc vlc/plugins)
find_library(VLC_PLUGIN_LIBRARIES vlccore)
find_library(LIBVLC_LIBRARIES vlc)
else(WIN32) else(WIN32)
pkg_check_modules(TAGLIB taglib) pkg_check_modules(TAGLIB taglib)
pkg_check_modules(LIBVLC libvlc) pkg_check_modules(LIBVLC libvlc)

View File

@ -12,6 +12,7 @@ set(CLEMENTINE-SOURCES
playlist.cpp playlist.cpp
playlistitem.cpp playlistitem.cpp
engines/enginebase.cpp engines/enginebase.cpp
engines/vlcengine.cpp
analyzers/baranalyzer.cpp analyzers/baranalyzer.cpp
analyzers/analyzerbase.cpp analyzers/analyzerbase.cpp
fht.cpp fht.cpp
@ -77,6 +78,7 @@ set(CLEMENTINE-MOC-HEADERS
librarybackend.h librarybackend.h
playlist.h playlist.h
engines/enginebase.h engines/enginebase.h
engines/vlcengine.h
sliderwidget.h sliderwidget.h
playlistview.h playlistview.h
backgroundthread.h backgroundthread.h
@ -193,15 +195,6 @@ foreach(QM-FILE ${CLEMENTINE-QM-FILES})
endforeach(QM-FILE) endforeach(QM-FILE)
file(APPEND ${CLEMENTINE-QM-RESOURCE} "</qresource></RCC>") file(APPEND ${CLEMENTINE-QM-RESOURCE} "</qresource></RCC>")
# Audio engine - phonon on windows, xine elsewhere
if(USE_PHONON)
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} engines/phononengine.cpp)
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} engines/phononengine.h)
else(USE_PHONON)
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} engines/vlcengine.cpp)
set(CLEMENTINE-MOC-HEADERS ${CLEMENTINE-MOC-HEADERS} engines/vlcengine.h)
endif(USE_PHONON)
# OSD and DBus. # OSD and DBus.
if(APPLE) if(APPLE)
set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm) set(CLEMENTINE-SOURCES ${CLEMENTINE-SOURCES} osd_mac.mm)

View File

@ -17,6 +17,7 @@
#include "player.h" #include "player.h"
#include "playlist.h" #include "playlist.h"
#include "lastfmservice.h" #include "lastfmservice.h"
#include "engines/vlcengine.h"
#ifdef Q_WS_X11 #ifdef Q_WS_X11
# include "mpris_player.h" # include "mpris_player.h"
@ -24,12 +25,6 @@
# include <QDBusConnection> # include <QDBusConnection>
#endif #endif
#ifdef USE_PHONON
# include "engines/phononengine.h"
#else
# include "engines/vlcengine.h"
#endif
#include <QtDebug> #include <QtDebug>
#include <QtConcurrentRun> #include <QtConcurrentRun>
@ -62,15 +57,9 @@ Player::Player(Playlist* playlist, LastFMService* lastfm, QObject* parent)
playlist_(playlist), playlist_(playlist),
lastfm_(lastfm), lastfm_(lastfm),
current_item_options_(PlaylistItem::Default), current_item_options_(PlaylistItem::Default),
engine_(NULL), engine_(new VlcEngine),
init_engine_watcher_(new QFutureWatcher<bool>(this)) init_engine_watcher_(new QFutureWatcher<bool>(this))
{ {
#ifdef USE_PHONON
engine_ = new PhononEngine;
#else
engine_ = new VlcEngine;
#endif
settings_.beginGroup("Player"); settings_.beginGroup("Player");
SetVolume(settings_.value("volume", 50).toInt()); SetVolume(settings_.value("volume", 50).toInt());

View File

@ -11,14 +11,22 @@ set(CLEMENTINE-SCOPE-SOURCES
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../src") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../src")
if (WIN32)
# This gets linked at runtime on unix
set(MAYBE_CLEMENTINE_LIB_LIBRARIES clementine_lib)
endif (WIN32)
add_library(clementine_scope SHARED add_library(clementine_scope SHARED
${CLEMENTINE-SCOPE-SOURCES} ${CLEMENTINE-SCOPE-SOURCES}
) )
target_link_libraries(clementine_scope target_link_libraries(clementine_scope
${VLC_PLUGIN_LIBRARIES} ${VLC_PLUGIN_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}
${MAYBE_CLEMENTINE_LIB_LIBRARIES}
) )
install(TARGETS clementine_scope if (NOT WIN32)
LIBRARY DESTINATION ${VLC_PLUGIN_LIBDIR}/vlc/clementine install(TARGETS clementine_scope
) LIBRARY DESTINATION ${VLC_PLUGIN_LIBDIR}/vlc/clementine
)
endif (NOT WIN32)