Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc78c3f3cb | ||
|
|
60b55b6d7d | ||
|
|
d45f8672cd | ||
|
|
8df599ffe5 | ||
|
|
f9c2801db1 | ||
|
|
e5774ffcdc | ||
|
|
aa4d8620f7 | ||
|
|
7b05bfd8b8 | ||
|
|
5065828515 | ||
|
|
eab25bbd17 | ||
|
|
6b1ae5d5ac | ||
|
|
e84681f93a | ||
|
|
7356344136 | ||
|
|
4746922e9f | ||
|
|
54c2ad13a9 |
7
3rdparty/qocoa/CMakeLists.txt
vendored
7
3rdparty/qocoa/CMakeLists.txt
vendored
@@ -1,3 +1,6 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(SOURCES)
|
||||
|
||||
set(HEADERS
|
||||
@@ -26,7 +29,5 @@ else()
|
||||
qt5_add_resources(RESOURCES_SOURCES ${RESOURCES})
|
||||
endif()
|
||||
|
||||
add_library(Qocoa STATIC
|
||||
${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES}
|
||||
)
|
||||
add_library(Qocoa STATIC ${SOURCES} ${MOC_SOURCES} ${RESOURCES_SOURCES})
|
||||
target_link_libraries(Qocoa ${QT_LIBRARIES})
|
||||
|
||||
3
3rdparty/qtsingleapplication/CMakeLists.txt
vendored
3
3rdparty/qtsingleapplication/CMakeLists.txt
vendored
@@ -1,4 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(SINGLEAPP-SOURCES
|
||||
qtlocalpeer.cpp
|
||||
@@ -25,4 +26,4 @@ ADD_LIBRARY(qtsingleapplication STATIC
|
||||
${SINGLEAPP-SOURCES-MOC}
|
||||
)
|
||||
|
||||
QT5_USE_MODULES(qtsingleapplication Core Widgets Network)
|
||||
target_link_libraries(qtsingleapplication Qt5::Core Qt5::Widgets Qt5::Network)
|
||||
|
||||
1
3rdparty/qtwin/CMakeLists.txt
vendored
1
3rdparty/qtwin/CMakeLists.txt
vendored
@@ -1,4 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(QTWIN-SOURCES
|
||||
qtwin.cpp
|
||||
|
||||
5
3rdparty/qxt/CMakeLists.txt
vendored
5
3rdparty/qxt/CMakeLists.txt
vendored
@@ -1,4 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(QXT-SOURCES
|
||||
qxtglobal.cpp
|
||||
@@ -29,7 +30,7 @@ ADD_LIBRARY(qxt STATIC
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
QT5_USE_MODULES(qxt Core Widgets)
|
||||
target_link_libraries(qxt Qt5::Core Qt5::Widgets)
|
||||
else(WIN32)
|
||||
QT5_USE_MODULES(qxt Core Widgets X11Extras)
|
||||
target_link_libraries(qxt Qt5::Core Qt5::Widgets Qt5::X11Extras)
|
||||
endif(WIN32)
|
||||
|
||||
1
3rdparty/sha2/CMakeLists.txt
vendored
1
3rdparty/sha2/CMakeLists.txt
vendored
@@ -1,3 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_library(sha2 STATIC sha2.cpp)
|
||||
|
||||
2
3rdparty/taglib/CMakeLists.txt
vendored
2
3rdparty/taglib/CMakeLists.txt
vendored
@@ -1,3 +1,5 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-delete-non-virtual-dtor")
|
||||
|
||||
set(TAGLIB_SOVERSION_CURRENT 17)
|
||||
|
||||
1
3rdparty/utf8-cpp/CMakeLists.txt
vendored
1
3rdparty/utf8-cpp/CMakeLists.txt
vendored
@@ -1 +1,2 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
296
CMakeLists.txt
296
CMakeLists.txt
@@ -27,11 +27,22 @@ include(cmake/C++11Compat.cmake)
|
||||
include(cmake/Version.cmake)
|
||||
include(cmake/Summary.cmake)
|
||||
include(cmake/OptionalSource.cmake)
|
||||
include(cmake/ParseArguments.cmake)
|
||||
include(cmake/Rpm.cmake)
|
||||
|
||||
#set(CMAKE_BUILD_TYPE Debug)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(LINUX 1)
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(FREEBSD 1)
|
||||
endif()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
set(OPENBSD 1)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
#set(CMAKE_BUILD_TYPE Debug)
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||
add_definitions(-DNDEBUG)
|
||||
@@ -42,11 +53,11 @@ endif(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
|
||||
set(CMAKE_COMPILER_IS_CLANGXX 1)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++")
|
||||
endif ()
|
||||
endif(APPLE)
|
||||
|
||||
find_program(CCACHE_EXECUTABLE NAMES ccache)
|
||||
if (CCACHE_EXECUTABLE)
|
||||
@@ -57,10 +68,6 @@ endif ()
|
||||
find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert lconvert-qt5 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH)
|
||||
find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert lconvert-qt5)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
set(LINUX 1)
|
||||
endif (UNIX AND NOT APPLE)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GLIB REQUIRED glib-2.0)
|
||||
pkg_check_modules(GIO REQUIRED gio-2.0)
|
||||
@@ -72,12 +79,19 @@ find_package(Protobuf REQUIRED)
|
||||
find_library(PROTOBUF_STATIC_LIBRARY libprotobuf.a libprotobuf)
|
||||
if(LINUX)
|
||||
find_package(ALSA REQUIRED)
|
||||
find_package(DBus REQUIRED)
|
||||
else(LINUX)
|
||||
find_package(ALSA)
|
||||
find_package(DBus)
|
||||
endif(LINUX)
|
||||
if(ALSA_FOUND)
|
||||
set(HAVE_ALSA ON)
|
||||
endif()
|
||||
find_package(X11)
|
||||
pkg_check_modules(GSTREAMER gstreamer-1.0)
|
||||
pkg_check_modules(GSTREAMER_BASE gstreamer-base-1.0)
|
||||
pkg_check_modules(GSTREAMER_APP gstreamer-app-1.0)
|
||||
pkg_check_modules(GSTREAMER_AUDIO gstreamer-audio-1.0)
|
||||
pkg_check_modules(GSTREAMER_APP gstreamer-app-1.0)
|
||||
pkg_check_modules(GSTREAMER_TAG gstreamer-tag-1.0)
|
||||
pkg_check_modules(GSTREAMER_PBUTILS gstreamer-pbutils-1.0)
|
||||
pkg_check_modules(LIBXINE libxine)
|
||||
@@ -95,9 +109,9 @@ pkg_check_modules(IMOBILEDEVICE libimobiledevice-1.0)
|
||||
pkg_check_modules(USBMUXD libusbmuxd)
|
||||
pkg_check_modules(PLIST libplist)
|
||||
|
||||
if (WIN32)
|
||||
if(WIN32)
|
||||
find_package(ZLIB REQUIRED)
|
||||
endif (WIN32)
|
||||
endif(WIN32)
|
||||
|
||||
# QT
|
||||
set(QT_MIN_VERSION 5.6.0)
|
||||
@@ -105,6 +119,10 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core OpenGL Sql Network X
|
||||
if(X11_FOUND)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
||||
endif()
|
||||
if(DBUS_FOUND)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus)
|
||||
get_target_property(QT_DBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp LOCATION)
|
||||
endif()
|
||||
if(NOT APPLE)
|
||||
find_package(Qt5 COMPONENTS WebKitWidgets)
|
||||
endif(NOT APPLE)
|
||||
@@ -114,6 +132,19 @@ if(APPLE)
|
||||
endif(NOT QT_MAC_USE_COCOA)
|
||||
endif(APPLE)
|
||||
|
||||
if(UNIX AND X11_FOUND AND DBUS_FOUND)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql Qt5::OpenGL Qt5::Xml Qt5::X11Extras Qt5::DBus)
|
||||
elseif(UNIX AND X11_FOUND)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql Qt5::OpenGL Qt5::Xml Qt5::X11Extras)
|
||||
else()
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql Qt5::OpenGL Qt5::Xml)
|
||||
endif()
|
||||
|
||||
# Don't try to use webkit if their include directories couldn't be found.
|
||||
if (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
||||
set (QT_USE_QTWEBKIT 0)
|
||||
endif (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
||||
|
||||
# TAGLIB
|
||||
pkg_check_modules(TAGLIB taglib)
|
||||
# Only use system taglib if it's greater than 1.11.1 because of audio file detection by content.
|
||||
@@ -149,135 +180,6 @@ endif()
|
||||
# CHROMAPRINT
|
||||
CHECK_INCLUDE_FILES(chromaprint.h CHROMAPRINT_H)
|
||||
|
||||
if (APPLE)
|
||||
find_library(SPARKLE Sparkle)
|
||||
add_subdirectory(3rdparty/SPMediaKeyTap)
|
||||
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
||||
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
||||
endif (APPLE)
|
||||
|
||||
# Set up definitions and paths
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
link_directories(${TAGLIB_LIBRARY_DIRS})
|
||||
link_directories(${GSTREAMER_LIBRARY_DIRS})
|
||||
|
||||
# Don't try to use webkit if their include directories couldn't be found.
|
||||
if (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
||||
set (QT_USE_QTWEBKIT 0)
|
||||
endif (NOT QT_QTWEBKIT_INCLUDE_DIR)
|
||||
|
||||
include_directories(${GLIB_INCLUDE_DIRS})
|
||||
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
include_directories(${LIBXML_INCLUDE_DIRS})
|
||||
include_directories(${TAGLIB_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_APP_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_AUDIO_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_BASE_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_TAG_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_PBUTILS_INCLUDE_DIRS})
|
||||
|
||||
if (WIN32)
|
||||
# RC compiler
|
||||
string(REPLACE "gcc" "windres" CMAKE_RC_COMPILER_INIT ${CMAKE_C_COMPILER})
|
||||
enable_language(RC)
|
||||
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE> -I ${CMAKE_SOURCE_DIR}/dist/windows")
|
||||
endif(WIN32)
|
||||
|
||||
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS)
|
||||
|
||||
# Optional bits
|
||||
if(WIN32)
|
||||
option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" OFF)
|
||||
endif(WIN32)
|
||||
|
||||
optional_component(GSTREAMER ON "Engine: GStreamer backend"
|
||||
DEPENDS "gstreamer-1.0" GSTREAMER_FOUND
|
||||
DEPENDS "gstreamer-base-1.0" GSTREAMER_BASE_FOUND
|
||||
DEPENDS "gstreamer-app-1.0" GSTREAMER_APP_FOUND
|
||||
DEPENDS "gstreamer-audio-1.0" GSTREAMER_AUDIO_FOUND
|
||||
DEPENDS "gstreamer-tag-1.0" GSTREAMER_TAG_FOUND
|
||||
DEPENDS "gstreamer-pbutils-1.0" GSTREAMER_PBUTILS_FOUND
|
||||
)
|
||||
|
||||
optional_component(XINE OFF "Engine: Xine backend"
|
||||
DEPENDS "libxine" LIBXINE_FOUND
|
||||
)
|
||||
|
||||
optional_component(VLC OFF "Engine: VLC backend"
|
||||
DEPENDS "libvlc" LIBVLC_FOUND
|
||||
)
|
||||
|
||||
optional_component(PHONON OFF "Engine: Phonon backend"
|
||||
DEPENDS "phonon4qt5" PHONON4QT5_FOUND
|
||||
)
|
||||
|
||||
optional_component(AUDIOCD ON "Devices: Audio CD support"
|
||||
DEPENDS "libcdio" CDIO_FOUND
|
||||
)
|
||||
|
||||
optional_component(LIBGPOD ON "Devices: iPod classic support"
|
||||
DEPENDS "libgpod" LIBGPOD_FOUND
|
||||
)
|
||||
|
||||
optional_component(GIO ON "Devices: GIO device backend"
|
||||
DEPENDS "libgio" GIO_FOUND
|
||||
DEPENDS "Linux or Windows" "NOT APPLE"
|
||||
)
|
||||
|
||||
optional_component(IMOBILEDEVICE ON "Devices: iPod Touch, iPhone, iPad support"
|
||||
DEPENDS "libimobiledevice" IMOBILEDEVICE_FOUND
|
||||
DEPENDS "libplist" PLIST_FOUND
|
||||
DEPENDS "libusbmuxd" USBMUXD_FOUND
|
||||
DEPENDS "iPod classic support" HAVE_LIBGPOD
|
||||
)
|
||||
|
||||
optional_component(LIBMTP ON "Devices: MTP support"
|
||||
DEPENDS "libmtp" LIBMTP_FOUND
|
||||
)
|
||||
|
||||
optional_component(LIBLASTFM ON "Last.fm support"
|
||||
DEPENDS "liblastfm" LASTFM5_LIBRARIES LASTFM5_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
optional_component(DBUS ON "D-Bus support"
|
||||
DEPENDS "Linux" LINUX
|
||||
)
|
||||
|
||||
optional_component(DEVICEKIT ON "Devices: DeviceKit backend"
|
||||
DEPENDS "D-Bus support" HAVE_DBUS
|
||||
)
|
||||
|
||||
optional_component(UDISKS2 ON "Devices: UDisks2 backend"
|
||||
DEPENDS "D-Bus support" HAVE_DBUS
|
||||
)
|
||||
|
||||
optional_component(SPARKLE ON "Sparkle integration"
|
||||
DEPENDS "Mac OS X" APPLE
|
||||
DEPENDS "Sparkle" SPARKLE
|
||||
)
|
||||
|
||||
optional_component(LIBPULSE ON "Pulse audio integration"
|
||||
DEPENDS "libpulse" LIBPULSE_FOUND
|
||||
)
|
||||
|
||||
if (HAVE_DBUS)
|
||||
find_package(Qt5 COMPONENTS DBus)
|
||||
get_target_property(QT_DBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp LOCATION)
|
||||
endif ()
|
||||
|
||||
# We can include the Qt definitions now
|
||||
#include(${QT_USE_FILE})
|
||||
if(WIN32)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::OpenGL Qt5::Sql Qt5::Network Qt5::Xml Qt5::Widgets Qt5::Concurrent)
|
||||
else(WIN32)
|
||||
set(QT_LIBRARIES Qt5::Core Qt5::OpenGL Qt5::Sql Qt5::Network Qt5::Xml Qt5::Widgets Qt5::Concurrent Qt5::X11Extras Qt5::DBus)
|
||||
endif(WIN32)
|
||||
|
||||
# Remove GLU and GL from the link line - they're not really required and don't exist on my mingw toolchain
|
||||
list(REMOVE_ITEM QT_LIBRARIES "-lGLU -lGL")
|
||||
|
||||
# Use system sha2 if it's available
|
||||
find_path(SHA2_INCLUDE_DIRS sha2.h)
|
||||
find_library(SHA2_LIBRARIES sha2)
|
||||
@@ -326,17 +228,124 @@ else (USE_SYSTEM_QXT)
|
||||
endif (USE_SYSTEM_QXT)
|
||||
|
||||
# Qocoa
|
||||
set(QOCOA_LIBRARIES Qocoa)
|
||||
add_subdirectory(3rdparty/qocoa)
|
||||
|
||||
# Windows
|
||||
if (WIN32)
|
||||
add_subdirectory(3rdparty/qtwin)
|
||||
endif (WIN32)
|
||||
|
||||
if (APPLE)
|
||||
find_library(SPARKLE Sparkle)
|
||||
add_subdirectory(3rdparty/SPMediaKeyTap)
|
||||
set(SPMEDIAKEYTAP_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SPMediaKeyTap)
|
||||
set(SPMEDIAKEYTAP_LIBRARIES SPMediaKeyTap)
|
||||
endif (APPLE)
|
||||
|
||||
if (WIN32)
|
||||
# RC compiler
|
||||
string(REPLACE "gcc" "windres" CMAKE_RC_COMPILER_INIT ${CMAKE_C_COMPILER})
|
||||
enable_language(RC)
|
||||
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -o <OBJECT> <SOURCE> -I ${CMAKE_SOURCE_DIR}/dist/windows")
|
||||
endif(WIN32)
|
||||
|
||||
# Optional bits
|
||||
if(WIN32)
|
||||
option(ENABLE_WIN32_CONSOLE "Show the windows console even outside Debug mode" OFF)
|
||||
endif(WIN32)
|
||||
|
||||
optional_component(DBUS ON "D-Bus support"
|
||||
DEPENDS "D-Bus" DBUS_FOUND
|
||||
)
|
||||
|
||||
optional_component(GSTREAMER ON "Engine: GStreamer backend"
|
||||
DEPENDS "gstreamer-1.0" GSTREAMER_FOUND
|
||||
DEPENDS "gstreamer-base-1.0" GSTREAMER_BASE_FOUND
|
||||
DEPENDS "gstreamer-app-1.0" GSTREAMER_APP_FOUND
|
||||
DEPENDS "gstreamer-audio-1.0" GSTREAMER_AUDIO_FOUND
|
||||
DEPENDS "gstreamer-tag-1.0" GSTREAMER_TAG_FOUND
|
||||
DEPENDS "gstreamer-pbutils-1.0" GSTREAMER_PBUTILS_FOUND
|
||||
)
|
||||
|
||||
optional_component(XINE OFF "Engine: Xine backend"
|
||||
DEPENDS "libxine" LIBXINE_FOUND
|
||||
)
|
||||
|
||||
optional_component(VLC OFF "Engine: VLC backend"
|
||||
DEPENDS "libvlc" LIBVLC_FOUND
|
||||
)
|
||||
|
||||
optional_component(PHONON OFF "Engine: Phonon backend"
|
||||
DEPENDS "phonon4qt5" PHONON_FOUND
|
||||
)
|
||||
|
||||
optional_component(AUDIOCD ON "Devices: Audio CD support"
|
||||
DEPENDS "libcdio" CDIO_FOUND
|
||||
)
|
||||
|
||||
optional_component(LIBGPOD ON "Devices: iPod classic support"
|
||||
DEPENDS "libgpod" LIBGPOD_FOUND
|
||||
)
|
||||
|
||||
optional_component(GIO ON "Devices: GIO device backend"
|
||||
DEPENDS "libgio" GIO_FOUND
|
||||
DEPENDS "Unix or Windows" "NOT APPLE"
|
||||
)
|
||||
|
||||
optional_component(IMOBILEDEVICE ON "Devices: iPod Touch, iPhone, iPad support"
|
||||
DEPENDS "libimobiledevice" IMOBILEDEVICE_FOUND
|
||||
DEPENDS "libplist" PLIST_FOUND
|
||||
DEPENDS "libusbmuxd" USBMUXD_FOUND
|
||||
DEPENDS "iPod classic support" HAVE_LIBGPOD
|
||||
)
|
||||
|
||||
optional_component(LIBMTP ON "Devices: MTP support"
|
||||
DEPENDS "libmtp" LIBMTP_FOUND
|
||||
)
|
||||
|
||||
optional_component(LIBLASTFM ON "Last.fm album cover provider"
|
||||
DEPENDS "liblastfm" LASTFM5_LIBRARIES LASTFM5_INCLUDE_DIRS
|
||||
)
|
||||
|
||||
optional_component(DEVICEKIT ON "Devices: DeviceKit backend"
|
||||
DEPENDS "D-Bus support" DBUS_FOUND
|
||||
)
|
||||
|
||||
optional_component(UDISKS2 ON "Devices: UDisks2 backend"
|
||||
DEPENDS "D-Bus support" DBUS_FOUND
|
||||
)
|
||||
|
||||
optional_component(LIBPULSE ON "Pulse audio integration"
|
||||
DEPENDS "libpulse" LIBPULSE_FOUND
|
||||
)
|
||||
|
||||
optional_component(SPARKLE ON "Sparkle integration"
|
||||
DEPENDS "Mac OS X" APPLE
|
||||
DEPENDS "Sparkle" SPARKLE
|
||||
)
|
||||
|
||||
#if(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
||||
#add_subdirectory(ext/gstafc)
|
||||
#endif(IMOBILEDEVICE_FOUND AND PLIST_FOUND)
|
||||
|
||||
# Set up definitions and paths
|
||||
|
||||
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
|
||||
add_definitions(-DQT_NO_CAST_TO_ASCII -DQT_STRICT_ITERATORS)
|
||||
|
||||
include_directories(${GLIB_INCLUDE_DIRS})
|
||||
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
|
||||
|
||||
if(ENABLE_IMOBILEDEVICE AND IMOBILEDEVICE_VERSION VERSION_GREATER 1.1.1)
|
||||
set(IMOBILEDEVICE_USES_UDIDS ON)
|
||||
endif()
|
||||
|
||||
# Subdirectories
|
||||
add_subdirectory(src)
|
||||
if (WIN32)
|
||||
add_subdirectory(3rdparty/qtwin)
|
||||
endif (WIN32)
|
||||
add_subdirectory(dist)
|
||||
add_subdirectory(ext/libstrawberry-common)
|
||||
add_subdirectory(ext/libstrawberry-tagreader)
|
||||
@@ -353,3 +362,6 @@ add_custom_target(uninstall
|
||||
|
||||
# Show a summary of what we have enabled
|
||||
summary_show()
|
||||
if(NOT HAVE_GSTREAMER AND NOT HAVE_XINE AND NOT HAVE_VLC AND NOT HAVE_PHONON)
|
||||
message(FATAL_ERROR "You need to enable either GStreamer, Xine, VLC or Phonon to compile!")
|
||||
endif()
|
||||
|
||||
12
Changelog
12
Changelog
@@ -2,6 +2,18 @@ Strawberry Music Player
|
||||
=======================
|
||||
ChangeLog
|
||||
|
||||
Version 0.1.6:
|
||||
* Fix crash on exit caused by NVIDIA driver
|
||||
* Fix PulseAudio device selection
|
||||
* Improvements to device selection
|
||||
|
||||
Version 0.1.5:
|
||||
* Makefile fixes for building
|
||||
|
||||
Version 0.1.4:
|
||||
* Fixed compliation with clang compiler
|
||||
* This release is mainly to get it working on openbsd and freebsd.
|
||||
|
||||
Version 0.1.3:
|
||||
* Audio file detection by content
|
||||
* Added builtin taglib to 3rdparty to support detecting audio by content instead of just file extension
|
||||
|
||||
@@ -19,7 +19,7 @@ It's written in C++ and Qt5. The name is inspired by the band Strawbs.
|
||||
|
||||
You can obtain and view the sourcecode on github at: https://github.com/jonaski/strawberry
|
||||
|
||||
It has so far been tested on Linux and cross compiled for Windows. I have not had a chance to test it on Mac OS X since I don't have a mac.
|
||||
It has so far been tested on Linux, OpenBSD and cross compiled for Windows. I have not had a chance to test it on Mac OS X since I don't have a mac.
|
||||
|
||||
|
||||
Requirements
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
# Strawberry Music Player
|
||||
# Copyright 2013, Jonas Kvinge <jonas@strawbs.net>
|
||||
#
|
||||
# Strawberry is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Strawberry is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
macro(add_engine engine_lower engine_upper lib_list src_list inc_list enabled)
|
||||
|
||||
#message(STATUS "ADD ENGINE: ${engine_lower} ${engine_upper} ${lib_list} ${src_list} ${inc_list} ${enabled}")
|
||||
|
||||
#set(ENGINE_LIBRARIES "")
|
||||
|
||||
# recreate list
|
||||
set(lib_list ${lib_list})
|
||||
#list(GET lib_list 0 name)
|
||||
|
||||
# add a user selectable build option
|
||||
option(ENGINE_${engine_upper}_ENABLED "enable engine ${engine_upper}" ${enabled})
|
||||
|
||||
# check if engine is enabled and needed librares are available
|
||||
if(ENGINE_${engine_upper}_ENABLED)
|
||||
|
||||
# check for all needed libraries
|
||||
foreach(lib ${lib_list})
|
||||
#pkg_check_modules(${lib} ${lib})
|
||||
if (NOT ${lib}_FOUND MATCHES 1)
|
||||
set(ENGINE_${engine_upper}_LIB_MISSING TRUE)
|
||||
endif(NOT ${lib}_FOUND MATCHES 1)
|
||||
endforeach(lib ${lib_list})
|
||||
|
||||
if(ENGINE_${engine_upper}_LIB_MISSING)
|
||||
set(ENGINES_MISSING "${ENGINES_MISSING} ${engine_lower}")
|
||||
#set("HAVE_${engine_upper}" 0 CACHE INTERNAL ${engine_upper})
|
||||
set("HAVE_${engine_upper}" OFF)
|
||||
else(ENGINE_${engine_upper}_LIB_MISSING)
|
||||
# add define -DHAVE_<engine> so we can clutter the code with #ifdefs
|
||||
#set("HAVE_${engine_upper}" 1 CACHE INTERNAL ${engine_upper})
|
||||
set("HAVE_${engine_upper}" ON)
|
||||
# add sources and headers
|
||||
list(APPEND SOURCES ${src_list})
|
||||
list(APPEND HEADERS ${inc_list})
|
||||
# add libraries to link against
|
||||
foreach(lib ${lib_list})
|
||||
#set(ENGINE_LIBRARIES ${ENGINE_LIBRARIES} ${${lib}_LIBRARIES} CACHE INTERNAL libraries)
|
||||
set(ENGINE_LIBRARIES ${ENGINE_LIBRARIES} ${${lib}_LIBRARIES})
|
||||
endforeach(lib ${lib_list})
|
||||
# add to list of enabled engines
|
||||
set(ENGINES_ENABLED "${ENGINES_ENABLED} ${engine_lower}")
|
||||
endif(ENGINE_${engine_upper}_LIB_MISSING)
|
||||
else(ENGINE_${engine_upper}_ENABLED)
|
||||
set(ENGINES_DISABLED "${ENGINES_DISABLED} ${engine_lower}")
|
||||
#set("HAVE_${engine_upper}" 0 CACHE INTERNAL ${engine_upper})
|
||||
set("HAVE_${engine_upper}" OFF)
|
||||
endif(ENGINE_${engine_upper}_ENABLED)
|
||||
|
||||
endmacro(add_engine engine_lower engine_upper lib_list src_list inc_list enabled)
|
||||
|
||||
# print engines to be built
|
||||
macro(print_engines)
|
||||
|
||||
if(ENGINES_ENABLED)
|
||||
message(STATUS "Building engines:${ENGINES_ENABLED}")
|
||||
endif(ENGINES_ENABLED)
|
||||
if(ENGINES_DISABLED)
|
||||
message(STATUS "Disabled engines:${ENGINES_DISABLED}")
|
||||
endif(ENGINES_DISABLED)
|
||||
if(ENGINES_MISSING)
|
||||
message(STATUS "Missing engines:${ENGINES_MISSING}")
|
||||
endif(ENGINES_MISSING)
|
||||
|
||||
#message(STATUS "Engine libraries:${ENGINE_LIBRARIES}")
|
||||
|
||||
# need at least 1 engine
|
||||
if(NOT ENGINES_ENABLED)
|
||||
message(FATAL_ERROR "No engine enabled!")
|
||||
endif(NOT ENGINES_ENABLED)
|
||||
|
||||
endmacro(print_engines)
|
||||
43
cmake/FindDBus.cmake
Normal file
43
cmake/FindDBus.cmake
Normal file
@@ -0,0 +1,43 @@
|
||||
if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
|
||||
# Already in cache, be silent
|
||||
set(DBUS_FIND_QUIETLY TRUE)
|
||||
endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
|
||||
|
||||
set(DBUS_LIBRARY)
|
||||
set(DBUS_INCLUDE_DIR)
|
||||
set(DBUS_ARCH_INCLUDE_DIR)
|
||||
|
||||
FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
|
||||
/usr/include
|
||||
/usr/include/dbus-1.0
|
||||
/usr/local/include
|
||||
/usr/local/include/dbus-1.0
|
||||
)
|
||||
|
||||
FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
|
||||
/usr/lib/include
|
||||
/usr/lib/dbus-1.0/include
|
||||
/usr/lib64/include
|
||||
/usr/lib64/dbus-1.0/include
|
||||
/usr/local/lib/include
|
||||
/usr/local/lib/dbus-1.0/include
|
||||
/usr/local/lib64/include
|
||||
/usr/local/lib64/dbus-1.0/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(DBUS_LIBRARY NAMES dbus-1 dbus
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
)
|
||||
|
||||
if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
|
||||
MESSAGE(STATUS "D-Bus found: includes in ${DBUS_INCLUDE_DIR}, library in ${DBUS_LIBRARY}")
|
||||
set(DBUS_FOUND TRUE)
|
||||
else(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
|
||||
MESSAGE(STATUS "D-Bus not found")
|
||||
endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_LIBRARY DBUS_ARCH_INCLUDE_DIR)
|
||||
@@ -1,6 +1,6 @@
|
||||
set(STRAWBERRY_VERSION_MAJOR 0)
|
||||
set(STRAWBERRY_VERSION_MINOR 1)
|
||||
set(STRAWBERRY_VERSION_PATCH 3)
|
||||
set(STRAWBERRY_VERSION_PATCH 6)
|
||||
#set(STRAWBERRY_VERSION_PRERELEASE rc1)
|
||||
|
||||
set(INCLUDE_GIT_REVISION OFF)
|
||||
@@ -36,7 +36,7 @@ if(NOT GIT_EXECUTABLE-NOTFOUND)
|
||||
)
|
||||
# Get the latest abbreviated commit hash of the working branch
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --tags --always
|
||||
COMMAND ${GIT_EXECUTABLE} describe --long --tags --always
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_INFO_RESULT
|
||||
OUTPUT_VARIABLE GIT_REVISION
|
||||
|
||||
1009
data/data.qrc
1009
data/data.qrc
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB |
@@ -38,4 +38,4 @@ target_link_libraries(libstrawberry-common
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
|
||||
QT5_USE_MODULES(libstrawberry-common Core Network)
|
||||
target_link_libraries(libstrawberry-common Qt5::Core Qt5::Network)
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
# along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-local-typedefs -fpermissive --std=c++0x -U__STRICT_ANSI__")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Woverloaded-virtual -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-local-typedefs -fpermissive --std=c++11 -U__STRICT_ANSI__")
|
||||
|
||||
option(BUILD_WERROR "Build with -Werror" ON)
|
||||
|
||||
@@ -27,31 +28,44 @@ if(BUILD_WERROR)
|
||||
endif (LINUX)
|
||||
endif(BUILD_WERROR)
|
||||
|
||||
# Set up definitions and paths
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
include_directories(../3rdparty/qtwin)
|
||||
endif(WIN32)
|
||||
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
|
||||
add_definitions(-DBOOST_BIND_NO_PLACEHOLDERS)
|
||||
|
||||
if(ENABLE_IMOBILEDEVICE AND IMOBILEDEVICE_VERSION VERSION_GREATER 1.1.1)
|
||||
set(IMOBILEDEVICE_USES_UDIDS ON)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
include_directories(${GLIB_INCLUDE_DIRS})
|
||||
include_directories(${GLIBCONFIG_INCLUDE_DIRS})
|
||||
include_directories(${GOBJECT_INCLUDE_DIRS})
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
include_directories(${LIBXML_INCLUDE_DIRS})
|
||||
include_directories(${CHROMAPRINT_INCLUDE_DIRS})
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
|
||||
if(HAVE_GSTREAMER)
|
||||
link_directories(${GSTREAMER_LIBRARY_DIRS})
|
||||
include_directories(${GSTREAMER_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_APP_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_AUDIO_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_BASE_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_TAG_INCLUDE_DIRS})
|
||||
include_directories(${GSTREAMER_PBUTILS_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
if(HAVE_PHONON)
|
||||
include_directories(${PHONON_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
link_directories(${TAGLIB_LIBRARY_DIRS})
|
||||
include_directories(${TAGLIB_INCLUDE_DIRS})
|
||||
|
||||
include_directories(${SHA2_INCLUDE_DIRS})
|
||||
include_directories(${QTSINGLEAPPLICATION_INCLUDE_DIRS})
|
||||
include_directories(${QXT_INCLUDE_DIRS})
|
||||
include_directories(${CHROMAPRINT_INCLUDE_DIRS})
|
||||
|
||||
find_package(OpenGL)
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
|
||||
if(HAVE_LIBLASTFM)
|
||||
include_directories(${LASTFM5_INCLUDE_DIRS})
|
||||
@@ -61,8 +75,10 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-common)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/ext/libstrawberry-tagreader)
|
||||
include_directories(${CMAKE_BINARY_DIR}/ext/libstrawberry-tagreader)
|
||||
|
||||
include(../cmake/AddEngine.cmake)
|
||||
include(../cmake/ParseArguments.cmake)
|
||||
# Windows
|
||||
if (WIN32)
|
||||
include_directories(../3rdparty/qtwin)
|
||||
endif (WIN32)
|
||||
|
||||
set(SOURCES
|
||||
core/mainwindow.cpp
|
||||
@@ -470,29 +486,38 @@ set(OTHER_SOURCES)
|
||||
|
||||
option(USE_INSTALL_PREFIX "Look for data in CMAKE_INSTALL_PREFIX" ON)
|
||||
|
||||
# Engines
|
||||
# ALSA
|
||||
optional_source(HAVE_ALSA
|
||||
SOURCES
|
||||
engine/alsadevicefinder.cpp
|
||||
)
|
||||
|
||||
set(GST_ENGINE_SRC engine/gstengine.cpp engine/gstenginepipeline.cpp engine/gstelementdeleter.cpp)
|
||||
set(GST_ENGINE_MOC engine/gstengine.h engine/gstenginepipeline.h engine/gstelementdeleter.h)
|
||||
set(GST_ENGINE_LIB GSTREAMER GSTREAMER_BASE GSTREAMER_APP GSTREAMER_AUDIO GSTREAMER_TAG GSTREAMER_PBUTILS)
|
||||
#set(GST_ENGINE_LIB gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 streamer-audio-1.0 gstreamer-tag-1.0 gstreamer-pbutils-1.0)
|
||||
#set(GST_ENGINE_LIB ${GSTREAMER_BASE_LIBRARIES} ${GSTREAMER_LIBRARIES} ${GSTREAMER_APP_LIBRARIES} ${GSTREAMER_TAG_LIBRARIES} ${GSTREAMER_PBUTILS_LIBRARIES})
|
||||
# X11
|
||||
optional_source(X11_FOUND SOURCES widgets/osd_x11.cpp)
|
||||
|
||||
set(XINE_ENGINE_SRC engine/xineengine.cpp engine/xinescope.c)
|
||||
set(XINE_ENGINE_MOC engine/xineengine.h)
|
||||
# GStreamer
|
||||
optional_source(HAVE_GSTREAMER
|
||||
SOURCES engine/gstengine.cpp engine/gstenginepipeline.cpp engine/gstelementdeleter.cpp
|
||||
HEADERS engine/gstengine.h engine/gstenginepipeline.h engine/gstelementdeleter.h
|
||||
)
|
||||
|
||||
set(VLC_ENGINE_SRC engine/vlcengine.cpp)
|
||||
set(VLC_ENGINE_MOC engine/vlcengine.h)
|
||||
# Xine
|
||||
optional_source(HAVE_XINE
|
||||
SOURCES engine/xineengine.cpp engine/xinescope.c
|
||||
HEADERS engine/xineengine.h
|
||||
)
|
||||
|
||||
set(PHONON_ENGINE_SRC engine/phononengine.cpp)
|
||||
set(PHONON_ENGINE_MOC engine/phononengine.h)
|
||||
# VLC
|
||||
optional_source(HAVE_VLC
|
||||
SOURCES engine/vlcengine.cpp
|
||||
HEADERS engine/vlcengine.h
|
||||
)
|
||||
|
||||
add_engine(gstreamer GSTREAMER "${GST_ENGINE_LIB}" "${GST_ENGINE_SRC}" "${GST_ENGINE_MOC}" ON)
|
||||
add_engine(xine XINE LIBXINE "${XINE_ENGINE_SRC}" "${XINE_ENGINE_MOC}" OFF)
|
||||
add_engine(vlc VLC LIBVLC "${VLC_ENGINE_SRC}" "${VLC_ENGINE_MOC}" OFF)
|
||||
add_engine(phonon PHONON PHONON "${PHONON_ENGINE_SRC}" "${PHONON_ENGINE_MOC}" OFF)
|
||||
|
||||
print_engines()
|
||||
# Phonon
|
||||
optional_source(HAVE_PHONON
|
||||
SOURCES engine/phononengine.cpp
|
||||
HEADERS engine/phononengine.h
|
||||
)
|
||||
|
||||
# Lastfm
|
||||
optional_source(HAVE_LIBLASTFM
|
||||
@@ -503,59 +528,8 @@ optional_source(HAVE_LIBLASTFM
|
||||
covermanager/lastfmcoverprovider.h
|
||||
)
|
||||
|
||||
# Platform specific - Linux
|
||||
optional_source(LINUX
|
||||
SOURCES
|
||||
engine/alsadevicefinder.cpp
|
||||
)
|
||||
|
||||
# Platform specific - OS X
|
||||
optional_source(APPLE
|
||||
SOURCES
|
||||
core/mac_startup.mm
|
||||
core/macsystemtrayicon.mm
|
||||
core/macscreensaver.cpp
|
||||
core/macfslistener.mm
|
||||
core/scoped_nsautorelease_pool.mm
|
||||
widgets/osd_mac.mm
|
||||
engine/osxdevicefinder.cpp
|
||||
device/macdevicelister.mm
|
||||
globalshortcuts/shortcutgrabber.mm
|
||||
globalshortcuts/macglobalshortcutbackend.mm
|
||||
globalshortcuts/globalshortcutgrabber.mm
|
||||
HEADERS
|
||||
core/mac_startup.h
|
||||
core/macsystemtrayicon.h
|
||||
core/macscreensaver.h
|
||||
core/macfslistener.h
|
||||
core/mac_utilities.h
|
||||
core/mac_delegate.h
|
||||
engine/osxdevicefinder.h
|
||||
device/macdevicelister.h
|
||||
globalshortcuts/macglobalshortcutbackend.h
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
optional_source(HAVE_LIBMTP
|
||||
SOURCES
|
||||
device/macdevicelister.mm
|
||||
HEADERS
|
||||
device/macdevicelister.h
|
||||
)
|
||||
endif()
|
||||
|
||||
# Platform specific - Windows
|
||||
optional_source(WIN32
|
||||
SOURCES
|
||||
engine/directsounddevicefinder.cpp
|
||||
widgets/osd_win.cpp
|
||||
)
|
||||
|
||||
# Platform specific - X11
|
||||
optional_source(LINUX SOURCES widgets/osd_x11.cpp)
|
||||
|
||||
# DBUS and MPRIS - Linux specific
|
||||
if(HAVE_DBUS)
|
||||
# DBUS and MPRIS - Unix specific
|
||||
if(UNIX AND HAVE_DBUS)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus)
|
||||
|
||||
# MPRIS DBUS interfaces
|
||||
@@ -665,7 +639,7 @@ if(HAVE_DBUS)
|
||||
dbus/udisks2job)
|
||||
endif(HAVE_UDISKS2)
|
||||
|
||||
endif(HAVE_DBUS)
|
||||
endif(UNIX AND HAVE_DBUS)
|
||||
|
||||
optional_source(HAVE_DBUS
|
||||
SOURCES
|
||||
@@ -744,6 +718,7 @@ optional_source(HAVE_LIBPULSE
|
||||
engine/pulsedevicefinder.cpp
|
||||
)
|
||||
|
||||
# MusicBrainz, Organise and transcode require GStreamer
|
||||
optional_source(HAVE_GSTREAMER
|
||||
SOURCES
|
||||
core/organise.cpp
|
||||
@@ -802,7 +777,49 @@ optional_source(HAVE_AUDIOCD
|
||||
device/cddasongloader.h
|
||||
UI
|
||||
)
|
||||
endif(HAVE_GSTREAMER)
|
||||
endif()
|
||||
|
||||
# Platform specific - macOS
|
||||
optional_source(APPLE
|
||||
SOURCES
|
||||
core/mac_startup.mm
|
||||
core/macsystemtrayicon.mm
|
||||
core/macscreensaver.cpp
|
||||
core/macfslistener.mm
|
||||
core/scoped_nsautorelease_pool.mm
|
||||
widgets/osd_mac.mm
|
||||
engine/osxdevicefinder.cpp
|
||||
device/macdevicelister.mm
|
||||
globalshortcuts/shortcutgrabber.mm
|
||||
globalshortcuts/macglobalshortcutbackend.mm
|
||||
globalshortcuts/globalshortcutgrabber.mm
|
||||
HEADERS
|
||||
core/mac_startup.h
|
||||
core/macsystemtrayicon.h
|
||||
core/macscreensaver.h
|
||||
core/macfslistener.h
|
||||
core/mac_utilities.h
|
||||
core/mac_delegate.h
|
||||
engine/osxdevicefinder.h
|
||||
device/macdevicelister.h
|
||||
globalshortcuts/macglobalshortcutbackend.h
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
optional_source(HAVE_LIBMTP
|
||||
SOURCES
|
||||
device/macdevicelister.mm
|
||||
HEADERS
|
||||
device/macdevicelister.h
|
||||
)
|
||||
endif()
|
||||
|
||||
# Platform specific - Windows
|
||||
optional_source(WIN32
|
||||
SOURCES
|
||||
engine/directsounddevicefinder.cpp
|
||||
widgets/osd_win.cpp
|
||||
)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
@@ -827,25 +844,39 @@ add_library(strawberry_lib STATIC
|
||||
target_link_libraries(strawberry_lib
|
||||
libstrawberry-common
|
||||
libstrawberry-tagreader
|
||||
#gstafc
|
||||
${GLIB_LIBRARIES}
|
||||
${GIO_LIBRARIES}
|
||||
${SHA2_LIBRARIES}
|
||||
${TAGLIB_LIBRARIES}
|
||||
${GOBJECT_LIBRARIES}
|
||||
${QT_LIBRARIES}
|
||||
${ENGINE_LIBRARIES}
|
||||
${CHROMAPRINT_LIBRARIES}
|
||||
${QTSINGLEAPPLICATION_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${SQLITE_LIBRARIES}
|
||||
${QOCOA_LIBRARIES}
|
||||
z
|
||||
Qocoa
|
||||
)
|
||||
|
||||
if(LINUX)
|
||||
if(HAVE_ALSA)
|
||||
target_link_libraries(strawberry_lib ${ALSA_LIBRARIES})
|
||||
endif(LINUX)
|
||||
endif(HAVE_ALSA)
|
||||
|
||||
if(HAVE_GSTREAMER)
|
||||
target_link_libraries(strawberry_lib ${GSTREAMER_LIBRARIES} ${GSTREAMER_BASE_LIBRARIES} ${GSTREAMER_AUDIO_LIBRARIES} ${GSTREAMER_APP_LIBRARIES} ${GSTREAMER_TAG_LIBRARIES} ${GSTREAMER_PBUTILS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(HAVE_XINE)
|
||||
target_link_libraries(strawberry_lib ${LIBXINE_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(HAVE_VLC)
|
||||
target_link_libraries(strawberry_lib ${LIBVLC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(HAVE_PHONON)
|
||||
target_link_libraries(strawberry_lib ${PHONON_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(HAVE_LIBLASTFM)
|
||||
target_link_libraries(strawberry_lib ${LASTFM5_LIBRARIES})
|
||||
@@ -910,13 +941,11 @@ if (WIN32)
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
# Hack: the Gold linker pays attention to the order that libraries are
|
||||
# specified on the link line. -lX11 and -ldl are provided earlier in the link
|
||||
# command but they're actually used by libraries that appear after them, so
|
||||
# they end up getting ignored. This appends them to the very end of the link
|
||||
# line, ensuring they're always used.
|
||||
# Hack: the Gold linker pays attention to the order that libraries are specified on the link line.
|
||||
# -lX11 and -ldl are provided earlier in the link command but they're actually used by libraries that appear after them, so they end up getting ignored.
|
||||
# This appends them to the very end of the link line, ensuring they're always used.
|
||||
find_package(X11)
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
if (FREEBSD)
|
||||
target_link_libraries(strawberry_lib ${X11_X11_LIB})
|
||||
else ()
|
||||
target_link_libraries(strawberry_lib ${X11_X11_LIB} ${CMAKE_DL_LIBS})
|
||||
@@ -948,9 +977,9 @@ add_executable(strawberry
|
||||
core/main.cpp
|
||||
)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
if(FREEBSD)
|
||||
target_link_libraries(strawberry execinfo)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
endif()
|
||||
|
||||
target_link_libraries(strawberry
|
||||
strawberry_lib
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#cmakedefine HAVE_GIO
|
||||
#cmakedefine HAVE_DBUS
|
||||
#cmakedefine HAVE_UDISKS2
|
||||
#cmakedefine HAVE_ALSA
|
||||
#cmakedefine HAVE_DEVICEKIT
|
||||
#cmakedefine HAVE_IMOBILEDEVICE
|
||||
#cmakedefine HAVE_LIBARCHIVE
|
||||
|
||||
@@ -167,16 +167,13 @@ bool CommandlineOptions::Parse() {
|
||||
.arg(tr("Skip backwards in playlist"),
|
||||
tr("Skip forwards in playlist"),
|
||||
tr("Set the volume to <value> percent"),
|
||||
tr("Increase the volume by 4%"),
|
||||
tr("Decrease the volume by 4%"),
|
||||
tr("Increase the volume by 4 precent"),
|
||||
tr("Decrease the volume by 4 precent"),
|
||||
tr("Increase the volume by <value> percent"),
|
||||
tr("Decrease the volume by <value> percent"))
|
||||
.arg(tr("Seek the currently playing track to an absolute "
|
||||
"position"),
|
||||
tr("Seek the currently playing track by a relative "
|
||||
"amount"),
|
||||
tr("Restart the track, or play the previous track if "
|
||||
"within 8 seconds of start."),
|
||||
.arg(tr("Seek the currently playing track to an absolute position"),
|
||||
tr("Seek the currently playing track by a relative amount"),
|
||||
tr("Restart the track, or play the previous track if within 8 seconds of start."),
|
||||
tr("Playlist options"),
|
||||
tr("Create a new playlist with files"),
|
||||
tr("Append files/URLs to the playlist"),
|
||||
|
||||
@@ -43,9 +43,13 @@
|
||||
# include <QDBusArgument>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_UNIX
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
#include <sys/resource.h>
|
||||
#include <sys/sysctl.h>
|
||||
# include <sys/resource.h>
|
||||
# include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
@@ -62,7 +66,7 @@
|
||||
#include "qtsinglecoreapplication.h"
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
#include "mpris.h"
|
||||
# include "mpris.h"
|
||||
#endif
|
||||
#include "utilities.h"
|
||||
#include "metatypes.h"
|
||||
@@ -222,5 +226,17 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
int ret = a.exec();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
QFile self_maps("/proc/self/maps");
|
||||
if (self_maps.open(QIODevice::ReadOnly)) {
|
||||
QByteArray data = self_maps.readAll();
|
||||
if (data.contains("libnvidia-tls.so.")) {
|
||||
qLog(Warning) << "Exiting immediately to work around NVIDIA driver bug";
|
||||
_exit(ret);
|
||||
}
|
||||
self_maps.close();
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||
// Windows 7 thumbbar buttons
|
||||
thumbbar_->SetActions(QList<QAction*>() << ui_->action_previous_track << ui_->action_play_pause << ui_->action_stop << ui_->action_next_track << nullptr); // spacer
|
||||
|
||||
#if (defined(Q_OS_DARWIN) && defined(HAVE_SPARKLE)) || defined(Q_OS_WIN32)
|
||||
#if (defined(Q_OS_DARWIN) && defined(HAVE_SPARKLE))
|
||||
// Add check for updates item to application menu.
|
||||
QAction *check_updates = ui_->menu_tools->addAction(tr("Check for updates..."));
|
||||
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
|
||||
@@ -647,6 +647,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSD *osd, co
|
||||
FancyTabWidget::Mode default_mode = FancyTabWidget::Mode_LargeSidebar;
|
||||
ui_->tabs->SetMode(FancyTabWidget::Mode(settings_.value("tab_mode", default_mode).toInt()));
|
||||
file_view_->SetPath(settings_.value("file_path", QDir::homePath()).toString());
|
||||
|
||||
TabSwitched();
|
||||
|
||||
// Users often collapse one side of the splitter by mistake and don't know how to restore it. This must be set after the state is restored above.
|
||||
@@ -729,7 +730,6 @@ void MainWindow::ReloadSettings() {
|
||||
doubleclick_playlist_addmode_ = PlaylistAddBehaviour(settings.value("doubleclick_playlist_addmode", PlaylistAddBehaviour_Play).toInt());
|
||||
menu_playmode_ = PlayBehaviour(settings.value("menu_playmode", PlayBehaviour_IfStopped).toInt());
|
||||
settings.endGroup();
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::ReloadAllSettings() {
|
||||
@@ -896,9 +896,6 @@ void MainWindow::LoadPlaybackStatus() {
|
||||
saved_playback_state_ = static_cast<Engine::State> (settings.value("playback_state", Engine::Empty).toInt());
|
||||
saved_playback_position_ = settings.value("playback_position", 0).toDouble();
|
||||
settings.endGroup();
|
||||
|
||||
qLog(Debug) << "playback_state" << saved_playback_state_;
|
||||
qLog(Debug) << "playback_position" << saved_playback_position_;
|
||||
|
||||
if (saved_playback_state_ == Engine::Empty || saved_playback_state_ == Engine::Idle) {
|
||||
return;
|
||||
|
||||
@@ -365,9 +365,9 @@ QString Song::TextForFiletype(FileType type) {
|
||||
|
||||
switch (type) {
|
||||
case Song::Type_Wav: return QObject::tr("Wav");
|
||||
case Song::Type_Flac: return QObject::tr("Flac");
|
||||
case Song::Type_Flac: return QObject::tr("FLAC");
|
||||
case Song::Type_WavPack: return QObject::tr("WavPack");
|
||||
case Song::Type_OggFlac: return QObject::tr("Ogg Flac");
|
||||
case Song::Type_OggFlac: return QObject::tr("Ogg FLAC");
|
||||
case Song::Type_OggVorbis: return QObject::tr("Ogg Vorbis");
|
||||
case Song::Type_OggOpus: return QObject::tr("Ogg Opus");
|
||||
case Song::Type_OggSpeex: return QObject::tr("Ogg Speex");
|
||||
|
||||
@@ -124,7 +124,7 @@ QVariantMap DeviceKitLister::DeviceHardwareInfo(const QString &id) {
|
||||
if (!device_data_.contains(id)) return ret;
|
||||
const DeviceData &data = device_data_[id];
|
||||
|
||||
ret[QT_TR_NOOP("DBus path")] = data.dbus_path;
|
||||
ret[QT_TR_NOOP("D-Bus path")] = data.dbus_path;
|
||||
ret[QT_TR_NOOP("Serial number")] = data.drive_serial;
|
||||
ret[QT_TR_NOOP("Mount points")] = data.device_mount_paths.join(", ");
|
||||
ret[QT_TR_NOOP("Device")] = data.device_file;
|
||||
|
||||
@@ -100,7 +100,7 @@ QVariantMap Udisks2Lister::DeviceHardwareInfo(const QString &id) {
|
||||
QVariantMap result;
|
||||
|
||||
const auto &data = device_data_[id];
|
||||
result[QT_TR_NOOP("DBus path")] = data.dbus_path;
|
||||
result[QT_TR_NOOP("D-Bus path")] = data.dbus_path;
|
||||
result[QT_TR_NOOP("Serial number")] = data.serial;
|
||||
result[QT_TR_NOOP("Mount points")] = data.mount_paths.join(", ");
|
||||
result[QT_TR_NOOP("Partition label")] = data.label;
|
||||
|
||||
@@ -42,10 +42,10 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
|
||||
QList<Device> ret;
|
||||
|
||||
//register int err;
|
||||
int result = -1;
|
||||
int card = -1;
|
||||
int dev = -1;
|
||||
int result = -1;
|
||||
|
||||
snd_ctl_card_info_t *cardinfo;
|
||||
snd_pcm_info_t *pcminfo;
|
||||
snd_ctl_t *handle;
|
||||
@@ -53,29 +53,28 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_ctl_card_info_alloca(&cardinfo);
|
||||
snd_pcm_info_alloca(&pcminfo);
|
||||
|
||||
card = -1;
|
||||
|
||||
snd_pcm_stream_name(SND_PCM_STREAM_PLAYBACK);
|
||||
|
||||
while (true) {
|
||||
|
||||
result = snd_card_next(&card);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to get soundcard: " << snd_strerror(result);
|
||||
return ret;
|
||||
qLog(Error) << "Unable to get soundcard:" << snd_strerror(result);
|
||||
break;
|
||||
}
|
||||
if (card < 0) return ret;
|
||||
if (card < 0) break;
|
||||
|
||||
char name[32];
|
||||
sprintf(name, "hw:%d", card);
|
||||
|
||||
result = snd_ctl_open(&handle, name, 0);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to open soundcard " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Unable to open soundcard" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
result = snd_ctl_card_info(handle, cardinfo);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Control hardware failure for card " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Control hardware failure for card" << card << ":" << snd_strerror(result);
|
||||
snd_ctl_close(handle);
|
||||
continue;
|
||||
}
|
||||
@@ -85,7 +84,7 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
|
||||
result = snd_ctl_pcm_next_device(handle, &dev);
|
||||
if (result < 0) {
|
||||
qLog(Error) << "Unable to get PCM for card " << card << ": " << snd_strerror(result);
|
||||
qLog(Error) << "Unable to get PCM for card" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
if (dev < 0) break;
|
||||
@@ -93,14 +92,13 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_pcm_info_set_device(pcminfo, dev);
|
||||
snd_pcm_info_set_subdevice(pcminfo, 0);
|
||||
snd_pcm_info_set_stream(pcminfo, SND_PCM_STREAM_PLAYBACK);
|
||||
|
||||
result = snd_ctl_pcm_info(handle, pcminfo);
|
||||
if (result < 0) {
|
||||
if (result != -ENOENT) qLog(Error) << "Unable to get control digital audio info for card " << card << ": " << snd_strerror(result);
|
||||
if (result != -ENOENT) qLog(Error) << "Unable to get control digital audio info for card" << card << ":" << snd_strerror(result);
|
||||
continue;
|
||||
}
|
||||
|
||||
snd_pcm_info_get_name(pcminfo);
|
||||
|
||||
Device device;
|
||||
device.description = QString("%1 %2").arg(snd_ctl_card_info_get_name(cardinfo)).arg(snd_pcm_info_get_name(pcminfo));
|
||||
device.value = QString("hw:%1,%2").arg(card).arg(dev);
|
||||
@@ -111,9 +109,6 @@ QList<DeviceFinder::Device> AlsaDeviceFinder::ListDevices() {
|
||||
snd_ctl_close(handle);
|
||||
}
|
||||
|
||||
snd_pcm_info_free(pcminfo); pcminfo = NULL;
|
||||
snd_ctl_card_info_free(cardinfo); cardinfo = NULL;
|
||||
|
||||
snd_config_update_free_global();
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -48,6 +48,9 @@ QString DeviceFinder::GuessIconName(const QString &description) {
|
||||
if (description_lower.contains("headset")) {
|
||||
return "headset";
|
||||
}
|
||||
if (description_lower.contains("pulseaudio")) {
|
||||
return "pulseaudio";
|
||||
}
|
||||
|
||||
return "soundcard";
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "core/logging.h"
|
||||
|
||||
DirectSoundDeviceFinder::DirectSoundDeviceFinder()
|
||||
: DeviceFinder("directsoundsink") {
|
||||
: DeviceFinder("directsound") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> DirectSoundDeviceFinder::ListDevices() {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "devicefinder.h"
|
||||
#include "enginedevice.h"
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
@@ -57,7 +57,7 @@ void EngineDevice::Init() {
|
||||
|
||||
QList<DeviceFinder*> device_finders;
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifdef HAVE_ALSA
|
||||
device_finders.append(new AlsaDeviceFinder);
|
||||
#endif
|
||||
#ifdef HAVE_LIBPULSE
|
||||
@@ -81,4 +81,3 @@ void EngineDevice::Init() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,21 +67,6 @@
|
||||
# include "ext/gstafc/gstafcsrc.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
# include "alsadevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBPULSE
|
||||
# include "pulsedevicefinder.h"
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
# include "osxdevicefinder.h"
|
||||
#endif
|
||||
#ifdef Q_OS_WIN32
|
||||
# include "directsounddevicefinder.h"
|
||||
#endif
|
||||
|
||||
#include "settings/backendsettingspage.h"
|
||||
|
||||
using std::shared_ptr;
|
||||
@@ -89,12 +74,16 @@ using std::vector;
|
||||
|
||||
const char *GstEngine::kAutoSink = "autoaudiosink";
|
||||
const char *GstEngine::kALSASink = "alsasink";
|
||||
const char *GstEngine::kOpenALSASink = "openalsink";
|
||||
const char *GstEngine::kOSSSink = "osssink";
|
||||
const char *GstEngine::kOSS4Sink = "oss4sink";
|
||||
const char *GstEngine::kJackAudioSink = "jackaudiosink";
|
||||
const char *GstEngine::kPulseSink = "pulsesink";
|
||||
const char *GstEngine::kA2DPSink = "a2dpsink";
|
||||
const char *GstEngine::kAVDTPSink = "avdtpsink";
|
||||
const char *GstEngine::InterAudiosink = "interaudiosink";
|
||||
const char *GstEngine::kDirectSoundSink = "directsoundsink";
|
||||
const char *GstEngine::kOSXAudioSink = "osxaudiosink";
|
||||
|
||||
GstEngine::GstEngine(TaskManager *task_manager)
|
||||
: Engine::Base(),
|
||||
@@ -850,12 +839,6 @@ shared_ptr<GstEnginePipeline> GstEngine::CreatePipeline(const QByteArray &url, q
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &name) {
|
||||
|
||||
return (name == kALSASink || name == kOSSSink || name == kPulseSink);
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::AddBufferConsumer(GstBufferConsumer *consumer) {
|
||||
buffer_consumers_ << consumer;
|
||||
if (current_pipeline_) current_pipeline_->AddBufferConsumer(consumer);
|
||||
@@ -910,3 +893,23 @@ EngineBase::OutputDetailsList GstEngine::GetOutputsList() const {
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
bool GstEngine::ALSADeviceSupport(const QString &name) {
|
||||
return (name == kALSASink);
|
||||
}
|
||||
|
||||
bool GstEngine::PulseDeviceSupport(const QString &name) {
|
||||
return (name == kPulseSink);
|
||||
}
|
||||
|
||||
bool GstEngine::DirectSoundDeviceSupport(const QString &name) {
|
||||
return (name == kDirectSoundSink);
|
||||
}
|
||||
|
||||
bool GstEngine::OSXAudioDeviceSupport(const QString &name) {
|
||||
return (name == kOSXAudioSink);
|
||||
}
|
||||
bool GstEngine::CustomDeviceSupport(const QString &name) {
|
||||
return (name == kALSASink || name == kOpenALSASink || name == kOSSSink || name == kOSS4Sink || name == kA2DPSink || name == kAVDTPSink);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,13 +66,6 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
~GstEngine();
|
||||
|
||||
static const char *kAutoSink;
|
||||
static const char *kALSASink;
|
||||
static const char *kOSSSink;
|
||||
static const char *kOSS4Sink;
|
||||
static const char *kJackAudioSink;
|
||||
static const char *kPulseSink;
|
||||
static const char *kA2DPSink;
|
||||
static const char *kAVDTPSink;
|
||||
|
||||
bool Init();
|
||||
void EnsureInitialised() { initialising_.waitForFinished(); }
|
||||
@@ -86,15 +79,19 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
Engine::State state() const;
|
||||
const Engine::Scope &scope(int chunk_length);
|
||||
|
||||
static bool ALSADeviceSupport(const QString &name);
|
||||
|
||||
GstElement *CreateElement(const QString &factoryName, GstElement *bin = 0, bool fatal = true, bool showerror = true);
|
||||
|
||||
// BufferConsumer
|
||||
void ConsumeBuffer(GstBuffer *buffer, int pipeline_id);
|
||||
|
||||
|
||||
bool IsEqualizerEnabled() { return equalizer_enabled_; }
|
||||
|
||||
static bool ALSADeviceSupport(const QString &name);
|
||||
static bool PulseDeviceSupport(const QString &name);
|
||||
static bool DirectSoundDeviceSupport(const QString &name);
|
||||
static bool OSXAudioDeviceSupport(const QString &name);
|
||||
static bool CustomDeviceSupport(const QString &name);
|
||||
|
||||
public slots:
|
||||
void StartPreloading(const QUrl &url, bool force_stop_at_end, qint64 beginning_nanosec, qint64 end_nanosec);
|
||||
bool Load(const QUrl &, Engine::TrackChangeFlags change, bool force_stop_at_end, quint64 beginning_nanosec, qint64 end_nanosec);
|
||||
@@ -141,6 +138,19 @@ class GstEngine : public Engine::Base, public GstBufferConsumer {
|
||||
void BufferingFinished();
|
||||
|
||||
private:
|
||||
|
||||
static const char *kALSASink;
|
||||
static const char *kOpenALSASink;
|
||||
static const char *kOSSSink;
|
||||
static const char *kOSS4Sink;
|
||||
static const char *kJackAudioSink;
|
||||
static const char *kPulseSink;
|
||||
static const char *kA2DPSink;
|
||||
static const char *kAVDTPSink;
|
||||
static const char *InterAudiosink;
|
||||
static const char *kDirectSoundSink;
|
||||
static const char *kOSXAudioSink;
|
||||
|
||||
PluginDetailsList GetPluginList(const QString &classname) const;
|
||||
|
||||
void StartFadeout();
|
||||
|
||||
@@ -62,7 +62,7 @@ std::unique_ptr<T> GetProperty(const AudioDeviceID& device_id, const AudioObject
|
||||
|
||||
|
||||
OsxDeviceFinder::OsxDeviceFinder()
|
||||
: DeviceFinder("osxaudiosink") {
|
||||
: DeviceFinder("osxaudio") {
|
||||
}
|
||||
|
||||
QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
|
||||
@@ -94,8 +94,7 @@ QList<DeviceFinder::Device> OsxDeviceFinder::ListDevices() {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Determine if the device is an output device (it is an output device if
|
||||
// it has output channels)
|
||||
// Determine if the device is an output device (it is an output device if it has output channels)
|
||||
address.mSelector = kAudioDevicePropertyStreamConfiguration;
|
||||
std::unique_ptr<AudioBufferList> buffer_list = GetProperty<AudioBufferList>(id, address);
|
||||
if (!buffer_list.get() || buffer_list->mNumberBuffers == 0) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "phononengine.h"
|
||||
|
||||
#include "core/logging.h"
|
||||
#include "taskmanager.h"
|
||||
#include "core/taskmanager.h"
|
||||
|
||||
PhononEngine::PhononEngine(TaskManager *task_manager)
|
||||
: media_object_(new Phonon::MediaObject(this)),
|
||||
|
||||
@@ -123,7 +123,7 @@ void PulseDeviceFinder::GetSinkInfoCallback(pa_context *c, const pa_sink_info *i
|
||||
Device dev;
|
||||
dev.description = QString::fromUtf8(info->description);
|
||||
dev.value = QString::fromUtf8(info->name);
|
||||
dev.iconname = QString::fromUtf8(pa_proplist_gets(info->proplist, "device.iconname"));
|
||||
dev.iconname = GuessIconName(dev.description);
|
||||
|
||||
state->devices.append(dev);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ void BackendSettingsPage::Load_Engine(Engine::EngineType enginetype) {
|
||||
|
||||
}
|
||||
|
||||
void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa) {
|
||||
void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa, bool pulseaudio, bool directsound, bool osxaudio, bool custom) {
|
||||
|
||||
int devices = 0;
|
||||
DeviceFinder::Device dfdevice;
|
||||
@@ -211,6 +211,9 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
|
||||
for (DeviceFinder *f : dialog()->app()->enginedevice()->device_finders_) {
|
||||
if (f->name() == "alsa" && !alsa) continue;
|
||||
if (f->name() == "pulseaudio" && !pulseaudio) continue;
|
||||
if (f->name() == "directsound" && !directsound) continue;
|
||||
if (f->name() == "osxaudio" && !osxaudio) continue;
|
||||
for (const DeviceFinder::Device &d : f->ListDevices()) {
|
||||
devices++;
|
||||
ui_->combobox_device->addItem(IconLoader::Load(d.iconname), d.description, d.value);
|
||||
@@ -218,10 +221,10 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
}
|
||||
}
|
||||
|
||||
if (alsa) ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Custom", QVariant(""));
|
||||
if (custom) ui_->combobox_device->addItem(IconLoader::Load("soundcard"), "Custom", QVariant(""));
|
||||
|
||||
bool found = false;
|
||||
if (devices > 0) ui_->combobox_device->setEnabled(true);
|
||||
if (custom || devices > 0) ui_->combobox_device->setEnabled(true);
|
||||
for (int i = 0; i < ui_->combobox_device->count(); ++i) {
|
||||
QVariant d = ui_->combobox_device->itemData(i).value<QVariant>();
|
||||
if (dfdevice.value == d) {
|
||||
@@ -232,7 +235,7 @@ void BackendSettingsPage::Load_Device(QString output, QVariant device, bool alsa
|
||||
}
|
||||
|
||||
// This allows a custom ALSA device string ie: "hw:0,0" even if it is not listed.
|
||||
if (found == false && alsa && device.type() == QVariant::String && !device.toString().isEmpty()) {
|
||||
if (found == false && custom && device.type() == QVariant::String && !device.toString().isEmpty()) {
|
||||
ui_->lineedit_device->setText(device.toString());
|
||||
}
|
||||
|
||||
@@ -247,7 +250,7 @@ void BackendSettingsPage::Gst_Load(QString output, QVariant device) {
|
||||
errordialog_.ShowMessage("GStramer not initialized! Please restart.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GstEngine *gstengine = qobject_cast<GstEngine*>(dialog()->app()->player()->engine());
|
||||
|
||||
ui_->combobox_output->clear();
|
||||
@@ -269,7 +272,7 @@ void BackendSettingsPage::Gst_Load(QString output, QVariant device) {
|
||||
engineloaded_=Engine::GStreamer;
|
||||
ui_->groupbox_replaygain->setEnabled(true);
|
||||
|
||||
Load_Device(output, device, GstEngine::ALSADeviceSupport(output));
|
||||
Load_Device(output, device, GstEngine::ALSADeviceSupport(output), GstEngine::PulseDeviceSupport(output), GstEngine::DirectSoundDeviceSupport(output), GstEngine::OSXAudioDeviceSupport(output), GstEngine::CustomDeviceSupport(output));
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -303,7 +306,7 @@ void BackendSettingsPage::Xine_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::Xine;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -317,7 +320,7 @@ void BackendSettingsPage::Phonon_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::Phonon;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -331,7 +334,7 @@ void BackendSettingsPage::VLC_Load(QString output, QVariant device) {
|
||||
|
||||
engineloaded_=Engine::VLC;
|
||||
|
||||
Load_Device(output, device, false);
|
||||
Load_Device(output, device);
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -468,7 +471,7 @@ void BackendSettingsPage::OutputChanged(int index, Engine::EngineType enginetype
|
||||
void BackendSettingsPage::Xine_OutputChanged(int index) {
|
||||
|
||||
EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value<EngineBase::OutputDetails>();
|
||||
Load_Device(output.name, QVariant(), false);
|
||||
Load_Device(output.name, QVariant());
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -477,20 +480,20 @@ void BackendSettingsPage::Xine_OutputChanged(int index) {
|
||||
void BackendSettingsPage::Gst_OutputChanged(int index) {
|
||||
|
||||
EngineBase::OutputDetails output = ui_->combobox_output->itemData(index).value<EngineBase::OutputDetails>();
|
||||
Load_Device(output.name, QVariant(), GstEngine::ALSADeviceSupport(output.name));
|
||||
Load_Device(output.name, QVariant(), GstEngine::ALSADeviceSupport(output.name), GstEngine::PulseDeviceSupport(output.name), GstEngine::DirectSoundDeviceSupport(output.name), GstEngine::OSXAudioDeviceSupport(output.name), GstEngine::CustomDeviceSupport(output.name));
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PHONON
|
||||
void BackendSettingsPage::Phonon_OutputChanged(int index) {
|
||||
Load_Device("", QVariant(), false);
|
||||
Load_Device("", QVariant());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VLC
|
||||
void BackendSettingsPage::VLC_OutputChanged(int index) {
|
||||
Load_Device("", QVariant(), false);
|
||||
Load_Device("", QVariant());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -502,14 +505,12 @@ void BackendSettingsPage::DeviceSelectionChanged(int index) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined(Q_OS_WIN32)
|
||||
QVariant device = ui_->combobox_device->itemData(index).value<QVariant>();
|
||||
if (device.type() == QVariant::String) {
|
||||
if (device.type() == QVariant::String && device.toString().startsWith("hw:", Qt::CaseInsensitive)) {
|
||||
ui_->lineedit_device->setEnabled(true);
|
||||
ui_->lineedit_device->setText(device.toString());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ui_->lineedit_device->setEnabled(false);
|
||||
ui_->lineedit_device->setText("");
|
||||
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
void OutputChanged(int index, Engine::EngineType enginetype);
|
||||
|
||||
void Load_Engine(Engine::EngineType enginetype);
|
||||
void Load_Device(QString output, QVariant device, bool alsa);
|
||||
void Load_Device(QString output, QVariant device, bool alsa = false, bool pulseaudio = false, bool directsound = false, bool osxaudio = false, bool custom = false);
|
||||
|
||||
#ifdef HAVE_XINE
|
||||
void Xine_Load(QString output, QVariant device);
|
||||
|
||||
@@ -239,7 +239,7 @@ TranscoderPreset Transcoder::PresetForFileType(Song::FileType type) {
|
||||
|
||||
switch (type) {
|
||||
case Song::Type_Flac:
|
||||
return TranscoderPreset(type, tr("Flac"), "flac", "audio/x-flac");
|
||||
return TranscoderPreset(type, tr("FLAC"), "flac", "audio/x-flac");
|
||||
case Song::Type_Mp4:
|
||||
return TranscoderPreset(type, tr("M4A AAC"), "mp4", "audio/mpeg, mpegversion=(int)4", "audio/mp4");
|
||||
case Song::Type_Mpeg:
|
||||
@@ -247,7 +247,7 @@ TranscoderPreset Transcoder::PresetForFileType(Song::FileType type) {
|
||||
case Song::Type_OggVorbis:
|
||||
return TranscoderPreset(type, tr("Ogg Vorbis"), "ogg", "audio/x-vorbis", "application/ogg");
|
||||
case Song::Type_OggFlac:
|
||||
return TranscoderPreset(type, tr("Ogg Flac"), "ogg", "audio/x-flac", "application/ogg");
|
||||
return TranscoderPreset(type, tr("Ogg FLAC"), "ogg", "audio/x-flac", "application/ogg");
|
||||
case Song::Type_OggSpeex:
|
||||
return TranscoderPreset(type, tr("Ogg Speex"), "spx", "audio/x-speex", "application/ogg");
|
||||
case Song::Type_OggOpus:
|
||||
|
||||
@@ -87,7 +87,7 @@ StatusView::StatusView(CollectionViewContainer *collectionviewcontainer, QWidget
|
||||
show_hide_animation_(new QTimeLine(500, this)),
|
||||
fade_animation_(new QTimeLine(1000, this)),
|
||||
image_blank_(""),
|
||||
image_nosong_(":/icons/full/strawberry.png"),
|
||||
image_nosong_(":/pictures/strawberry.png"),
|
||||
widgetstate_(None),
|
||||
menu_(new QMenu(this))
|
||||
{
|
||||
@@ -348,7 +348,7 @@ void StatusView::NoSong() {
|
||||
//qLog(Debug) << __PRETTY_FUNCTION__;
|
||||
|
||||
QString html;
|
||||
QImage image_logo(":/icons/full/strawberry.png");
|
||||
QImage image_logo(":/pictures/strawberry.png");
|
||||
QImage image_logo_scaled = image_logo.scaled(300, 300, Qt::KeepAspectRatio);
|
||||
QPixmap pixmap_logo(QPixmap::fromImage(image_logo_scaled));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user