1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-06 12:10:47 +02:00

Compare commits

...

137 Commits

Author SHA1 Message Date
Hugo Lindström
da54a948a6 Build more dependencies 2019-12-27 06:48:18 +00:00
Hugo Lindström
f69c8bc708 Build QtWebkit and Sparsehash with MXE 2019-12-27 06:43:18 +00:00
Hugo Lindström
5761027839 Remove erroneous escape character 2019-12-26 10:03:18 +08:00
Hugo Lindström
a743058db0 Make build take less than 6 hrs 2019-12-25 11:50:56 +08:00
Hugo Lindström
343bc93f3b Update docker workflow
Use DOCKERHUB_USERNAME when tagging an image
2019-12-24 13:28:12 +08:00
Hugo Lindström
130f4193af Add MXE to Docker, attempt to build using Actions 2019-12-24 13:10:07 +08:00
Hugo Lindström
372ad91db4 Add Docker build and push workflow
Use Github Actions to build and push image
2019-12-24 12:53:37 +08:00
Hugo Lindström
27e8a665cf Remove circleci in favour of Github Actions 2019-12-20 18:44:41 +08:00
Hugo Lindström
fdca99e57d Accept Ipv4 or Ipv6 2019-12-20 18:17:17 +08:00
Hugo Lindström
e3bb74ce25 Merge pull request #666 from tomahawk-player/hugolm84-test-actions
Add Github Action for building on Linux
2019-12-20 18:14:56 +08:00
Hugo Lindström
4aa06f524c Create ccpp.yml
Add a test workflow
2019-12-20 17:44:40 +08:00
Hugo Lindström
8c3dc90f76 Add circleci config 2019-12-14 12:06:25 +08:00
Hugo Lindström
ba5759d453 Add circleci and Docker support 2019-12-14 11:22:14 +08:00
Hugo Lindström
18b42539e4 Add QtWebKit as required dependency for Qt>5.6, fix cmake configuration errors on OSX 2019-12-08 16:03:58 +08:00
Andreas Sturmlechner
299f033ef9 Fix build with <cmake-3.10 2019-02-03 03:35:12 +01:00
Dominik Schmidt
777b312191 Set CMP0075 at top level CMakeLists.txt 2018-10-30 20:19:33 +01:00
Dominik Schmidt
1ab3ed9f93 Switch CMake policy CMP0023 to NEW 2018-10-30 20:15:18 +01:00
Dominik Schmidt
9327204c78 Fix unused variable warning 2018-10-30 19:44:22 +01:00
Dominik Schmidt
60672e2d0c Log QtInfoMsg too 2018-10-30 19:44:00 +01:00
Dominik Schmidt
4375c8e0c4 Get rid of deprecated typedefs (QStyleOptionViewItemV4 and co) 2018-10-30 19:43:38 +01:00
Dominik Schmidt
092313cd7f Mark tomahawk_i18n.qrc as BYPRODUCT to make ninja happy 2018-10-30 19:41:59 +01:00
Dominik Schmidt
783e853c2a Use set_package_properties instead of set_package_info in MacroLogFeature 2018-10-30 19:41:32 +01:00
Dominik Schmidt
368032f399 Remove obsolete FindOggVorbis.cmake 2018-10-30 19:40:28 +01:00
Dominik Schmidt
ec2b9d84eb Explicitly enable the usage of CMAKE_REQUIRED_LIBRARIES for check_cxx_source_compiles 2018-10-30 19:40:12 +01:00
Dominik Schmidt
378f8262cf Rely on CMake to figure out proper compile flags for C++11 2018-10-30 19:39:00 +01:00
Dominik Schmidt
3f012ac9f8 Disable Hatchet plugin as hatchet is dead. 2018-10-30 19:38:36 +01:00
Dominik Schmidt
d7cc6b5719 Let AUTOMOC and AUTOUIC process generated files 2018-10-30 19:38:10 +01:00
Andreas Sturmlechner
d5c8026a9e TomahawkUse.cmake.in code deduplication 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
0ec2df0ac6 Add missing Qt5 dependencies 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
84ec28e476 Remove obsolete setup_qt macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
62feb25f5c Remove obsolete qt_add_dbus_adaptor macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
80d2fa48ec Remove obsolete qt_add_dbus_interface macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
4815dd78c1 Remove obsolete qt_add_translation macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
3b1e0b3cf1 Remove obsolete qt_add_resources macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
a563993b71 Remove obsolete qt_wrap_ui macro 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
57bc920534 Remove obsolete libqnetwm from thirdparty dir 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
be919f74f9 Remove obsolete Qt5Core_DIR conditionals 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
bdc3238e6e FindQuaZip.cmake: Make '5' version suffix permanent 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
333806ef4a Update PACKAGING.md 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
084084db22 Remove local copy of GNUInstallDirs, use the one from cmake 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
a6cb6a92e6 Remove obsolete QT_VERSION_CHECKs 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
2b95da1a32 Remove obsolete FindQJSON.cmake 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
25da5bdbc5 Remove obsolete FindKDE4Installed.cmake 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
d7b9c5464d Remove obsolete kde.png from configstorage 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
d96dc74353 Remove obsolete tomahawk.protocol 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
73091bec21 Qt4--: Remove any traces of WITH_KDE4, KDE4_FOUND, LEGACY_KDE_INTEGRATION 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
021223f6cc Qt4--: Drop any traces of BUILD_WITH_QT4 2018-10-30 19:36:14 +01:00
Andreas Sturmlechner
7302047e9a Qt4--: Remove any traces of TOMAHAWK_QT5 2018-10-30 19:36:14 +01:00
Zach Saunders
119a7ebdb8 Change 'noone' to 'no one' in README 2018-10-23 15:18:57 -07:00
Jason Carr
af0cb18972 Use VERSION_LESS instead of STRLESS for Lucene dependency 2018-10-16 17:11:04 +02:00
Andreas Sturmlechner
34c1f88171 Fix build with Qt 5.11_beta3 (dropping qt5_use_modules) 2018-04-22 14:05:43 +02:00
Dominik Schmidt
00f602e102 Fix #619: Correctly detect qt5keychain 2017-08-08 14:34:49 +02:00
Anton Romanov
c838959248 Update readme.md, someone has to say the obvious 2017-05-10 16:33:30 -07:00
Anton Romanov
97a407f837 Set Tomahawk's User-Agent on requests to Musicbrainz 2017-01-30 11:56:14 -08:00
Anton Romanov
3b6ba36e83 Streamline special char filtering out and add ´ to that list 2016-12-06 17:24:35 -08:00
Anton Romanov
cf6a37ae45 Only start playing preferred result if it is from the currently playing Query 2016-12-02 16:07:18 -08:00
Dominik Schmidt
690a87f1eb Merge pull request #577 from tomahawk-player/scriptcollectionweight
Allow to specify weight for collection (matters only as last resort for sorting results)
2016-11-30 22:12:10 +01:00
Anton Romanov
6842da7240 Fix possible issue with accessing parent resolver in collection(in case it doesn't have one) 2016-11-30 12:17:38 -08:00
Anton Romanov
6910e5dd3b Allow to specify weight for collection (matters only as last resort for sorting results) 2016-11-30 12:13:50 -08:00
Anton Romanov
584aa76582 Give script collection weight of 100 to fix prefered sorting 2016-11-30 11:44:40 -08:00
Anton Romanov
7e96285132 Merge pull request #573 from tomahawk-player/cacheSimilarity
Cache track similarity in Query to speed up result insertion/removal
2016-11-18 21:25:40 -08:00
Anton Romanov
c996a8b90e Merge pull request #490 from tomahawk-player/preferred-result
Enable setting a preferred result on a query
2016-11-15 10:23:55 -08:00
Anton Romanov
c705013ee1 Cache track similarity in Query to speed up result insertion/removal 2016-11-11 21:31:22 -08:00
Dominik Schmidt
84360aed2f Merge pull request #572 from tomahawk-player/vlcargs
Allow specifying additional VLC cmdnline args in advanced settings
2016-11-11 07:20:55 +01:00
Anton Romanov
ada03e1a8d Allow specifying additional VLC cmdnline args in advanced settings 2016-11-10 22:12:50 -08:00
Anton Romanov
3a71da5705 Disable Rovi infoplugin as it gives bogus results and spotify infoplugin as its not working due to using disabled API 2016-11-04 11:19:24 -07:00
Anton Romanov
214e310c91 Rearrange vlc includes for compilation with vlc3 master 2016-11-04 11:18:32 -07:00
Stefan Derkits
ed9a027644 q&d fix: hide stations in UI because they no longer work (#562)
Echonest API is dead :( remove libechonest dependency & hide stations in UI
2016-10-28 23:21:13 +02:00
Dominik Schmidt
3e2d74128d Merge pull request #507 from mickael9/mickael9-patch-1
Allow downloads from a non-collection resolver
2016-09-19 23:08:26 +02:00
Dominik Schmidt
84ed59f4be Merge pull request #560 from theli-ua/cookierootfix
Set redirect path to '/' if its empty, carry-over Accept-Language if set
2016-09-19 23:04:29 +02:00
Romanov
5dd36cbd4e Fix typo 2016-09-19 12:10:36 -07:00
Romanov
7e38d94fe5 Cleanup header carryover a bit 2016-09-19 12:09:40 -07:00
Romanov
28ee9180c8 Set redirect path to '/' if its empty, carry-over Accept-Language if set 2016-09-19 11:54:59 -07:00
Christian Muehlhaeuser
09e9a6e960 Fixed crash in TrackView.cpp triggered by Qt >5.6.1. 2016-06-30 21:43:27 +02:00
Christian Muehlhaeuser
ffa098e52d Coding style fix. 2016-06-30 21:40:42 +02:00
Dominik Schmidt
a439427ca5 Merge pull request #514 from bjoernricks/master
Show notification on resume
2016-05-29 18:26:56 +02:00
Björn Ricks
a9505f75c5 Show notification on resume
Display song notification when a user resumes playing music.
2016-05-27 09:02:25 +02:00
Mickaël Thomas
7e54e506df DownloadJob: make sure resolvedBy() is not null 2016-05-21 19:28:50 +02:00
Mickaël Thomas
abc00b4758 Add getDownloadUrl (similar to getStreamUrl) 2016-05-19 22:14:26 +02:00
Christian Muehlhaeuser
77e9b69679 Merge pull request #489 from tomahawk-player/unify-download-buttons
Unify DownloadButtons
2016-05-11 21:15:23 +02:00
Romanov
58b640d389 Mark overrides as such 2016-04-22 11:39:24 -07:00
Romanov
1a5f073437 Use temporary QString to hold ownership of strings when passing imem params, set media on the player after setting all params 2016-04-22 10:13:35 -07:00
Dominik Schmidt
c9ef7e74d8 Enable setting a preferred result on a query 2016-04-16 04:15:45 +02:00
Dominik Schmidt
34448b1b46 DownloadButton: Share click handling code between primitive and widget mode 2016-04-16 01:16:35 +02:00
Dominik Schmidt
4408ba275c Add localUrlForDownload method 2016-04-16 00:19:36 +02:00
Dominik Schmidt
dfd71d7010 Add DownloadButton to column view 2016-04-15 21:44:34 +02:00
Dominik Schmidt
170e2e1c86 Allow to use DownloadButton as a real standalone widget 2016-04-15 21:42:28 +02:00
Dominik Schmidt
0047763188 Unify DownloadButtons 2016-04-15 18:48:30 +02:00
Christian Muehlhaeuser
525068a706 DirLister should emit finished if there's nothing to scan at all. 2016-04-15 13:50:45 +02:00
Christian Muehlhaeuser
85657e40a6 Update editor geometry correctly for download buttons in GridItemDelegate. 2016-04-14 16:56:56 +02:00
Dominik Schmidt
af459afb0b Show actual DropDownButton (with Format selector) for DownloadFormats in GridView 2016-04-14 16:56:56 +02:00
Dominik Schmidt
5bbc39e6a5 Fix broken button state after download from GridView 2016-04-14 16:56:56 +02:00
Dominik Schmidt
c88640268a Fix DropDownButton activation in GridView 2016-04-14 16:56:56 +02:00
Dominik Schmidt
8749a04e23 Fix album folders not being opened correctly if the path contained whitespaces 2016-04-14 16:56:55 +02:00
Dominik Schmidt
d45917d14a Show View In Folder button when album is completely downloaded 2016-04-14 16:56:39 +02:00
Dominik Schmidt
c87b1390e5 Add Result::isLocal helper method 2016-04-14 16:53:30 +02:00
Christian Muehlhaeuser
bf28f6856e Fixed seeking for HTTP streams without headers, e.g. Spotify (see #453). 2016-04-14 00:57:00 +02:00
Dominik Schmidt
ceab0f9cf2 Fix RTMP streams 2016-04-13 20:03:02 +02:00
Christian Muehlhaeuser
a562e75937 Fixed copy/paste job-gone-wrong: GPL2->GPL3 header updates. 2016-04-13 15:34:27 +02:00
Christian Muehlhaeuser
81eb226146 Abort event-handling when TomahawkWindow's event-filter caught and handled a mouse event. 2016-04-13 14:40:08 +02:00
Dominik Schmidt
ec88cf27f3 Fix getResponseHeader to correctly return values for case-insensitive headers 2016-04-13 13:59:35 +02:00
Dominik Schmidt
931562fbe5 Fix getResponseHeader for native requests. Needs discussion what's the cross platform way forward 2016-04-13 13:17:38 +02:00
Christian Muehlhaeuser
77593e32a7 Don't refresh collection every single time we're about to show the page. 2016-04-12 20:05:13 +02:00
Christian Muehlhaeuser
bac38e4555 Coding style in SeekSlider.cpp. 2016-04-12 15:55:33 +02:00
Christian Muehlhaeuser
980ee97c97 Merge pull request #332 from tmwoz/master
Fix for next track not getting triggered when seeking to/past the end with a mouse
2016-04-12 15:45:07 +02:00
Christian Muehlhaeuser
26ad51f4b8 Removed Qt5 warning. It's our default now. 2016-04-12 14:31:08 +02:00
Christian Muehlhaeuser
21bdb0bc89 Show up to 50 top tracks per artist. 2016-04-12 14:23:18 +02:00
Christian Muehlhaeuser
0a560f2f27 Fixed compiler warnings for QMetaType comparison. 2016-04-12 14:11:41 +02:00
Christian Muehlhaeuser
9c9f5e4dae Added Anton Romanov and Stefan Ahlers to our about-dialog. Well deserved guys, thanks for all the amazing work. 2016-04-05 11:37:44 +02:00
Christian Muehlhaeuser
fb38735936 Style fix in Pipeline. 2016-04-05 11:34:45 +02:00
Dominik Schmidt
c62ae52bfe Fix Zeroconf with recent Qt5 2016-04-02 13:45:08 +02:00
Dominik Schmidt
0341492069 Fix #458: Completely disable BUY buttons in GridItemDelegate instead of only making them invisible 2016-04-02 13:28:56 +02:00
Dominik Schmidt
879df894c3 Merge pull request #465 from mrmaffen/master
Fixed a bug in fake xhr's getResponseHeader function. Plus some compat fixes for th android
2016-04-02 11:59:35 +02:00
Dominik Schmidt
0c9f1be2c8 Prevent users from compiling Tomahawk with Qt4 2016-03-27 12:07:08 +02:00
Teo Mrnjavac
f7a3d441a1 Update libcrashreporter-qt submodule for build fix. 2016-03-25 11:46:19 +01:00
Teo Mrnjavac
e9a1135525 Update libcrashreporter-qt submodule. 2016-03-25 10:08:45 +01:00
Teo Mrnjavac
bdce4f7636 Probably shouldn't be inline. 2016-03-21 11:29:23 +01:00
Teo Mrnjavac
de65e19cb7 Use a sans serif antialiased font in the artist bio view. 2016-03-09 14:34:20 +01:00
Teo Mrnjavac
ce3647a4a6 Scale up artist bio font size with DpiScaler to make it always readable 2016-03-09 13:44:45 +01:00
Enno Gottschalk
f498570a0e Fixed a bug in fake xhr's getResponseHeader function. Plus some compat fixes for th android 2016-03-04 19:34:03 +01:00
Enno Gottschalk
9a741cd2db Czeched, polished and finnished 2016-03-02 17:11:01 +01:00
Enno Gottschalk
102c9c6846 Make testConfig great again! 2016-03-02 16:14:27 +01:00
Dominik Schmidt
1fa35ae827 Go back to former VLC build as the new build is crashy 2016-02-25 23:10:07 +01:00
Dominik Schmidt
26c0f35d21 Wrap error message in account config 2016-02-25 03:46:44 +01:00
Dominik Schmidt
9acbb48659 If sign_step.sh exists, require it to succeed 2016-02-25 02:52:25 +01:00
Dominik Schmidt
cc9f287b41 Don't rely on target names for export macros 2016-02-23 17:20:31 +01:00
Dominik Schmidt
99abd7434b Don't hardcode app id for vlc 2016-02-23 16:14:10 +01:00
Dominik Schmidt
f38f3ca367 Linux: Fix icon installation 2016-02-23 16:14:10 +01:00
Christian Muehlhaeuser
773ecea0da Be less verbose in SourceTreeView. 2016-02-23 02:24:10 +01:00
Christian Muehlhaeuser
620d3fe3fc Style fixes in SourceTreeView. 2016-02-23 02:23:47 +01:00
Christian Muehlhaeuser
8679fd5055 Style fix in CollectionViewPage. 2016-02-23 02:23:19 +01:00
Christian Muehlhaeuser
d7eccea4c0 Remove obsolete method in SourceTreeView. 2016-02-23 02:22:53 +01:00
Christian Muehlhaeuser
2ab9418a9e Don't paint a hover background during drag & drop, when you can't drop something on a sidebar item, e.g. groups, labels etc. 2016-02-23 02:15:45 +01:00
Christian Muehlhaeuser
285333d43b Blur the collection header background, so the labels stand out a bit more. 2016-02-23 01:20:35 +01:00
Tomasz Woźniak
1b0517efc5 moved the fix to include seeking via position 2015-10-05 22:01:50 +02:00
Tomasz Woźniak
e6a8a41c31 added quick fix for libvlc not seeking correctly to an end for some tracks 2015-10-05 20:04:17 +02:00
Tomasz Woźniak
193beda2bc handle case when user seeks past the slider's end 2015-10-05 00:47:26 +02:00
236 changed files with 2056 additions and 3651 deletions

16
.github/workflows/ccpp.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: C/C++ CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
container:
image: tomahawkmusicplayer/ubuntu:latest
env:
MIX_ENV: test
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Build and test
run: /usr/local/bin/build-and-test.sh

18
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Docker Image CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Build the Docker image
run: cd Docker && docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:latest
- name: Push the latest Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/ubuntu:latest

View File

@@ -2,10 +2,18 @@ PROJECT( tomahawk )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
CMAKE_POLICY(SET CMP0017 NEW)
CMAKE_POLICY(SET CMP0022 NEW)
IF(POLICY CMP0075)
CMAKE_POLICY(SET CMP0075 NEW)
ENDIF()
# TODO:
# Update to NEW and fix things up
CMAKE_POLICY(SET CMP0023 OLD)
CMAKE_POLICY(SET CMP0023 NEW)
# Let AUTOMOC and AUTOUIC process generated files
IF(POLICY CMP0071)
CMAKE_POLICY(SET CMP0071 NEW)
ENDIF()
# TODO:
# Disable automatic qtmain linking
@@ -89,8 +97,7 @@ endif()
option(BUILD_GUI "Build Tomahawk with GUI" ON)
option(BUILD_TESTS "Build Tomahawk with unit tests" ${BUILD_NO_RELEASE})
option(BUILD_TOOLS "Build Tomahawk helper tools" ${BUILD_NO_RELEASE})
option(BUILD_HATCHET "Build the Hatchet plugin" ON)
option(BUILD_WITH_QT4 "Build Tomahawk with Qt4 instead of Qt5" OFF)
option(BUILD_HATCHET "Build the Hatchet plugin" OFF)
if(UNIX AND NOT APPLE)
set(CRASHREPORTER_ENABLED_BY_DEFAULT OFF)
@@ -99,8 +106,6 @@ else()
endif()
option(WITH_CRASHREPORTER "Build with CrashReporter" ${CRASHREPORTER_ENABLED_BY_DEFAULT})
option(WITH_BINARY_ATTICA "Enable support for downloading binary resolvers automatically" ON)
option(LEGACY_KDE_INTEGRATION "Install tomahawk.protocol file, deprecated since 4.6.0" OFF)
option(WITH_KDE4 "Build with support for KDE specific stuff" ON)
# build options for development purposes
option(SANITIZE_ADDRESS "Enable Address Sanitizer for memory error detection" OFF)
@@ -161,158 +166,45 @@ INCLUDE( MacroLogFeature )
message( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} ***" )
if( NOT BUILD_WITH_QT4 )
find_package(Qt5Core QUIET)
if( Qt5Core_DIR )
# CMAKE 2.8.13+/3.0.0+ requires these for IMPORTed targets
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5UiTools REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5X11Extras NO_MODULE QUIET)
find_package(Qt5Core REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Sql REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5UiTools REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5X11Extras NO_MODULE QUIET)
if(Qt5X11Extras_FOUND)
set(HAVE_X11 TRUE)
else()
set(HAVE_X11 FALSE)
endif()
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
if( UNIX AND NOT APPLE )
# We need this to find the paths to qdbusxml2cpp and co
find_package(Qt5DBus REQUIRED)
endif()
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
endif()
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
endif()
macro(setup_qt)
endmacro()
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#FIXME: CrashReporter depends on deprecated QHttp
set(WITH_KDE4 OFF)
endif()
endif()
if( NOT Qt5Core_DIR )
message(STATUS "Could not find Qt5, searching for Qt4 instead...")
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
if( BUILD_GUI )
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
endif()
if( BUILD_TESTS )
list(APPEND NEEDED_QT4_COMPONENTS "QtTest")
endif()
macro_optional_find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS} )
macro_log_feature(QT4_FOUND "Qt" "A cross-platform application and UI framework" "http://qt-project.org" TRUE "" "If you see this, although libqt4-devel is installed, check whether the \n qtwebkit-devel package and whatever contains QtUiTools is installed too")
macro(qt5_use_modules)
endmacro()
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()
macro(qt_add_dbus_interface)
qt4_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt4_add_dbus_adaptor(${ARGN})
endmacro()
macro(setup_qt)
if( NOT BUILD_GUI )
set(QT_DONT_USE_QTGUI TRUE)
endif()
if( UNIX AND NOT APPLE )
set(QT_USE_QTDBUS TRUE)
endif()
set(QT_USE_QTSQL TRUE)
set(QT_USE_QTNETWORK TRUE)
set(QT_USE_QTXML TRUE)
set(QT_USE_QTWEBKIT TRUE)
include( ${QT_USE_FILE} )
endmacro()
# Qt5 C++11 Macros not defined within Qt4
# TODO: Add C++11 support
tomahawk_add_definitions( "-DQ_DECL_FINAL=" )
tomahawk_add_definitions( "-DQ_DECL_OVERRIDE=" )
endif()
if( Qt5Core_DIR )
set( TOMAHAWK_QT5_TMP TRUE)
else( Qt5Core_DIR )
set( TOMAHAWK_QT5_TMP FALSE )
endif( Qt5Core_DIR )
set( TOMAHAWK_QT5 ${TOMAHAWK_QT5_TMP} CACHE BOOL "Build Tomahawk with Qt5")
if( BUILD_GUI AND UNIX AND NOT APPLE )
macro_optional_find_package( X11 )
macro_log_feature(X11_FOUND "X11" "The Xorg libraries" "http://www.x.org/wiki/" TRUE "" "Xorg libraries are used by libqnetwm to bring windows to front reliably")
endif()
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag( "-std=c++11" CXX11_FOUND )
check_cxx_compiler_flag( "-std=c++0x" CXX0X_FOUND )
check_cxx_compiler_flag( "-stdlib=libc++" LIBCPP_FOUND )
if(CXX11_FOUND)
tomahawk_add_cxx_flags( "-std=c++11" )
elseif(CXX0X_FOUND)
tomahawk_add_cxx_flags( "-std=c++0x" )
if(Qt5X11Extras_FOUND)
set(HAVE_X11 TRUE)
else()
message(STATUS "${CMAKE_CXX_COMPILER} does not support C++11, please use a
different compiler")
endif()
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR APPLE) AND LIBCPP_FOUND)
tomahawk_add_cxx_flags( "-stdlib=libc++" )
set(HAVE_X11 FALSE)
endif()
macro_optional_find_package(Echonest 2.3.0)
macro_log_feature(ECHONEST_FOUND "Echonest" "Qt library for communicating with The Echo Nest" "http://projects.kde.org/libechonest" TRUE "" "libechonest 2.3.0 is needed for dynamic playlists and the infosystem")
if( UNIX AND NOT APPLE )
# We need this to find the paths to qdbusxml2cpp and co
find_package(Qt5DBus REQUIRED)
endif()
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
endif()
find_package(Qt5LinguistTools REQUIRED)
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
# FIXME: CrashReporter depends on deprecated QHttp
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Boost REQUIRED COMPONENTS filesystem system)
macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++ source libraries" "http://www.boost.org" TRUE "" "") #FIXME: give useful explanation
@@ -320,11 +212,6 @@ macro_log_feature(Boost_FOUND "Boost" "Provides free peer-reviewed portable C++
macro_optional_find_package(Lucene++ 3.0.0)
macro_log_feature(LUCENEPP_FOUND "Lucene++" "The open-source, C++ search engine" "https://github.com/luceneplusplus/LucenePlusPlus/" TRUE "" "Lucene++ is used for indexing the collection")
if( NOT TOMAHAWK_QT5 )
macro_optional_find_package(QJSON 0.8.1)
macro_log_feature(QJSON_FOUND "QJson" "Qt library that maps JSON data to QVariant objects" "http://qjson.sf.net" TRUE "" "libqjson is used for encoding communication between Tomahawk instances")
ENDIF()
macro_optional_find_package(Taglib 1.8.0)
macro_log_feature(TAGLIB_FOUND "TagLib" "Audio Meta-Data Library" "http://developer.kde.org/~wheeler/taglib.html" TRUE "" "taglib is needed for reading meta data from audio files")
include( CheckTagLibFileName )
@@ -343,23 +230,15 @@ macro_log_feature(GNUTLS_FOUND "GnuTLS"
"http://gnutls.org/" TRUE ""
"GnuTLS is needed for serving the Playdar/HTTP API via TLS")
if( TOMAHAWK_QT5 )
macro_optional_find_package(Qca-qt5)
if(Qca-qt5_DIR)
set(QCA2_FOUND ON CACHE BOOL "QCA2 was found")
set(QCA2_LIBRARIES "qca-qt5" CACHE STRING "QCA2 Qt5 target")
endif()
else()
macro_optional_find_package(QCA2)
macro_optional_find_package(Qca-qt5)
if(Qca-qt5_DIR)
set(QCA2_FOUND ON CACHE BOOL "QCA2 was found")
set(QCA2_LIBRARIES "qca-qt5" CACHE STRING "QCA2 Qt5 target")
endif()
macro_log_feature(QCA2_FOUND "QCA2" "Provides encryption and signing functions necessary for some resolvers and accounts" "http://delta.affinix.com/qca/" TRUE "" "")
if( TOMAHAWK_QT5 )
macro_optional_find_package(KF5Attica 1.0.0)
set(LIBATTICA_FOUND ${KF5Attica_FOUND})
else()
macro_optional_find_package(LibAttica 0.4.0)
endif()
macro_optional_find_package(KF5Attica 1.0.0)
set(LIBATTICA_FOUND ${KF5Attica_FOUND})
macro_log_feature(LIBATTICA_FOUND "libattica" "Provides support for installation of resolvers from the Tomahawk website" "http://download.kde.org/stable/attica/" TRUE "" "")
macro_optional_find_package(QuaZip)
@@ -375,21 +254,13 @@ macro_optional_find_package(LibLastFm 1.0.0)
macro_log_feature(LIBLASTFM_FOUND "liblastfm" "Qt library for the Last.fm webservices" "https://github.com/lastfm/liblastfm" TRUE "" "liblastfm is needed for scrobbling tracks to Last.fm and fetching cover artwork")
if( NOT APPLE )
if( TOMAHAWK_QT5 )
macro_optional_find_package(Qt5Keychain 0.1.0)
else()
macro_optional_find_package(QtKeychain 0.1.0)
endif()
macro_log_feature(QTKEYCHAIN_FOUND "QtKeychain" "Provides support for secure credentials storage" "https://github.com/frankosterfeld/qtkeychain" TRUE "" "")
macro_optional_find_package(Qt5Keychain 0.1.0)
macro_log_feature(Qt5Keychain_FOUND "QtKeychain" "Provides support for secure credentials storage" "https://github.com/frankosterfeld/qtkeychain" TRUE "" "")
endif()
if( UNIX AND NOT APPLE )
macro_optional_find_package(TelepathyQt 0.9.3)
if ( TOMAHAWK_QT5 )
macro_log_feature(TelepathyQt5_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
else ( TOMAHAWK_QT5)
macro_log_feature(TelepathyQt4_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
endif()
macro_log_feature(TelepathyQt5_FOUND "Telepathy-Qt" "Telepathy-Qt is a Qt high-level binding for Telepathy, a D-Bus framework for unifying real time communication." FALSE "" "Telepathy-Qt is needed for sharing Jabber/GTalk accounts with Telepathy.\n")
endif()
# we need pthreads too
@@ -434,23 +305,7 @@ add_subdirectory(${THIRDPARTY_DIR}/libportfwd)
#### submodules end
if (WITH_KDE4)
macro_optional_find_package(KDE4)
macro_optional_find_package(KDE4Installed)
endif(WITH_KDE4)
macro_log_feature(KDE4_FOUND "KDE4" "Provides support for configuring Telepathy Accounts from inside Tomahawk" "https://www.kde.org" FALSE "" "")
IF( KDE4_FOUND )
IF( CMAKE_C_FLAGS )
# KDE4 adds and removes some compiler flags that we don't like
# (only for gcc not for clang e.g.)
STRING( REPLACE "-std=iso9899:1990" "" CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions" )
ENDIF()
ELSE()
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
ENDIF()
SET( CLEAN_C_FLAGS ${CMAKE_C_FLAGS} )
#show dep log
macro_display_feature_log()
@@ -463,11 +318,6 @@ CONFIGURE_FILE(
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
# KDE4 defines an uninstall target for us automatically (and at least with Qt4 Phonon does as well no matter if kdelibs was found)
# IF( NOT KDE4_FOUND )
# ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# ENDIF()
IF( ( NOT APPLE ) AND ( NOT SANITIZE_ADDRESS ))
# Make linking as strict on linux as it is on osx. Then we don't break linking on mac so often
#
@@ -497,6 +347,7 @@ ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( admin )
IF(BUILD_TESTS)
find_package(Qt5Test REQUIRED)
enable_testing()
ADD_SUBDIRECTORY( src/tests )
ENDIF()

View File

@@ -1,42 +0,0 @@
# - Find libechonest
# Find the libechonest includes and the libechonest libraries
# This module defines
# ECHONEST_INCLUDE_DIR, root echonest include dir. Include echonest includes with echonest/foo.h
# ECHONEST_LIBRARIES, the path to libechonest
# ECHONEST_FOUND, whether libechonest was found
FIND_PACKAGE(PkgConfig QUIET)
if( TOMAHAWK_QT5 )
set(LIBECHONEST_SUFFIX "5")
endif()
PKG_CHECK_MODULES(PC_ECHONEST QUIET libechonest${LIBECHONEST_SUFFIX})
FIND_PATH(ECHONEST_INCLUDE_DIR NAMES echonest${LIBECHONEST_SUFFIX}/Track.h
HINTS
${PC_ECHONEST_INCLUDEDIR}
${PC_ECHONEST_INCLUDE_DIRS}
${CMAKE_INSTALL_INCLUDEDIR}
${KDE4_INCLUDE_DIR}
)
FIND_LIBRARY(ECHONEST_LIBRARIES NAMES echonest${LIBECHONEST_SUFFIX}
HINTS
${PC_ECHONEST_LIBDIR}
${PC_ECHONEST_LIBRARY_DIRS}
${CMAKE_INSTALL_LIBDIR}
${KDE4_LIB_DIR}
)
IF(ECHONEST_LIBRARIES AND ECHONEST_INCLUDE_DIR AND NOT PC_ECHONEST_VERSION)
MESSAGE(WARNING "You don't have pkg-config and so the libechonest version check does not work!")
set(PC_ECHONEST_VERSION "999.9.9")
ENDIF()
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Echonest
REQUIRED_VARS ECHONEST_LIBRARIES ECHONEST_INCLUDE_DIR
VERSION_VAR PC_ECHONEST_VERSION)
MARK_AS_ADVANCED(ECHONEST_INCLUDE_DIR ECHONEST_LIBRARIES)

View File

@@ -6,31 +6,22 @@
# LIBJREEN_FOUND, whether libjreen was found
FIND_PACKAGE(PkgConfig QUIET)
if( TOMAHAWK_QT5 )
set(JREEN_LIB_SUFFIX "-qt5")
set(JREEN_INCLUDE_SUFFIX ${JREEN_LIB_SUFFIX})
else()
set(JREEN_INCLUDE_SUFFIX "-qt4")
endif()
PKG_CHECK_MODULES(PC_JREEN QUIET libjreen${JREEN_LIB_SUFFIX})
PKG_CHECK_MODULES(PC_JREEN QUIET libjreen-qt5)
FIND_PATH(JREEN_INCLUDE_DIR NAMES jreen/jreen.h
HINTS
${PC_JREEN_INCLUDEDIR}
${PC_JREEN_INCLUDE_DIRS}
${CMAKE_INSTALL_INCLUDEDIR}
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES
jreen${JREEN_INCLUDE_SUFFIX}
jreen-qt5
)
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen${JREEN_LIB_SUFFIX}
FIND_LIBRARY(JREEN_LIBRARIES NAMES jreen-qt5
HINTS
${PC_JREEN_LIBDIR}
${PC_JREEN_LIBRARY_DIRS}
${CMAKE_INSTALL_LIBDIR}
${KDE4_LIB_DIR}
)
IF(JREEN_LIBRARIES AND JREEN_INCLUDE_DIR AND NOT PC_JREEN_VERSION)

View File

@@ -1,20 +0,0 @@
# Simple hack to detect wether KDE4 is *installed* -- not anything about the development environment!
FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
# For KDE4 kde-config has been renamed to kde4-config
FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde4-config
# the suffix must be used since KDEDIRS can be a list of directories which don't have bin/ appended
PATH_SUFFIXES bin
HINTS
${CMAKE_INSTALL_PREFIX}
${_KDEDIRS}
/opt/kde4
ONLY_CMAKE_FIND_ROOT_PATH
)
IF (KDE4_KDECONFIG_EXECUTABLE)
SET (KDE4_INSTALLED TRUE)
message(STATUS "KDE4 is installed, will install protocol file")
ENDIF (KDE4_KDECONFIG_EXECUTABLE)

View File

@@ -7,21 +7,15 @@
# (c) Dominik Schmidt <dev@dominik-schmidt.de>
#
if( TOMAHAWK_QT5 )
set(LASTFM_LIB_SUFFIX "5")
endif()
# Include dir
find_path(LIBLASTFM_INCLUDE_DIR
# Track.h doesn't exist in liblastfm-0.3.1, was called Track back then
NAMES lastfm${LASTFM_LIB_SUFFIX}/Track.h
PATHS ${KDE4_INCLUDE_DIR}
NAMES lastfm5/Track.h
)
# Finally the library itself
find_library(LIBLASTFM_LIBRARY
NAMES lastfm${LASTFM_LIB_SUFFIX}
PATHS ${KDE4_LIB_DIR}
NAMES lastfm5
)
set(LIBLASTFM_LIBRARIES ${LIBLASTFM_LIBRARY})

View File

@@ -74,10 +74,10 @@ FIND_PATH(LUCENEPP_LIBRARY_DIR
IF (LUCENEPP_LIBRARY_DIR)
MESSAGE(STATUS "Found Lucene++ library dir: ${LUCENEPP_LIBRARY_DIR}")
IF (LUCENEPP_VERSION STRLESS "${LUCENEPP_MIN_VERSION}")
IF (LUCENEPP_VERSION VERSION_LESS "${LUCENEPP_MIN_VERSION}")
MESSAGE(ERROR " Lucene++ version ${LUCENEPP_VERSION} is less than the required minimum ${LUCENEPP_MIN_VERSION}")
SET(LUCENEPP_GOOD_VERSION FALSE)
ENDIF (LUCENEPP_VERSION STRLESS "${LUCENEPP_MIN_VERSION}")
ENDIF (LUCENEPP_VERSION VERSION_LESS "${LUCENEPP_MIN_VERSION}")
ENDIF (LUCENEPP_LIBRARY_DIR)
IF(LUCENEPP_INCLUDE_DIR AND LUCENEPP_LIBRARIES AND LUCENEPP_LIBRARY_DIR AND LUCENEPP_GOOD_VERSION)

View File

@@ -1,89 +0,0 @@
# - Try to find the OggVorbis libraries
# Once done this will define
#
# OGGVORBIS_FOUND - system has OggVorbis
# OGGVORBIS_VERSION - set either to 1 or 2
# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
# OGG_LIBRARY - The Ogg library
# VORBIS_LIBRARY - The Vorbis library
# VORBISFILE_LIBRARY - The VorbisFile library
# VORBISENC_LIBRARY - The VorbisEnc library
# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include (CheckLibraryExists)
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
find_library(OGG_LIBRARY NAMES ogg)
find_library(VORBIS_LIBRARY NAMES vorbis)
find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
find_library(VORBISENC_LIBRARY NAMES vorbisenc)
mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
set(OGGVORBIS_FOUND TRUE)
set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
if (HAVE_LIBVORBISENC2)
set (OGGVORBIS_VERSION 2)
else (HAVE_LIBVORBISENC2)
set (OGGVORBIS_VERSION 1)
endif (HAVE_LIBVORBISENC2)
else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
set (OGGVORBIS_VERSION)
set(OGGVORBIS_FOUND FALSE)
endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
if (OGGVORBIS_FOUND)
if (NOT OggVorbis_FIND_QUIETLY)
message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
endif (NOT OggVorbis_FIND_QUIETLY)
else (OGGVORBIS_FOUND)
if (OggVorbis_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find OggVorbis libraries")
endif (OggVorbis_FIND_REQUIRED)
if (NOT OggVorbis_FIND_QUITELY)
message(STATUS "Could NOT find OggVorbis libraries")
endif (NOT OggVorbis_FIND_QUITELY)
endif (OGGVORBIS_FOUND)
#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
# message(STATUS "Ogg/Vorbis found")
# set (VORBIS_LIBS "-lvorbis -logg")
# set (VORBISFILE_LIBS "-lvorbisfile")
# set (VORBISENC_LIBS "-lvorbisenc")
# set (OGGVORBIS_FOUND TRUE)
# if (HAVE_LIBVORBISENC2)
# set (HAVE_VORBIS 2)
# else (HAVE_LIBVORBISENC2)
# set (HAVE_VORBIS 1)
# endif (HAVE_LIBVORBISENC2)
#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
# message(STATUS "Ogg/Vorbis not found")
#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)

View File

@@ -1,29 +0,0 @@
# Find QJSON - JSON handling library for Qt
#
# This module defines
# QJSON_FOUND - whether the qsjon library was found
# QJSON_LIBRARIES - the qjson library
# QJSON_INCLUDE_DIR - the include path of the qjson library
#
find_library (QJSON_LIBRARIES
NAMES
qjson
PATHS
${QJSON_LIBRARY_DIRS}
${LIB_INSTALL_DIR}
${KDE4_LIB_DIR}
)
find_path (QJSON_INCLUDE_DIR
NAMES
qjson/parser.h
PATHS
${QJSON_INCLUDE_DIRS}
${INCLUDE_INSTALL_DIR}
${KDE4_INCLUDE_DIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)

View File

@@ -5,22 +5,12 @@
# QTSPARKLE_LIBRARY, the path to qtsparkle
# QTSPARKLE_FOUND, whether qtsparkle was found
if( TOMAHAWK_QT5 )
set(QTSPARKLE_SUFFIX "-qt5")
else()
set(QTSPARKLE_SUFFIX "")
endif()
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle${QTSPARKLE_SUFFIX}/Updater
HINTS
${CMAKE_INSTALL_INCLUDEDIR}
${KDE4_INCLUDE_DIR}
FIND_PATH(QTSPARKLE_INCLUDE_DIR NAMES qtsparkle-qt5/Updater
HINTS ${CMAKE_INSTALL_INCLUDEDIR}
)
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle${QTSPARKLE_SUFFIX}
HINTS
${CMAKE_INSTALL_LIBDIR}
${KDE4_LIB_DIR}
FIND_LIBRARY(QTSPARKLE_LIBRARIES NAMES qtsparkle-qt5
HINTS ${CMAKE_INSTALL_LIBDIR}
)
INCLUDE(FindPackageHandleStandardArgs)

View File

@@ -9,18 +9,15 @@ IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
# in cache already
SET(QUAZIP_FOUND TRUE)
ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
IF (Qt5Core_FOUND)
set(QUAZIP_LIB_VERSION_SUFFIX 5)
ENDIF()
IF (WIN32)
FIND_PATH(QUAZIP_LIBRARY_DIR
WIN32_DEBUG_POSTFIX d
NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll
NAMES libquazip5.dll
HINTS "C:/Programme/" "C:/Program Files"
PATH_SUFFIXES QuaZip/lib
)
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip${QUAZIP_LIB_VERSION_SUFFIX}.dll HINTS ${QUAZIP_LIBRARY_DIR})
FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip${QUAZIP_LIB_VERSION_SUFFIX})
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip5.dll HINTS ${QUAZIP_LIBRARY_DIR})
FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip5)
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h)
ELSE(WIN32)
FIND_PACKAGE(PkgConfig)
@@ -28,12 +25,12 @@ ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
pkg_check_modules(PC_QUAZIP quazip)
FIND_LIBRARY(QUAZIP_LIBRARIES
WIN32_DEBUG_POSTFIX d
NAMES quazip${QUAZIP_LIB_VERSION_SUFFIX}
NAMES quazip5
HINTS /usr/lib /usr/lib64
)
FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h
HINTS /usr/include /usr/local/include
PATH_SUFFIXES quazip${QUAZIP_LIB_VERSION_SUFFIX}
PATH_SUFFIXES quazip5
)
FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include)
ENDIF (WIN32)

View File

@@ -61,7 +61,6 @@ ELSE()
tag.h
PATH_SUFFIXES taglib
PATHS
${KDE4_INCLUDE_DIR}
${INCLUDE_INSTALL_DIR}
)
@@ -69,7 +68,6 @@ ELSE()
WIN32_DEBUG_POSTFIX d
NAMES tag
PATHS
${KDE4_LIB_DIR}
${LIB_INSTALL_DIR}
)

View File

@@ -2,25 +2,14 @@
include(FindPackageHandleStandardArgs)
if( NOT BUILD_WITH_QT4 )
find_package(TelepathyQt5 NO_MODULE)
set(TelepathyQt_FOUND ${TelepathyQt5_FOUND})
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT5_VERSION})
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT5_INSTALL_DIR})
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT5_INCLUDE_DIR})
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT5_LIB_DIR})
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT5_SHARE_DIR})
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT5_LIBRARIES})
else()
find_package(TelepathyQt4 NO_MODULE)
set(TelepathyQt_FOUND ${TelepathyQt4_FOUND})
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT4_VERSION})
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT4_INSTALL_DIR})
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT4_INCLUDE_DIR})
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT4_LIB_DIR})
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT4_SHARE_DIR})
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT4_LIBRARIES})
endif()
find_package(TelepathyQt5 NO_MODULE)
set(TelepathyQt_FOUND ${TelepathyQt5_FOUND})
set(TELEPATHY_QT_VERSION ${TELEPATHY_QT5_VERSION})
set(TELEPATHY_QT_INSTALL_DIR ${TELEPATHY_QT5_INSTALL_DIR})
set(TELEPATHY_QT_INCLUDE_DIR ${TELEPATHY_QT5_INCLUDE_DIR})
set(TELEPATHY_QT_LIB_DIR ${TELEPATHY_QT5_LIB_DIR})
set(TELEPATHY_QT_SHARE_DIR ${TELEPATHY_QT5_SHARE_DIR})
set(TELEPATHY_QT_LIBRARIES ${TELEPATHY_QT5_LIBRARIES})
set(TELEPATHY_QT_FOUND ${TelepathyQt_FOUND})

View File

@@ -1,182 +0,0 @@
# - Define GNU standard installation directories
# Provides install directory variables as defined for GNU software:
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
# Inclusion of this module defines the following variables:
# CMAKE_INSTALL_<dir> - destination for files of a given type
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
# where <dir> is one of:
# BINDIR - user executables (bin)
# SBINDIR - system admin executables (sbin)
# LIBEXECDIR - program executables (libexec)
# SYSCONFDIR - read-only single-machine data (etc)
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
# LOCALSTATEDIR - modifiable single-machine data (var)
# LIBDIR - object code libraries (lib or lib64)
# INCLUDEDIR - C header files (include)
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
# DATAROOTDIR - read-only architecture-independent data root (share)
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
# INFODIR - info documentation (DATAROOTDIR/info)
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
# MANDIR - man documentation (DATAROOTDIR/man)
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
# install() commands for the corresponding file type. If the includer does
# not define a value the above-shown default will be used and the value will
# appear in the cache for editing by the user.
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
# from the corresponding destination by prepending (if necessary) the value
# of CMAKE_INSTALL_PREFIX.
#=============================================================================
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
# Copyright 2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Installation directories
#
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(_LIBDIR_DEFAULT "lib")
# Override this default 'lib' with 'lib64' iff:
# - we are on Linux system but NOT cross-compiling
# - we are NOT on debian
# - we are on a 64 bits system
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# Note that the future of multi-arch handling may be even
# more complicated than that: http://wiki.debian.org/Multiarch
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING
AND NOT EXISTS "/etc/debian_version")
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
"Please enable at least one language before including GNUInstallDirs.")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
endif()
endif()
endif()
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
endif()
#-----------------------------------------------------------------------------
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
# the cache and store the defaults in local variables if the cache values are
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
if(NOT CMAKE_INSTALL_DATADIR)
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(NOT CMAKE_INSTALL_INFODIR)
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
endif()
if(NOT CMAKE_INSTALL_LOCALEDIR)
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
endif()
if(NOT CMAKE_INSTALL_MANDIR)
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
endif()
if(NOT CMAKE_INSTALL_DOCDIR)
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
endif()
#-----------------------------------------------------------------------------
mark_as_advanced(
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_SBINDIR
CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_LOCALEDIR
CMAKE_INSTALL_MANDIR
CMAKE_INSTALL_DOCDIR
)
# Result directories
#
foreach(dir
BINDIR
SBINDIR
LIBEXECDIR
SYSCONFDIR
SHAREDSTATEDIR
LOCALSTATEDIR
LIBDIR
INCLUDEDIR
OLDINCLUDEDIR
DATAROOTDIR
DATADIR
INFODIR
LOCALEDIR
MANDIR
DOCDIR
)
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
else()
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
endif()
endforeach()

View File

@@ -93,7 +93,7 @@ MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
SET_PACKAGE_PROPERTIES("${_package}" PROPERTIES DESCRIPTION "\"${_description}\"" URL "${_url}" PURPOSE "\"${_comments}\"")
ENDIF(COMMAND SET_PACKAGE_INFO)
ENDMACRO(MACRO_LOG_FEATURE)

2
Docker/Docker.variables Normal file
View File

@@ -0,0 +1,2 @@
DOCKER_IMAGE_NAME=tomahawkmusicplayer/ubuntu
DOCKER_IMAGE_VER=latest

274
Docker/Dockerfile Normal file
View File

@@ -0,0 +1,274 @@
FROM ubuntu:19.04 as base
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
ninja-build \
openssh-client \
curl \
gnupg2 \
gosu \
wget \
locales \
git \
subversion \
make \
pkg-config \
unzip \
xz-utils \
software-properties-common \
sudo \
apt-utils \
&& rm -rf /var/lib/apt/lists/*
# LLVM/Clang
ENV CLANG_VERSION=9
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& apt-add-repository "deb http://apt.llvm.org/disco/ llvm-toolchain-disco-$CLANG_VERSION main" \
&& apt-get update && apt-get install -y \
clang-$CLANG_VERSION \
clang-tidy-$CLANG_VERSION \
clang-format-$CLANG_VERSION \
llvm-$CLANG_VERSION-dev \
libclang-$CLANG_VERSION-dev \
&& update-alternatives \
--install /usr/bin/clang clang /usr/bin/clang-$CLANG_VERSION 100 \
--slave /usr/bin/clang++ clang++ /usr/bin/clang++-$CLANG_VERSION \
--slave /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$CLANG_VERSION \
--slave /usr/bin/clang-format clang-format /usr/bin/clang-format-$CLANG_VERSION
# GCC
ENV GCC_VERSION=9
RUN sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
g++-$GCC_VERSION \
gcc-$GCC_VERSION \
&& sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
# Tomahawk deps
RUN sudo apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
libattica-dev \
libboost-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-thread-dev \
libfftw3-dev \
libgnutls28-dev \
libgsasl7-dev \
liblastfm-dev \
liblastfm5-dev \
liblucene++-dev \
libphonon-dev \
libphononexperimental-dev \
libqca-qt5-2-dev \
libqca2-dev \
libqca2-plugins \
libqjson-dev \
libqt5svg5-dev \
libqt5webkit5-dev \
libqt5webkit5\
libsamplerate0-dev \
libsparsehash-dev \
libssl-dev \
libtelepathy-qt5-dev \
libvlc-dev \
libvlccore-dev \
libx11-dev \
libz-dev \
qt5-default \
qtbase5-dev \
qttools5-dev \
qttools5-dev-tools \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 https://github.com/zaphoyd/websocketpp.git --branch master --single-branch websocketpp \
&& mkdir websocketpp/build && cd websocketpp/build \
&& cmake .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r websocketpp
RUN git clone --depth 1 https://github.com/frankosterfeld/qtkeychain.git --branch master --single-branch qtkeychain \
&& mkdir qtkeychain/build && cd qtkeychain/build \
&& cmake .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r qtkeychain
RUN git clone --depth 1 https://github.com/taglib/taglib.git --branch master --single-branch taglib \
&& mkdir taglib/build && cd taglib/build \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r taglib
RUN git clone --depth 1 https://anongit.kde.org/extra-cmake-modules.git --branch master --single-branch ecm \
&& mkdir ecm/build && cd ecm/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r ecm
RUN git clone --depth 1 https://github.com/KDE/attica.git --branch master --single-branch attica \
&& mkdir attica/build && cd attica/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r attica
RUN git clone --depth 1 https://github.com/stachenov/quazip.git --branch master --single-branch quazip \
&& mkdir quazip/build && cd quazip/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r quazip
RUN git clone --depth 1 https://github.com/euroelessar/jreen.git --branch master --single-branch jreen \
&& mkdir jreen/build && cd jreen/build \
&& cmake -DCMAKE_BUILD_TYPE=Release .. \
&& sudo cmake --build . -j 16 --target install \
&& cd ../.. \
&& rm -r jreen
# MXE deps
RUN sudo apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
automake \
autopoint \
bash \
bison \
bzip2 \
flex \
g++ \
g++-multilib \
gettext \
git \
gperf \
intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \
libssl-dev \
libtool-bin \
libxml-parser-perl \
lzip \
make \
openssl \
p7zip-full \
patch \
perl \
pkg-config \
python \
ruby \
sed \
unzip \
wget \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 https://github.com/mxe/mxe.git --branch master --single-branch mxe \
&& sudo mv mxe /opt/mxe
ENV MXE_PATH=/opt/mxe
ENV MXE_TOOLCHAIN="i686-w64-mingw32.shared"
ENV MXE_CMAKE=i686-w64-mingw32.shared-cmake
ENV MXE_PLUGINS=/opt/mxe/plugins/gcc9
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qt5
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qttools
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
boost
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
cc \
qca \
qtsparkle \
nsis \
liblastfm \
libgsasl
RUN cd $MXE_PATH \
&& sudo make MXE_TARGETS=$MXE_TOOLCHAIN MXE_PLUGIN_DIRS=$MXE_PLUGINS \
qtwebkit \
sparsehash
ENV PATH=/opt/mxe/usr/bin:$PATH
RUN sudo chmod -R 777 /opt/mxe/.ccache
RUN git clone --depth 1 https://anongit.kde.org/extra-cmake-modules.git --branch master --single-branch ecm \
&& mkdir ecm/build && cd ecm/build \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r ecm
RUN git clone --depth 1 https://github.com/zaphoyd/websocketpp.git --branch master --single-branch websocketpp \
&& mkdir websocketpp/build && cd websocketpp/build \
&& $MXE_CMAKE .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r websocketpp
RUN git clone --depth 1 https://github.com/frankosterfeld/qtkeychain.git --branch master --single-branch qtkeychain \
&& mkdir qtkeychain/build && cd qtkeychain/build \
&& $MXE_CMAKE .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r qtkeychain
RUN git clone --depth 1 https://github.com/taglib/taglib.git --branch master --single-branch taglib \
&& mkdir taglib/build && cd taglib/build \
&& $MXE_CMAKE -DCMAKE_INSTALL_PREFIX=/opt/mxe/usr \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r taglib
RUN git clone --depth 1 https://github.com/KDE/attica.git --branch master --single-branch attica \
&& mkdir attica/build && cd attica/build \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r attica
RUN git clone --depth 1 https://github.com/stachenov/quazip.git --branch master --single-branch quazip \
&& mkdir quazip/build && cd quazip/build \
&& $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
&& $MXE_CMAKE --build . -j 16 --target install \
&& cd ../.. \
&& rm -r quazip
#RUN git clone --depth 1 https://github.com/euroelessar/jreen.git --branch master --single-branch jreen \
# && mkdir jreen/build && cd jreen/build \
# && $MXE_CMAKE -DCMAKE_BUILD_TYPE=Release .. \
# && $MXE_CMAKE -build . -j 16 --target install \
# && cd ../.. \
# && rm -r jreen
# Language
ENV LANG=en_US.UTF-8
RUN echo "$LANG UTF-8" > /etc/locale.gen && locale-gen $LANG && update-locale LANG=$LANG
#entrypoint, if it is last here makes it easy to build new image without rebuilding all layers
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY build-and-test.sh /usr/local/bin/build-and-test.sh
RUN chmod +x /usr/local/bin/build-and-test.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
WORKDIR /tmp/workspace

8
Docker/build-and-test.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE:-Debug} ..
ninja
ninja install
env CTEST_OUTPUT_ON_FAILURE=1 ninja test

79
Docker/docker-commands.sh Executable file
View File

@@ -0,0 +1,79 @@
#!/bin/bash
get_repository_root(){
local REPOSITORY_ROOT="$(git rev-parse --show-toplevel)"
echo "$REPOSITORY_ROOT"
}
get_repository_subdir(){
REPOSITORY_ROOT=$(get_repository_root)
CUR_DIR=$(pwd)
SUB_DIR=$(echo "$CUR_DIR" | grep -oP "^$REPOSITORY_ROOT\K.*")
echo "$SUB_DIR"
}
# Run commands inside docker container
_docker_run() {
REPOSITORY_ROOT=$(get_repository_root)
SUB_DIR=$(get_repository_subdir)
echo "SUB_DIR: " "$SUB_DIR"
source $REPOSITORY_ROOT/Docker/Docker.variables
echo "Starting container: " "$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER"
echo "Got command: " "$*"
USER_ID=$(id -u $USER)
echo "Using USER_ID:" $USER_ID
docker run --env LOCAL_USER_ID=$USER_ID \
--rm \
--volume $REPOSITORY_ROOT:/tmp/workspace \
--workdir /tmp/workspace$SUB_DIR \
--env "TERM=xterm-256color" \
--tty \
--privileged \
"$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER" \
$*
}
# 1st command: Run make target inside docker
docker-make() {
_docker_run make "${@}"
}
# 2nd command: Run bash command inside docker
docker-run() {
_docker_run "${@}"
}
# 3rd command: Run bash interactive inside docker
docker-interactive() {
REPOSITORY_ROOT=$(get_repository_root)
SUB_DIR=$(get_repository_subdir)
echo "SUB_DIR: " "$SUB_DIR"
source $REPOSITORY_ROOT/Docker/Docker.variables
echo "Starting container: " "$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER"
echo "Got command: " "$*"
USER_ID=$(id -u $USER)
echo "Using USER_ID:" $USER_ID
docker run --env LOCAL_USER_ID=$USER_ID \
--rm \
--interactive \
--volume $REPOSITORY_ROOT:/tmp/workspace \
--workdir /tmp/workspace$SUB_DIR \
--env "TERM=xterm-256color" \
--tty \
"$DOCKER_IMAGE_NAME:$DOCKER_IMAGE_VER" /bin/bash
}
docker-help() {
echo "docker-make - Run a make target inside docker container"
echo "docker-run - Run a specific bash command inside docker container and remove container on exit"
echo "docker-interactive - Start an interactive bash session inside docker container and remove it on exit"
echo "docker-help - Show this help text"
}

32
Docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# Add local user
# Either use the LOCAL_USER_ID if passed in at runtime or
# fallback
USER_ID=${LOCAL_USER_ID:-9001}
USER=docker
UPWD=Docker!
echo "Starting with USER: $USER and UID : $USER_ID"
useradd --shell /bin/bash -u $USER_ID -o -c "docker user" -m "$USER"
export HOME=/home/$USER
# Add user to sudoers
echo "docker ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/10-installer
# Add root password
echo "root":$UPWD | chpasswd
# Add user password
echo "$USER:$UPWD" | chpasswd
if [ -z "$CLANG_VERSION" ]; then
echo "No CLANG_VERSION set"
else
echo "alias clang=clang-$CLANG_VERSION" >> $HOME/.bashrc
echo "alias clang-tidy=clang-tidy-$CLANG_VERSION" >> $HOME/.bashrc
echo "alias clang-format=clang-format-$CLANG_VERSION" >> $HOME/.bashrc
fi
export PATH=/opt/mxe/usr/bin:$PATH
# Startup user
exec gosu "$USER" "$@"

View File

@@ -39,18 +39,10 @@ Tomahawk provides some tools that help highlight where crashes (of course we onl
Build the account plugin for Hatchet (http://hatchet.is). Requires [websocketpp](https://github.com/zaphoyd/websocketpp).
##### ```BUILD_WITH_QT4``` (boolean) (default: ON)
This enforces CMake to link against Qt4 regardless of whether Qt5 was found or not. Currently Qt4 is still our main development target, so this is still recommended. If you feel adventurous or are preparing Qt5 repositories for your distribution, feel free to give ```-DBUILD_WITH_QT4=OFF``` a shot.
##### ```WITH_CRASHREPORTER``` (boolean) (default: ON)
The crash reporter is built by default if libcrashreporter-qt is available in ```thirdparty/libcrashreporter-qt/``` (for example via git submodule). Usually distributions don't allow packagers to upload debug symbols to the Tomahawk HQ so to give crash reports more meaning for us, that's why we have no standardised submit process in place yet. If you can do that in your distribution, please get in touch with us!
##### ```WITH_KDE``` (boolean) (default: ON)
The KDE Telepathy plugin to configure Telepathy accounts from our Telepathy plugin can be disabled, if for some reason KDE is available in your build environment but you don't need this plugin.
##### ```WITH_UPOWER``` (boolean) (default on Linux: ON)
Build with support for UPower events.

View File

@@ -1,3 +1,7 @@
# This project is essentially abandoned
There is no one working on it.
There isn't much sense in adding any new issues in the issue tracker unless you want to fix them yourself.
# WHAT TOMAHAWK IS
Tomahawk is a free multi-source and cross-platform music player. An application that can play not only your local files, but also stream from services like Spotify, Beats, SoundCloud, Google Music, YouTube and many others. You can even connect with your friends' Tomahawks, share your musical gems or listen along with them. Let the music play!
@@ -73,13 +77,12 @@ You can download one of our nightly or stable builds:
Required dependencies:
* [CMake 3](http://www.cmake.org/)
* [Qt 5.4.0](http://qt-project.org/)
* [Qt >= 5.4.0](http://qt-project.org/)
* [VLC 2.1.0](https://videolan.org/vlc/)
* [SQLite 3.6.22](http://www.sqlite.org/)
* [TagLib 1.8](https://taglib.github.io/)
* [Boost 1.3](http://www.boost.org/)
* [Lucene++ 3.0.6](https://github.com/luceneplusplus/LucenePlusPlus/)
* [libechonest 2.3.1](http://projects.kde.org/projects/playground/libs/libechonest/)
* [Attica 5.6.0](http://ftp.kde.org/stable/attica/)
* [QuaZip 0.4.3](http://quazip.sourceforge.net/)
* [liblastfm 1.0.9](https://github.com/lastfm/liblastfm/)
@@ -87,6 +90,10 @@ Required dependencies:
* [Sparsehash](https://code.google.com/p/sparsehash/)
* [GnuTLS](http://gnutls.org/)
If you are using Qt>5.6 you need to build and install QtWebKit
* [QtWebKit](https://github.com/qt/qtwebkit)
The following dependencies are optional (but *recommended*):
* [Jreen 1.1.1](http://qutim.org/jreen/)

View File

@@ -25,13 +25,13 @@ function(tomahawk_add_library)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(LIBRARY_UI)
qt_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
qt5_wrap_ui(LIBRARY_UI_SOURCES ${LIBRARY_UI})
list(APPEND LIBRARY_SOURCES ${LIBRARY_UI_SOURCES})
endif()
# add resources from current dir
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources.qrc")
qt_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
qt5_add_resources(LIBRARY_RC_SOURCES "resources.qrc")
list(APPEND LIBRARY_SOURCES ${LIBRARY_RC_SOURCES})
unset(LIBRARY_RC_SOURCES)
endif()
@@ -45,9 +45,6 @@ function(tomahawk_add_library)
add_library(${target} SHARED ${LIBRARY_SOURCES})
endif()
# HACK: add qt modules - every lib should define its own set of modules
qt5_use_modules(${target} Core Network Widgets Sql Xml ${LIBRARY_QT5_MODULES})
# definitions - can this be moved into set_target_properties below?
add_definitions(${QT_DEFINITIONS})
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
@@ -70,12 +67,12 @@ function(tomahawk_add_library)
endif()
# add link targets
target_link_libraries(${target} ${TOMAHAWK_LIBRARIES})
target_link_libraries(${target} PRIVATE ${TOMAHAWK_LIBRARIES})
if(LIBRARY_LINK_LIBRARIES)
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
target_link_libraries(${target} PUBLIC ${LIBRARY_LINK_LIBRARIES})
endif()
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
target_link_libraries(${target} PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
endif()
# add soversion

View File

@@ -1,105 +1,3 @@
#FIXME: this duplicates top level cmakelists: how can we reduce code duplication?
set( TOMAHAWK_QT5 @TOMAHAWK_QT5@ )
if(TOMAHAWK_QT5)
message(STATUS "Found Qt5! Be aware that Qt5-support is still experimental and not officially supported!")
# CMAKE 2.8.13+/3.0.0+ requires these for IMPORTed targets
find_package(Qt5Core REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(Qt5UiTools REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Sql REQUIRED)
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
# We need this to find the paths to qdbusxml2cpp and co
find_package(Qt5DBus REQUIRED)
endif()
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif()
if(WIN32)
find_package(Qt5WinExtras REQUIRED)
endif()
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
if( UNIX AND NOT APPLE )
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
macro(qt_add_dbus_adaptor)
qt5_add_dbus_adaptor(${ARGN})
endmacro()
endif()
macro(setup_qt)
endmacro()
set(QT_RCC_EXECUTABLE "${Qt5Core_RCC_EXECUTABLE}")
#FIXME: CrashReporter depends on deprecated QHttp
set(WITH_KDE4 OFF)
else(TOMAHAWK_QT5)
find_package(Qt4 COMPONENTS QtNetwork QtCore QtGui QtSql REQUIRED)
include( ${QT_USE_FILE} )
set(NEEDED_QT4_COMPONENTS "QtCore" "QtXml" "QtNetwork")
if(BUILD_GUI OR NOT DEFINED BUILD_GUI)
list(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" "QtUiTools" "QtSvg")
endif()
find_package(Qt4 4.7.0 COMPONENTS ${NEEDED_QT4_COMPONENTS})
include( ${QT_USE_FILE} )
macro(qt5_use_modules)
endmacro()
macro(qt_wrap_ui)
qt4_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro()
endif(TOMAHAWK_QT5)
if(NOT TOMAHAWK_CMAKE_DIR)
set(TOMAHAWK_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
endif()

View File

@@ -46,7 +46,7 @@ CERT_SIGNER=$2
cd ..
if [ -f ~/sign_step.sh ];
then
~/sign_step.sh "$CERT_SIGNER" "${TARGET_NAME}.app" || true
~/sign_step.sh "$CERT_SIGNER" "${TARGET_NAME}.app"
fi
header "Creating DMG"

View File

@@ -1,12 +0,0 @@
[Protocol]
exec=/path/to/binary "%u"
protocol=tomahawk
input=none
output=none
helper=true
listing=
reading=false
writing=false
makedir=false
deleting=false

View File

@@ -9,7 +9,7 @@ fi
rm -rvf vlc/
VLC_TARBALL="vlc-2.2.3.tar.bz2"
VLC_TARBALL="vlc.tar.bz2"
echo "Download phonon archive..."
# wget -c "http://downloads.sourceforge.net/project/vlc/1.1.9/win32/vlc-1.1.9-win32.7z?r=http%3A%2F%2Fwww.videolan.org%2Fvlc%2Fdownload-windows.html&ts=1306272584&use_mirror=leaseweb"

View File

@@ -42,6 +42,8 @@ Tomahawk.apiVersion = "0.2.2";
//Statuses considered a success for HTTP request
var httpSuccessStatuses = [200, 201];
Tomahawk.error = console.error;
// install RSVP error handler for uncaught(!) errors
RSVP.on('error', function (reason) {
var resolverName = "";
@@ -49,9 +51,9 @@ RSVP.on('error', function (reason) {
resolverName = Tomahawk.resolver.instance.settings.name + " - ";
}
if (reason) {
console.error(resolverName + 'Uncaught error:', reason);
Tomahawk.error(resolverName + 'Uncaught error:', reason);
} else {
console.error(resolverName + 'Uncaught error: error thrown from RSVP but it was empty');
Tomahawk.error(resolverName + 'Uncaught error: error thrown from RSVP but it was empty');
}
});
@@ -273,6 +275,9 @@ Tomahawk.Resolver = {
getStreamUrl: function (params) {
return params;
},
getDownloadUrl: function (params) {
return params;
},
resolve: function() {
},
_adapter_resolve: function (params) {
@@ -300,13 +305,15 @@ Tomahawk.Resolver = {
},
_adapter_testConfig: function (config) {
return RSVP.Promise.resolve(this.testConfig(config)).then(function () {
return {result: Tomahawk.ConfigTestResultType.Success};
return RSVP.Promise.resolve(this.testConfig(config)).then(function (results) {
results = results || Tomahawk.ConfigTestResultType.Success;
return results;
}, function (error) {
return error;
});
}
};
// help functions
Tomahawk.valueForSubNode = function (node, tag) {
@@ -377,48 +384,6 @@ Tomahawk.retrievedMetadata = function (metadataId, metadata, error) {
delete Tomahawk.retrieveMetadataCallbacks[metadataId];
};
/**
* Internal counter used to identify asyncRequest callback from native code.
*/
Tomahawk.asyncRequestIdCounter = 0;
/**
* Internal map used to map asyncRequestIds to the respective javascript
* callback functions.
*/
Tomahawk.asyncRequestCallbacks = {};
/**
* Pass the natively retrieved reply back to the javascript callback
* and augment the fake XMLHttpRequest object.
*
* Internal use only!
*/
Tomahawk.nativeAsyncRequestDone = function (reqId, xhr) {
// Check that we have a matching callback stored.
if (!Tomahawk.asyncRequestCallbacks.hasOwnProperty(reqId)) {
return;
}
// Call the real callback
if (xhr.readyState == 4 && httpSuccessStatuses.indexOf(xhr.status) != -1) {
// Call the real callback
if (Tomahawk.asyncRequestCallbacks[reqId].callback) {
Tomahawk.asyncRequestCallbacks[reqId].callback(xhr);
}
} else if (xhr.readyState === 4) {
Tomahawk.log("Failed to do nativeAsyncRequest");
Tomahawk.log("Status Code was: " + xhr.status);
if (Tomahawk.asyncRequestCallbacks[reqId].errorHandler) {
Tomahawk.asyncRequestCallbacks[reqId].errorHandler(xhr);
}
}
// Callbacks are only used once.
delete Tomahawk.asyncRequestCallbacks[reqId];
};
/**
* This method is externalized from Tomahawk.asyncRequest, so that other clients
* (like tomahawk-android) can inject their own logic that determines whether or not to do a request
@@ -433,9 +398,9 @@ var shouldDoNativeRequest = function (options) {
|| extraHeaders.hasOwnProperty("User-Agent")));
};
/**
* Possible options:
* - url: The URL to call
* - method: The HTTP request method (default: GET)
* - username: The username for HTTP Basic Auth
* - password: The password for HTTP Basic Auth
@@ -453,7 +418,12 @@ var doRequest = function(options) {
return this.responseHeaders;
};
xhr.getResponseHeader = function (header) {
return this.responseHeaders[header];
for(key in xhr.responseHeaders) {
if(key.toLowerCase() === header.toLowerCase()) {
return xhr.responseHeaders[key];
}
}
return null;
};
return xhr;
@@ -745,7 +715,6 @@ Tomahawk.base64Encode = function (b) {
return window.btoa(b);
};
Tomahawk.PluginManager = {
wrapperPrefix: '_adapter_',
objects: {},
@@ -776,8 +745,6 @@ Tomahawk.PluginManager = {
methodName = this.wrapperPrefix + methodName;
}
var pluginManager = this;
if (!this.objects[objectId]) {
Tomahawk.log("Object not found! objectId: " + objectId + " methodName: " + methodName);
} else {
@@ -798,20 +765,21 @@ Tomahawk.PluginManager = {
invoke: function (requestId, objectId, methodName, params) {
RSVP.Promise.resolve(this.invokeSync(requestId, objectId, methodName, params))
.then(function (result) {
Tomahawk.reportScriptJobResults({
var params = {
requestId: requestId,
data: result
});
};
Tomahawk.reportScriptJobResults(encodeParamsToNativeFunctions(params));
}, function (error) {
Tomahawk.reportScriptJobResults({
var params = {
requestId: requestId,
error: error
});
};
Tomahawk.reportScriptJobResults(encodeParamsToNativeFunctions(params));
});
}
};
var encodeParamsToNativeFunctions = function(param) {
return param;
};
@@ -825,7 +793,7 @@ Tomahawk.NativeScriptJobManager = {
var requestId = this.idCounter++;
var deferred = RSVP.defer();
this.deferreds[requestId] = deferred;
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));;
Tomahawk.invokeNativeScriptJob(requestId, methodName, encodeParamsToNativeFunctions(params));
return deferred.promise;
},
reportNativeScriptJobResult: function(requestId, result) {
@@ -1494,9 +1462,7 @@ Tomahawk.Collection = {
return new RSVP.Promise(function (resolve, reject) {
that.cachedDbs[id].changeVersion(that.cachedDbs[id].version, "", null,
function (err) {
if (console.error) {
console.error("Error!: %o", err);
}
Tomahawk.error("Error trying to change db version!", err);
reject();
}, function () {
delete that.cachedDbs[id];
@@ -1800,6 +1766,9 @@ Tomahawk.Collection = {
this.settings.capabilities = [Tomahawk.Collection.BrowseCapability.Artists,
Tomahawk.Collection.BrowseCapability.Albums,
Tomahawk.Collection.BrowseCapability.Tracks];
if (!this.settings.weight && this.resolver && this.resolver.settings.weight) {
this.settings.weight = this.resolver.settings.weight;
}
return this.settings;
},
@@ -1808,6 +1777,14 @@ Tomahawk.Collection = {
return this.resolver.getStreamUrl(params);
}
return params;
},
getDownloadUrl: function(params) {
if(this.resolver) {
return this.resolver.getDownloadUrl(params);
}
return params;
}
};

View File

@@ -19,9 +19,11 @@ macro(add_tomahawk_translations language)
set( tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</qresource>\n" )
set( tomahawk_i18n_qrc_content "${tomahawk_i18n_qrc_content}</RCC>\n" )
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc "${tomahawk_i18n_qrc_content}" )
# Write file and configure it aferwards to make it a BYPRODUCT: https://gitlab.kitware.com/cmake/cmake/issues/16367
file( WRITE ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc.in "${tomahawk_i18n_qrc_content}" )
configure_file(${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc.in ${CMAKE_BINARY_DIR}/lang/tomahawk_i18n.qrc COPYONLY)
qt_add_translation(QM_FILES ${TS_FILES})
qt5_add_translation(QM_FILES ${TS_FILES})
## HACK HACK HACK - around rcc limitations to allow out of source-tree building
set( trans_file tomahawk_i18n )

View File

@@ -1,7 +1,5 @@
include( ${PROJECT_BINARY_DIR}/TomahawkUse.cmake )
setup_qt()
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/libtomahawk )
include_directories( ${CMAKE_CURRENT_LIST_DIR}/libtomahawk )

View File

@@ -25,11 +25,6 @@
#include "utils/Logger.h"
#include "TomahawkSettings.h"
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "Source.h"
#endif
// remove now playing status after PAUSE_TIMEOUT seconds
static const int PAUSE_TIMEOUT = 10;

View File

@@ -44,12 +44,12 @@ namespace Tomahawk {
void publishTune( QUrl url, Tomahawk::InfoSystem::InfoStringHash trackInfo );
public slots:
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData );
void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData ) override;
protected slots:
void init();
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData );
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData );
void init() override;
void pushInfo( Tomahawk::InfoSystem::InfoPushData pushData ) override;
void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData ) override;
private slots:
void audioStarted( const Tomahawk::InfoSystem::PushInfoPair& pushInfoPair );

View File

@@ -66,29 +66,6 @@ using namespace Accounts;
#define TOMAHAWK_CAP_NODE_NAME QLatin1String( "http://tomahawk-player.org/" )
#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 )
void
JreenMessageHandler( QtMsgType type, const char *msg )
{
switch ( type )
{
case QtDebugMsg:
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Debug:" << msg;
break;
case QtWarningMsg:
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Warning:" << msg;
break;
case QtCriticalMsg:
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Critical:" << msg;
break;
case QtFatalMsg:
tDebug( LOGTHIRDPARTY ).nospace() << JREEN_LOG_INFIX << ":" << "Fatal:" << msg;
abort();
}
}
#endif
XmppSipPlugin::XmppSipPlugin( Account* account )
: SipPlugin( account )
, m_state( Account::Disconnected )
@@ -96,9 +73,6 @@ XmppSipPlugin::XmppSipPlugin( Account* account )
, m_xmlConsole( nullptr )
, m_pubSubManager( nullptr )
{
#if QT_VERSION <= QT_VERSION_CHECK( 5, 0, 0 )
Jreen::Logger::addHandler( JreenMessageHandler );
#endif
m_currentUsername = readUsername();
m_currentServer = readServer();

View File

@@ -54,14 +54,14 @@ public:
Account::ConnectionState connectionState() const;
public slots:
void connectPlugin();
void disconnectPlugin();
void connectPlugin() override;
void disconnectPlugin() override;
void advertise();
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) {}
virtual void sendSipInfos( const Tomahawk::peerinfo_ptr& /* receiver */, const QList<SipInfo>& /* info */ ) override {}
void broadcastMsg( const QString& ) {}
bool addContact( const QString&, AddContactOptions, const QString& ) { return false; }
bool addContact( const QString&, AddContactOptions, const QString& ) override { return false; }
private slots:
void lanHostFound( const QString& host, int port, const QString& name, const QString& nodeid );

View File

@@ -3,13 +3,11 @@ cmake_policy(SET CMP0017 NEW)
set(TOMAHAWK_CRASH_REPORTER_TARGET ${TOMAHAWK_BASE_TARGET_NAME}_crash_reporter)
setup_qt()
list(APPEND crashreporter_SOURCES main.cpp)
list(APPEND crashreporter_RC resources.qrc)
qt_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
qt_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
qt5_wrap_ui( crashreporter_UI_HEADERS ${crashreporter_UI} )
qt5_add_resources( crashreporter_RC_RCC ${crashreporter_RC} )
if(BUILD_RELEASE)
@@ -43,7 +41,7 @@ target_link_libraries( ${TOMAHAWK_CRASH_REPORTER_TARGET}
${QT_LIBRARIES}
)
target_link_libraries(${TOMAHAWK_CRASH_REPORTER_TARGET} Qt5::Widgets Qt5::Network)
set_target_properties(${TOMAHAWK_CRASH_REPORTER_TARGET} PROPERTIES AUTOMOC ON)
install(TARGETS ${TOMAHAWK_CRASH_REPORTER_TARGET} RUNTIME DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
qt5_use_modules(${TOMAHAWK_CRASH_REPORTER_TARGET} Widgets Network)

View File

@@ -1,5 +1,4 @@
include_directories(
${ECHONEST_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
)
if(WIN32 OR APPLE)
@@ -15,14 +14,13 @@ endif()
endif(WIN32 OR APPLE)
list(APPEND simple_plugins
Echonest
Charts
NewReleases
Spotify
#Spotify
Hypem
MusixMatch
MusicBrainz
Rovi
#Rovi
Discogs
)

View File

@@ -23,11 +23,7 @@
#include "utils/Logger.h"
#include "utils/NetworkAccessManager.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <echonest5/ArtistTypes.h>
#else
#include <echonest/ArtistTypes.h>
#endif
#include <QNetworkConfiguration>

View File

@@ -25,11 +25,7 @@
#include "infosystem/InfoSystem.h"
#include "infosystem/InfoSystemWorker.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <echonest5/Artist.h>
#else
#include <echonest/Artist.h>
#endif
#include <QObject>

View File

@@ -22,6 +22,7 @@
#include "utils/TomahawkUtils.h"
#include "utils/Logger.h"
#include "utils/NetworkAccessManager.h"
#include "TomahawkVersion.h"
#include <QNetworkReply>
#include <QDomDocument>
@@ -88,6 +89,16 @@ MusicBrainzPlugin::getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
}
}
QNetworkReply*
MusicBrainzPlugin::getUrl(QUrl url, QVariant requestData)
{
QNetworkRequest request = QNetworkRequest( url );
QByteArray userAgent = TomahawkUtils::userAgentString( TOMAHAWK_APPLICATION_NAME, TOMAHAWK_VERSION ).toUtf8();
request.setRawHeader( "User-Agent", userAgent );
QNetworkReply* reply = Tomahawk::Utils::nam()->get( request );
reply->setProperty( "requestData", requestData );
return reply;
}
void
MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requestData )
@@ -111,8 +122,7 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
connect( reply, SIGNAL( finished() ), SLOT( gotReleaseGroupsSlot() ) );
@@ -131,8 +141,7 @@ MusicBrainzPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
TomahawkUtils::urlAddQueryItem( url, "limit", "100" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* reply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
QNetworkReply* reply = getUrl( url, QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
connect( reply, SIGNAL( finished() ), SLOT( gotReleasesSlot() ) );
@@ -154,6 +163,7 @@ MusicBrainzPlugin::gotReleaseGroupsSlot()
if ( !oldReply )
return; //timeout will handle it
oldReply->deleteLater();
tDebug() << Q_FUNC_INFO << "HTTP response code:" << oldReply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
QDomDocument doc;
doc.setContent( oldReply->readAll() );
@@ -237,8 +247,7 @@ MusicBrainzPlugin::gotReleasesSlot()
TomahawkUtils::urlAddQueryItem( url, "inc", "recordings" );
tDebug() << Q_FUNC_INFO << url.toString();
QNetworkReply* newReply = Tomahawk::Utils::nam()->get( QNetworkRequest( url ) );
newReply->setProperty( "requestData", oldReply->property( "requestData" ) );
QNetworkReply* newReply = getUrl( url, oldReply->property( "requestData" ) );
connect( newReply, SIGNAL( finished() ), SLOT( gotRecordingsSlot() ) );
break;
@@ -261,6 +270,8 @@ MusicBrainzPlugin::gotRecordingsSlot()
return; //timeout will handle it
reply->deleteLater();
tDebug() << Q_FUNC_INFO << "HTTP response code:" << reply->attribute( QNetworkRequest::HttpStatusCodeAttribute ).toInt();
QDomDocument doc;
doc.setContent( reply->readAll() );
QDomNodeList mediumList = doc.elementsByTagName( "medium-list" );

View File

@@ -59,6 +59,7 @@ private slots:
void gotReleaseGroupsSlot();
void gotReleasesSlot();
void gotRecordingsSlot();
QNetworkReply* getUrl( QUrl url, QVariant requestData );
};
}

View File

@@ -2,13 +2,14 @@ SET(fdo_srcs
fdonotify/FdoNotifyPlugin.cpp
fdonotify/ImageConverter.cpp
)
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES})
qt_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
SET(FDO_LINK_LIBRARIES ${LINK_LIBRARIES} Qt5::DBus)
qt5_add_dbus_interface(fdo_srcs fdonotify/org.freedesktop.Notifications.xml
FreedesktopNotificationsProxy)
tomahawk_add_plugin(fdonotify
TYPE infoplugin EXPORT_MACRO INFOPLUGINDLLEXPORT_PRO
SOURCES "${fdo_srcs}" LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
SOURCES "${fdo_srcs}"
LINK_LIBRARIES "${FDO_LINK_LIBRARIES}"
)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -16,9 +17,9 @@ SET(mpris_srcs
mpris/MprisPlugin.cpp
)
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginRootAdaptor.xml
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginRootAdaptor MprisPluginRootAdaptor)
qt_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
qt5_add_dbus_adaptor(mpris_srcs mpris/MprisPluginPlayerAdaptor.xml
mpris/MprisPlugin.h Tomahawk::InfoSystem::MprisPlugin MprisPluginPlayerAdaptor MprisPluginPlayerAdaptor)
tomahawk_add_plugin(mpris

View File

@@ -55,11 +55,6 @@
#include <QDBusPendingCallWatcher>
#include <QImage>
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
// QTextDocument provides Qt::escape()
#include <QTextDocument>
#endif
namespace Tomahawk
{
@@ -67,11 +62,7 @@ namespace InfoSystem
{
QString escapeHtml( const QString& str ) {
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
return str.toHtmlEscaped();
#else
return Qt::escape( str );
#endif
}
FdoNotifyPlugin::FdoNotifyPlugin()
@@ -80,7 +71,7 @@ FdoNotifyPlugin::FdoNotifyPlugin()
, m_wmSupportsBodyMarkup( false )
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoTrackUnresolved << InfoNowStopped << InfoInboxReceived;
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoNowResumed << InfoTrackUnresolved << InfoNowStopped << InfoInboxReceived;
// Query the window manager for its capabilties in styling notifications.
notifications_interface = new org::freedesktop::Notifications( "org.freedesktop.Notifications", "/org/freedesktop/Notifications",
@@ -139,6 +130,7 @@ FdoNotifyPlugin::pushInfo( Tomahawk::InfoSystem::InfoPushData pushData )
return;
case Tomahawk::InfoSystem::InfoNowPlaying:
case Tomahawk::InfoSystem::InfoNowResumed:
nowPlaying( pushData.infoPair.second );
return;

View File

@@ -27,12 +27,6 @@
#include "../../InfoPluginDllMacro.h"
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "PlaylistInterface.h"
#endif
#include <QObject>
#include <QVariant>
#include <QtDBus/QtDBus>

View File

@@ -24,6 +24,7 @@ tomahawk_add_library(${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}
qtcertificateaddon
${GNUTLS_LIBRARIES}
EXPORT TomahawkLibraryDepends
EXPORT_MACRO TOMAHAWK_WIDGETS_EXPORT_PRO
VERSION ${TOMAHAWK_VERSION_SHORT}
)

View File

@@ -23,7 +23,7 @@
#include <QtCore/qglobal.h>
#ifndef TOMAHAWK_PLAYDARAPI_EXPORT
# if defined (tomahawk_playdarapi_EXPORTS)
# if defined (TOMAHAWK_WIDGETS_EXPORT_PRO)
# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_EXPORT
# else
# define TOMAHAWK_PLAYDARAPI_EXPORT Q_DECL_IMPORT

View File

@@ -13,5 +13,6 @@ tomahawk_add_library(${TOMAHAWK_WIDGETS_LIBRARY_TARGET}
SOURCES ${${TOMAHAWK_WIDGETS_LIBRARY_TARGET}_SOURCES}
UI ${${TOMAHAWK_WIDGETS_LIBRARY_TARGET}_UI}
EXPORT TomahawkLibraryDepends
EXPORT_MACRO TOMAHAWK_WIDGETS_EXPORT_PRO
VERSION ${TOMAHAWK_VERSION_SHORT}
)

View File

@@ -64,7 +64,7 @@ PlaylistDelegate::PlaylistDelegate()
void
PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption( &opt, QModelIndex() );
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );

View File

@@ -23,7 +23,7 @@
#include <QtCore/qglobal.h>
#ifndef TOMAHAWK_WIDGETS_EXPORT
# if defined (tomahawk_widgets_EXPORTS)
# if defined (TOMAHAWK_WIDGETS_EXPORT_PRO)
# define TOMAHAWK_WIDGETS_EXPORT Q_DECL_EXPORT
# else
# define TOMAHAWK_WIDGETS_EXPORT Q_DECL_IMPORT

View File

@@ -30,11 +30,6 @@
#include <QCoreApplication>
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "Query.h"
#endif
ActionCollection* ActionCollection::s_instance = 0;
ActionCollection* ActionCollection::instance()
@@ -120,9 +115,12 @@ ActionCollection::initActions()
m_actionCollection[ "createPlaylist" ] = new QAction( tr( "Create Playlist" ), this );
m_actionCollection[ "createPlaylist" ]->setShortcut( QKeySequence( "Ctrl+N" ) );
m_actionCollection[ "createPlaylist" ]->setShortcutContext( Qt::ApplicationShortcut );
// echonest is dead, disable stations
/*
m_actionCollection[ "createStation" ] = new QAction( tr( "Create Station" ), this );
m_actionCollection[ "createStation" ]->setShortcut( QKeySequence( "Ctrl+S" ) );
m_actionCollection[ "createStation" ]->setShortcutContext( Qt::ApplicationShortcut );
*/
#ifdef Q_OS_MAC
m_actionCollection[ "minimize" ] = new QAction( tr( "Minimize" ), this );
m_actionCollection[ "minimize" ]->setShortcut( QKeySequence( "Ctrl+M" ) );
@@ -171,7 +169,8 @@ ActionCollection::createMenuBar( QWidget *parent )
controlsMenu->addAction( m_actionCollection[ "showOfflineSources" ] );
controlsMenu->addSeparator();
controlsMenu->addAction( m_actionCollection[ "createPlaylist" ] );
controlsMenu->addAction( m_actionCollection[ "createStation" ] );
// echonest is dead, disable stations
// controlsMenu->addAction( m_actionCollection[ "createStation" ] );
controlsMenu->addAction( m_actionCollection[ "importPlaylist" ] );
controlsMenu->addAction( m_actionCollection[ "updateCollection" ] );
controlsMenu->addAction( m_actionCollection[ "rescanCollection" ] );

View File

@@ -25,11 +25,6 @@
#include <QPixmap>
#include <QFuture>
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "collection/Collection.h"
#endif
#include "infosystem/InfoSystem.h"
#include "DllMacro.h"
#include "Typedefs.h"

View File

@@ -74,9 +74,6 @@ set( libGuiSources
playlist/dynamic/DynamicPlaylist.cpp
playlist/dynamic/DynamicView.cpp
playlist/dynamic/DynamicModel.cpp
playlist/dynamic/echonest/EchonestGenerator.cpp
playlist/dynamic/echonest/EchonestControl.cpp
playlist/dynamic/echonest/EchonestSteerer.cpp
playlist/dynamic/widgets/DynamicWidget.cpp
playlist/dynamic/widgets/DynamicControlWrapper.cpp
playlist/dynamic/widgets/DynamicControlList.cpp
@@ -146,6 +143,7 @@ set( libGuiSources
widgets/ClickableLabel.cpp
widgets/ComboBox.cpp
widgets/DropDownButton.cpp
widgets/DownloadButton.cpp
widgets/ElidedLabel.cpp
widgets/FilterHeader.cpp
widgets/CaptionLabel.cpp
@@ -175,14 +173,6 @@ if(QCA2_FOUND)
set( libGuiSources ${libGuiSources} utils/GroovesharkParser.cpp )
endif()
if(UNIX AND NOT APPLE AND NOT Qt5Core_DIR)
if(BUILD_GUI AND X11_FOUND)
include_directories( ${THIRDPARTY_DIR}/libqnetwm )
list(APPEND libSources ${libSources} ${THIRDPARTY_DIR}/libqnetwm/libqnetwm/netwm.cpp)
list(APPEND LINK_LIBRARIES ${X11_LIBRARIES})
endif()
endif()
list(APPEND libSources
TomahawkSettings.cpp
SourceList.cpp
@@ -207,7 +197,6 @@ list(APPEND libSources
PlaylistInterface.cpp
UrlHandler.cpp
EchonestCatalogSynchronizer.cpp
accounts/AccountManager.cpp
accounts/Account.cpp
@@ -412,7 +401,6 @@ include_directories(
${QT_INCLUDE_DIR}
${QJSON_INCLUDE_DIR}
${ECHONEST_INCLUDE_DIR}
${LUCENEPP_INCLUDE_DIRS}
${LIBVLC_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
@@ -426,9 +414,7 @@ IF(LIBATTICA_FOUND)
SET( libGuiSources ${libGuiSources} AtticaManager.cpp )
INCLUDE_DIRECTORIES( ${LIBATTICA_INCLUDE_DIR} )
LIST(APPEND PRIVATE_LINK_LIBRARIES ${LIBATTICA_LIBRARIES} ${LibAttica_LIBRARIES} ${QUAZIP_LIBRARIES})
IF( TOMAHAWK_QT5 )
LIST(APPEND LINK_LIBRARIES KF5::Attica )
ENDIF( TOMAHAWK_QT5 )
LIST(APPEND LINK_LIBRARIES KF5::Attica)
ENDIF(LIBATTICA_FOUND)
if(HAVE_X11)
@@ -490,7 +476,7 @@ IF(BUILD_GUI)
LIST(APPEND libSources ${libGuiSources} )
ENDIF()
qt_wrap_ui(libUI_H ${libUI})
qt5_wrap_ui(libUI_H ${libUI})
SET( libSources ${libSources} ${libUI_H} )
@@ -504,12 +490,12 @@ set_target_properties(
OUTPUT_NAME ${TOMAHAWK_BASE_TARGET_NAME}
)
qt5_use_modules(${TOMAHAWK_LIBRARY} Widgets Network Sql WebKitWidgets Concurrent Xml UiTools Svg)
IF(APPLE)
qt5_use_modules(${TOMAHAWK_LIBRARY} MacExtras)
ENDIF()
target_link_libraries(${TOMAHAWK_LIBRARY} PUBLIC
Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebKitWidgets Qt5::Concurrent Qt5::Xml Qt5::UiTools Qt5::Svg
)
if(APPLE)
target_link_libraries(${TOMAHAWK_LIBRARY} PRIVATE Qt5::MacExtras)
endif()
IF(QCA2_FOUND)
INCLUDE_DIRECTORIES( ${QCA2_INCLUDE_DIR} )
@@ -518,11 +504,9 @@ ENDIF(QCA2_FOUND)
IF( UNIX AND NOT APPLE )
LIST(APPEND LINK_LIBRARIES ${QT_QTDBUS_LIBRARIES} )
qt5_use_modules(${TOMAHAWK_LIBRARY} DBus)
ENDIF( UNIX AND NOT APPLE )
TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
LINK_PRIVATE
TARGET_LINK_LIBRARIES(${TOMAHAWK_LIBRARY} PRIVATE
${LIBVLC_LIBRARY}
# Thirdparty shipped with tomahawk
@@ -530,11 +514,10 @@ TARGET_LINK_LIBRARIES( ${TOMAHAWK_LIBRARY}
${QTKEYCHAIN_LIBRARIES}
${PRIVATE_LINK_LIBRARIES}
LINK_PUBLIC
PUBLIC
# External deps
${QJSON_LIBRARIES}
${LUCENEPP_LIBRARIES}
${ECHONEST_LIBRARIES}
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_QTGUI_LIBRARY}
@@ -578,7 +561,7 @@ file( GLOB networkHeaders "network/*.h" )
file( GLOB playlistHeaders "playlist/*.h" )
file( GLOB playlistDynamicHeaders "playlist/dynamic/*.h" )
file( GLOB playlistDynamicDatabaseHeaders "playlist/dynamic/database/*.h" )
file( GLOB playlistDynamicEchonestHeaders "playlist/dynamic/echonest/*.h" )
# file( GLOB playlistDynamicEchonestHeaders "playlist/dynamic/echonest/*.h" )
file( GLOB playlistDynamicWidgetsHeaders "playlist/dynamic/widgets/*.h" )
file( GLOB resolversHeaders "resolvers/*.h" )
file( GLOB sipHeaders "sip/*.h" )
@@ -607,7 +590,7 @@ install( FILES ${networkHeaders} DESTINATION include/libtomahawk/network )
install( FILES ${playlistHeaders} DESTINATION include/libtomahawk/playlist )
install( FILES ${playlistDynamicHeaders} DESTINATION include/libtomahawk/playlist/dynamic )
install( FILES ${playlistDynamicDatabaseHeaders} DESTINATION include/libtomahawk/playlist/dynamic/database )
install( FILES ${playlistDynamicEchonestHeaders} DESTINATION include/libtomahawk/playlist/dynamic/echonest )
# install( FILES ${playlistDynamicEchonestHeaders} DESTINATION include/libtomahawk/playlist/dynamic/echonest )
install( FILES ${playlistDynamicWidgetsHeaders} DESTINATION include/libtomahawk/playlist/dynamic/widgets )
install( FILES ${resolversHeaders} DESTINATION include/libtomahawk/resolvers )
install( FILES ${sipHeaders} DESTINATION include/libtomahawk/sip )

View File

@@ -226,8 +226,7 @@ ContextMenu::setQueries( const QList<Tomahawk::query_ptr>& queries )
if ( m_supportedActions & ActionOpenFileManager &&
queries.length() == 1 &&
queries.first()->numResults() &&
queries.first()->results().first()->resolvedByCollection() &&
queries.first()->results().first()->resolvedByCollection()->isLocal() )
queries.first()->results().first()->isLocal() )
{
m_sigmap->setMapping( addAction( ImageRegistry::instance()->icon( RESPATH "images/folder.svg" ),
tr( "Open Folder in File Manager..." ) ), ActionOpenFileManager );

View File

@@ -118,7 +118,7 @@ DownloadJob::localFile() const
QString
DownloadJob::localPath() const
DownloadJob::localPath( const Tomahawk::album_ptr& album )
{
QDir dir = TomahawkSettings::instance()->downloadsPath();
@@ -127,7 +127,7 @@ DownloadJob::localPath() const
dir.mkpath( "." );
}
QString path = QString( "%1/%2" ).arg( safeEncode( m_track->artist(), true ) ).arg( safeEncode( m_track->album(), true ) );
QString path = QString( "%1/%2" ).arg( safeEncode( album->artist()->name(), true ) ).arg( safeEncode( album->name(), true ) );
dir.mkpath( path );
return QString( dir.path() + "/" + path ).replace( "//", "/" );
@@ -138,7 +138,7 @@ QUrl
DownloadJob::prepareFilename()
{
QString filename = QString( "%1. %2.%3" ).arg( m_track->albumpos() ).arg( safeEncode( m_track->track() ) ).arg( m_format.extension );
QString path = localPath();
QString path = localPath( m_track->albumPtr() );
QString localFile = QString( path + "/" + filename );
if ( !m_tryResuming )
@@ -206,22 +206,17 @@ DownloadJob::download()
{
if ( m_state == Running )
return true;
setState( Running );
if ( m_result->resolvedByCollection() )
{
Tomahawk::ScriptCollection* collection = qobject_cast<Tomahawk::ScriptCollection*>( m_result->resolvedByCollection().data() );
if ( collection )
{
QVariantMap arguments;
arguments[ "url" ] = m_format.url;
// HACK: *shrug* WIP.
Tomahawk::ScriptJob* job = collection->scriptObject()->invoke( "getStreamUrl", arguments );
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
job->start();
}
if (m_result->resolvedBy() != nullptr) {
Tomahawk::ScriptJob *job = m_result->resolvedBy()->getDownloadUrl( m_result, m_format );
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
job->start();
} else {
onUrlRetrieved({{"url", m_format.url}});
}
return true;
}
@@ -444,7 +439,7 @@ DownloadJob::checkForResumedFile()
QString
DownloadJob::safeEncode( const QString& filename, bool removeTrailingDots ) const
DownloadJob::safeEncode( const QString& filename, bool removeTrailingDots )
{
//FIXME: make it a regexp
QString res = QString( filename ).toLatin1().replace( "/", "_" ).replace( "\\", "_" )

View File

@@ -58,7 +58,7 @@ public:
long receivedSize() const { return m_rcvdSize; }
long fileSize() const { return m_fileSize; }
QString localPath() const;
static QString localPath( const Tomahawk::album_ptr& album );
QString localFile() const;
DownloadFormat format() const;
@@ -90,7 +90,7 @@ private slots:
private:
void storeState();
QString safeEncode( const QString& filename, bool removeTrailingDots = false ) const;
static QString safeEncode( const QString& filename, bool removeTrailingDots = false );
bool checkForResumedFile();
QUrl prepareFilename();

View File

@@ -24,6 +24,8 @@
#include "TomahawkSettings.h"
#include "infosystem/InfoSystem.h"
#include "utils/Logger.h"
#include "Result.h"
#include "Query.h"
DownloadManager* DownloadManager::s_instance = 0;
@@ -85,6 +87,36 @@ DownloadManager::localFileForDownload( const QString& url ) const
}
QUrl
DownloadManager::localUrlForDownload( const Tomahawk::query_ptr& query ) const
{
Tomahawk::result_ptr result = query->numResults( true ) ? query->results().first() : Tomahawk::result_ptr();
if ( result )
{
return localUrlForDownload( result );
}
return QUrl();
}
QUrl
DownloadManager::localUrlForDownload( const Tomahawk::result_ptr& result ) const
{
if ( result && !result->downloadFormats().isEmpty() &&
!localFileForDownload( result->downloadFormats().first().url.toString() ).isEmpty() )
{
return QUrl::fromLocalFile( QFileInfo( DownloadManager::instance()->localFileForDownload( result->downloadFormats().first().url.toString() ) ).absolutePath() );
}
else if ( result && result->downloadJob() && result->downloadJob()->state() == DownloadJob::Finished )
{
return QUrl::fromLocalFile( QFileInfo( result->downloadJob()->localFile() ).absolutePath() );
}
return QUrl();
}
void
DownloadManager::storeJobs( const QList<downloadjob_ptr>& jobs )
{

View File

@@ -45,6 +45,8 @@ public:
void storeJobs( const QList<downloadjob_ptr>& jobs );
QString localFileForDownload( const QString& url ) const;
QUrl localUrlForDownload( const Tomahawk::result_ptr& result ) const;
QUrl localUrlForDownload( const Tomahawk::query_ptr& query ) const;
public slots:
bool addJob( const downloadjob_ptr& job );

View File

@@ -980,7 +980,7 @@ DropJob::removeRemoteSources()
foreach ( const Tomahawk::result_ptr& result, item->results() )
{
if ( !result->resolvedByCollection().isNull() && !result->resolvedByCollection()->isLocal() )
if ( !result->isLocal() )
{
list.append( item );
break;

View File

@@ -34,13 +34,8 @@
#include "TomahawkSettings.h"
#include "Track.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <echonest5/CatalogUpdateEntry.h>
#include <echonest5/Config.h>
#else
#include <echonest/CatalogUpdateEntry.h>
#include <echonest/Config.h>
#endif
using namespace Tomahawk;

View File

@@ -22,11 +22,7 @@
#include "DllMacro.h"
#include "Query.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <echonest5/Catalog.h>
#else
#include <echonest/Catalog.h>
#endif
#include <QObject>
#include <QQueue>

View File

@@ -1,14 +1,14 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
* Copyright (C) 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright (C) 2011-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright (C) 2013, Uwe L. Korn <uwelk@xhochy.com>
* Copyright (C) 2013, Teo Mrnjavac <teo@kde.org>
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011-2016, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2011, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Uwe L. Korn <uwelk@xhochy.com>
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
*
* Tomahawk 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 2 of the License, or
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tomahawk is distributed in the hope that it will be useful,
@@ -20,7 +20,6 @@
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "GlobalActionManager.h"
#include "accounts/AccountManager.h"
@@ -47,12 +46,6 @@
#include "TomahawkSettings.h"
#include "ViewManager.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <echonest5/Playlist.h>
#else
#include <echonest/Playlist.h>
#endif
#include <QMessageBox>
#include <QFileInfo>
@@ -913,144 +906,144 @@ GlobalActionManager::loadDynamicPlaylist( const QUrl& url, bool station )
{
dyncontrol_ptr c = pl->generator()->createControl( "Artist" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistRadioType ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistRadioType ) );
// controls << c;
}
else if ( param.first == "artist_limitto" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Artist" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistType ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistType ) );
// controls << c;
}
else if ( param.first == "description" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Artist Description" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistDescriptionType ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistDescriptionType ) );
// controls << c;
}
else if ( param.first == "variety" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Variety" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Variety ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Variety ) );
// controls << c;
}
else if ( param.first.startsWith( "tempo" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Tempo" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinTempo + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinTempo + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "duration" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Duration" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDuration + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDuration + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "loudness" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Loudness" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinLoudness + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinLoudness + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "danceability" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Danceability" );
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDanceability + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinDanceability + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "energy" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Energy" );
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinEnergy + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::MinEnergy + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "artist_familiarity" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Artist Familiarity" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinFamiliarity + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinFamiliarity + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "artist_hotttnesss" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Artist Hotttnesss" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinHotttnesss + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinHotttnesss + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "song_hotttnesss" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Song Hotttnesss" );
int extra = param.first.endsWith( "_max" ) ? -1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongMinHotttnesss + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongMinHotttnesss + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "longitude" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Longitude" );
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLongitude + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLongitude + extra ) );
// controls << c;
}
else if ( param.first.startsWith( "latitude" ) )
{
dyncontrol_ptr c = pl->generator()->createControl( "Latitude" );
int extra = param.first.endsWith( "_max" ) ? 1 : 0;
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLatitude + extra ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::ArtistMinLatitude + extra ) );
// controls << c;
}
else if ( param.first == "key" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Key" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Key ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Key ) );
// controls << c;
}
else if ( param.first == "mode" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Mode" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mode ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mode ) );
// controls << c;
}
else if ( param.first == "mood" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Mood" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mood ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Mood ) );
// controls << c;
}
else if ( param.first == "style" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Style" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Style ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::Style ) );
// controls << c;
}
else if ( param.first == "song" )
{
dyncontrol_ptr c = pl->generator()->createControl( "Song" );
c->setInput( param.second );
c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongRadioType ) );
controls << c;
// c->setMatch( QString::number( (int)Echonest::DynamicPlaylist::SongRadioType ) );
// controls << c;
}
}

View File

@@ -1,21 +1,21 @@
/*
Copyright (C) 2011 Leo Franchi <lfranchi@kde.org>
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2011, Leo Franchi <lfranchi@kde.org>
* Copyright 2011-2016, Christian Muehlhaeuser <muesli@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GLOBALACTIONMANAGER_H
#define GLOBALACTIONMANAGER_H

View File

@@ -29,11 +29,6 @@
#include <QAction>
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "Result.h"
#endif
using namespace Tomahawk;

View File

@@ -36,7 +36,7 @@
#define MAX_CONCURRENT_QUERIES 16
#define CLEANUP_TIMEOUT 5 * 60 * 1000
#define MINSCORE 0.5
#define DEFAULT_RESOLVER_TIMEOUT 5000 //5 seconds
#define DEFAULT_RESOLVER_TIMEOUT 5000 // 5 seconds
using namespace Tomahawk;
@@ -542,12 +542,12 @@ Pipeline::shuntNext()
q->setCurrentResolver( 0 );
}
//Zero-patient, a stub so that query is not resolved until we go through
//all resolvers
//As query considered as 'finished trying to resolve' when there are no
//more qid entries in qidsState we'll put one as sort of 'keep this until
//we kick off all our resolvers' entry
//once we kick off all resolvers we'll remove this entry
// Zero-patient, a stub so that query is not resolved until we go through
// all resolvers
// As query considered as 'finished trying to resolve' when there are no
// more qid entries in qidsState we'll put one as sort of 'keep this until
// we kick off all our resolvers' entry
// once we kick off all resolvers we'll remove this entry
incQIDState( q, nullptr );
checkQIDState( q );
}
@@ -673,7 +673,7 @@ Pipeline::decQIDState( const Tomahawk::query_ptr& query, Tomahawk::Resolver* r )
{
{
QMutexLocker lock( &d->mut );
d->qidsState.remove( query->id(), r );//Removes all matching pairs
d->qidsState.remove( query->id(), r ); // Removes all matching pairs
}
checkQIDState( query );

View File

@@ -289,9 +289,4 @@ private:
Q_DECLARE_METATYPE( QSharedPointer< Tomahawk::Playlist > )
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
// Qt5 automatically generated this Metatype
Q_DECLARE_METATYPE( QList< QSharedPointer< Tomahawk::Query > > )
#endif
#endif // PLAYLIST_H

View File

@@ -194,7 +194,7 @@ Query::addResults( const QList< Tomahawk::result_ptr >& newresults )
}*/
d->results << newresults;
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
sortResults();
// hook up signals, and check solved status
foreach( const result_ptr& rp, newresults )
@@ -258,7 +258,7 @@ Query::onResultStatusChanged()
Q_D( Query );
QMutexLocker lock( &d->mutex );
if ( !d->results.isEmpty() )
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
sortResults();
}
checkResults();
@@ -273,6 +273,11 @@ Query::removeResult( const Tomahawk::result_ptr& result )
Q_D( Query );
QMutexLocker lock( &d->mutex );
d->results.removeAll( result );
if ( d->preferredResult == result )
{
d->preferredResult.clear();
}
sortResults();
}
emit resultsRemoved( result );
@@ -396,12 +401,21 @@ Query::id() const
bool
Query::resultSorter( const result_ptr& left, const result_ptr& right )
{
Q_D( Query );
if ( !d->preferredResult.isNull() )
{
if ( d->preferredResult == left )
return true;
if ( d->preferredResult == right )
return false;
}
const float ls = left->isOnline() ? howSimilar( left ) : 0.0;
const float rs = right->isOnline() ? howSimilar( right ) : 0.0;
if ( ls == rs )
{
if ( right->resolvedByCollection() && right->resolvedByCollection()->isLocal() )
if ( right->isLocal() )
{
return false;
}
@@ -427,6 +441,30 @@ Query::resultSorter( const result_ptr& left, const result_ptr& right )
}
result_ptr
Query::preferredResult() const
{
Q_D( const Query );
return d->preferredResult;
}
void
Query::setPreferredResult( const result_ptr& result )
{
{
Q_D( Query );
QMutexLocker lock( &d->mutex );
Q_ASSERT( d->results.contains( result ) );
d->preferredResult = result;
sortResults();
}
emit resultsChanged();
}
void
Query::setCurrentResolver( Tomahawk::Resolver* resolver )
{
@@ -622,6 +660,10 @@ float
Query::howSimilar( const Tomahawk::result_ptr& r )
{
Q_D( Query );
if (d->howSimilarCache.find(r->id()) != d->howSimilarCache.end())
{
return d->howSimilarCache[r->id()];
}
// result values
const QString& rArtistname = r->track()->artistSortname();
const QString& rAlbumname = r->track()->albumSortname();
@@ -643,10 +685,12 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
qTrackname = queryTrack()->trackSortname();
}
static const QRegExp filterOutChars = QRegExp(QString::fromUtf8("[-`´~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]"));
//Cleanup symbols for minor naming differences
qArtistname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
qTrackname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
qAlbumname.remove(QRegExp(QString::fromUtf8("[-`~!@#$%^&*()_—+=|:;<>«»,.?/{}\'\"\\[\\]\\\\]")));
qArtistname.remove(filterOutChars);
qTrackname.remove(filterOutChars);
qAlbumname.remove(filterOutChars);
// normal edit distance
const int artdist = TomahawkUtils::levenshtein( qArtistname, rArtistname );
@@ -678,12 +722,16 @@ Query::howSimilar( const Tomahawk::result_ptr& r )
const int mlatr = qMax( artistTrackname.length(), rArtistTrackname.length() );
const float dcatr = (float)( mlatr - atrdist ) / mlatr;
return qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
float resultScore = qMax( dctrk, qMax( dcatr, qMax( dcart, dcalb ) ) );
d->howSimilarCache[r->id()] = resultScore;
return resultScore;
}
else
{
// weighted, so album match is worth less than track title
return ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
float resultScore = ( dcart * 4 + dcalb + dctrk * 5 ) / 10;
d->howSimilarCache[r->id()] = resultScore;
return resultScore;
}
}
@@ -734,3 +782,11 @@ Query::setWeakRef( QWeakPointer<Query> weakRef )
Q_D( Query );
d->ownRef = weakRef;
}
void
Query::sortResults()
{
Q_D( Query );
qStableSort( d->results.begin(), d->results.end(), std::bind( &Query::resultSorter, this, std::placeholders::_1, std::placeholders::_2 ) );
}

View File

@@ -112,6 +112,8 @@ public:
/// sorter for list of results
bool resultSorter( const result_ptr& left, const result_ptr& right );
result_ptr preferredResult() const;
void setPreferredResult( const result_ptr& result );
signals:
void resultsAdded( const QList<Tomahawk::result_ptr>& );
@@ -158,6 +160,7 @@ private:
void setCurrentResolver( Tomahawk::Resolver* resolver );
void clearResults();
void checkResults();
void sortResults();
};
} //ns

View File

@@ -4,6 +4,7 @@
#include "Query.h"
#include <QMutex>
#include <map>
namespace Tomahawk
{
@@ -39,6 +40,7 @@ private:
QList< Tomahawk::artist_ptr > artists;
QList< Tomahawk::album_ptr > albums;
QList< Tomahawk::result_ptr > results;
Tomahawk::result_ptr preferredResult;
float score;
bool solved;
@@ -58,6 +60,8 @@ private:
mutable QMutex mutex;
QWeakPointer< Tomahawk::Query > ownRef;
std::map<QString, float> howSimilarCache;
};
} // Tomahawk

View File

@@ -234,6 +234,13 @@ Result::playable() const
}
bool
Result::isLocal() const
{
return resolvedByCollection().isNull() ? false : resolvedByCollection()->isLocal();
}
QVariant
Result::toVariant() const
{

View File

@@ -94,6 +94,12 @@ public:
bool isOnline() const;
bool playable() const;
/**
* @brief whether this result isLocal, i.e. resolved by a local collection
* @return isLocal
*/
bool isLocal() const;
QString url() const;
/**
* Has the given url been checked that it is accessible/valid.

View File

@@ -1,13 +1,9 @@
#include <QtPlugin>
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
#if defined(Q_EXPORT_PLUGIN)
#undef Q_EXPORT_PLUGIN
#undef Q_EXPORT_PLUGIN2
#endif
#if defined(Q_EXPORT_PLUGIN)
#undef Q_EXPORT_PLUGIN
#undef Q_EXPORT_PLUGIN2
#endif
#define Q_EXPORT_PLUGIN(a)
#define Q_EXPORT_PLUGIN2(a, b)
#else
# define Q_PLUGIN_METADATA(a)
#endif
#define Q_EXPORT_PLUGIN(a)
#define Q_EXPORT_PLUGIN2(a, b)

View File

@@ -34,14 +34,8 @@
#include "PlaylistInterface.h"
#include "Source.h"
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
#include <qtkeychain/keychain.h>
#include <QDesktopServices>
#else
#include <qt5keychain/keychain.h>
#include <QStandardPaths>
#endif
#include <qt5keychain/keychain.h>
#include <QStandardPaths>
#include <QDir>
using namespace Tomahawk;
@@ -733,11 +727,7 @@ TomahawkSettings::genericCacheVersion() const
QString
TomahawkSettings::storageCacheLocation() const
{
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
return QStandardPaths::writableLocation( QStandardPaths::CacheLocation );
#else
return QDesktopServices::storageLocation( QDesktopServices::CacheLocation );
#endif
}
@@ -746,11 +736,7 @@ TomahawkSettings::scannerPaths() const
{
QString musicLocation;
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
musicLocation = QStandardPaths::writableLocation( QStandardPaths::MusicLocation );
#else
musicLocation = QDesktopServices::storageLocation( QDesktopServices::MusicLocation );
#endif
return value( "scanner/paths", musicLocation ).toStringList();
}
@@ -1764,3 +1750,15 @@ TomahawkSettings::setPlaydarKey( const QByteArray& key )
setValue( "playdar/key", key );
}
QString
TomahawkSettings::vlcArguments() const
{
return value( "vlc/cmdline_args" ).value< QString >();
}
void
TomahawkSettings::setVlcArguments( const QString& args )
{
setValue( "vlc/cmdline_args", args);
}

View File

@@ -253,6 +253,10 @@ public:
QByteArray playdarKey() const;
void setPlaydarKey( const QByteArray& key );
// VLC Settings
QString vlcArguments() const;
void setVlcArguments( const QString& arguments );
signals:
void changed();
void recentlyPlayedPlaylistAdded( const QString& playlistId, int sourceId );

View File

@@ -213,19 +213,11 @@ Track::init()
Q_D( Track );
updateSortNames();
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
QObject::connect( d->trackData.data(), &TrackData::attributesLoaded, this, &Track::attributesLoaded );
QObject::connect( d->trackData.data(), &TrackData::socialActionsLoaded, this, &Track::socialActionsLoaded );
QObject::connect( d->trackData.data(), &TrackData::statsLoaded, this, &Track::statsLoaded );
QObject::connect( d->trackData.data(), &TrackData::similarTracksLoaded, this, &Track::similarTracksLoaded );
QObject::connect( d->trackData.data(), &TrackData::lyricsLoaded, this, &Track::lyricsLoaded );
#else
connect( d->trackData.data(), SIGNAL( attributesLoaded() ), SIGNAL( attributesLoaded() ) );
connect( d->trackData.data(), SIGNAL( socialActionsLoaded() ), SIGNAL( socialActionsLoaded() ) );
connect( d->trackData.data(), SIGNAL( statsLoaded() ), SIGNAL( statsLoaded() ) );
connect( d->trackData.data(), SIGNAL( similarTracksLoaded() ), SIGNAL( similarTracksLoaded() ) );
connect( d->trackData.data(), SIGNAL( lyricsLoaded() ), SIGNAL( lyricsLoaded() ) );
#endif
}

View File

@@ -167,7 +167,7 @@ signals:
void connectionStateChanged( Tomahawk::Accounts::Account::ConnectionState state );
void configurationChanged();
void configTestResult( Tomahawk::Accounts::ConfigTestResultType );
void configTestResult( int, const QString& = QString() );
protected:
virtual void loadFromConfig( const QString &accountId );

View File

@@ -64,7 +64,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
if ( m_accountRowHeight < 0 )
{
// Haven't calculated normal item height yet, do it once and save it
QStyleOptionViewItemV4 opt( option );
QStyleOptionViewItem opt( option );
initStyleOption( &opt, index );
m_accountRowHeight = ACCOUNT_DELEGATE_ROW_HEIGHT_MULTIPLIER * opt.fontMetrics.height();
}
@@ -98,7 +98,7 @@ AccountDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex
void
AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption( &opt, index );
// draw the background
@@ -139,7 +139,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
// draw checkbox first
const int checkboxYPos = ( center ) - ( WRENCH_SIZE / 2 );
QRect checkRect = QRect( leftEdge, checkboxYPos, WRENCH_SIZE, WRENCH_SIZE );
QStyleOptionViewItemV4 opt2 = opt;
QStyleOptionViewItem opt2 = opt;
opt2.rect = checkRect;
if ( !m_loadingSpinners.contains( index ) )
@@ -392,7 +392,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
int
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItemV4& opt, const QList< Account* > accts, int rightEdge ) const
AccountDelegate::drawAccountList( QPainter* painter, QStyleOptionViewItem& opt, const QList< Account* > accts, int rightEdge ) const
{
// list each account name, and show the online, offline icon
const int textHeight = painter->fontMetrics().height() + 1;
@@ -615,7 +615,7 @@ AccountDelegate::drawStatus( QPainter* painter, const QPointF& rightTopEdge, Acc
void
AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const
AccountDelegate::drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const
{
QStyle* style = w ? w->style() : QApplication::style();
opt.checkState == Qt::Checked ? opt.state |= QStyle::State_On : opt.state |= QStyle::State_Off;
@@ -624,7 +624,7 @@ AccountDelegate::drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const Q
void
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& opt, QStyleOptionToolButton& topt ) const
AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItem& opt, QStyleOptionToolButton& topt ) const
{
const QWidget* w = opt.widget;
QStyle* style = w ? w->style() : QApplication::style();
@@ -648,7 +648,7 @@ AccountDelegate::drawConfigWrench ( QPainter* painter, QStyleOptionViewItemV4& o
QRect
AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QModelIndex& idx ) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption( &opt, idx );
// Top level item, return the corresponding rect
@@ -661,7 +661,7 @@ AccountDelegate::checkRectForIndex( const QStyleOptionViewItem& option, const QM
int
AccountDelegate::removeBtnWidth( QStyleOptionViewItemV4 opt ) const
AccountDelegate::removeBtnWidth( QStyleOptionViewItem opt ) const
{
const QString btnText = tr( "Remove" );
QFont font = opt.font;
@@ -674,7 +674,7 @@ void
AccountDelegate::startInstalling( const QPersistentModelIndex& idx )
{
qDebug() << "START INSTALLING:" << idx.data( Qt::DisplayRole ).toString();
QStyleOptionViewItemV4 opt;
QStyleOptionViewItem opt;
initStyleOption( &opt, idx );
AnimatedSpinner* anim = new AnimatedSpinner( checkRectForIndex( opt, idx ).size(), true );

View File

@@ -71,14 +71,14 @@ private:
void drawRoundedButton( QPainter* painter, const QRect& buttonRect, bool red = false ) const;
// Returns new left edge
int drawStatus( QPainter* painter, const QPointF& rightTopEdge, Account* acct, bool drawText = false ) const;
void drawCheckBox( QStyleOptionViewItemV4& opt, QPainter* p, const QWidget* w ) const;
void drawConfigWrench( QPainter* painter, QStyleOptionViewItemV4& option, QStyleOptionToolButton& topt ) const;
void drawCheckBox( QStyleOptionViewItem& opt, QPainter* p, const QWidget* w ) const;
void drawConfigWrench( QPainter* painter, QStyleOptionViewItem& option, QStyleOptionToolButton& topt ) const;
// returns new left edge
int drawAccountList( QPainter* painter, QStyleOptionViewItemV4& option, const QList< Account* > accounts, int rightEdge ) const;
int drawAccountList( QPainter* painter, QStyleOptionViewItem& option, const QList< Account* > accounts, int rightEdge ) const;
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
int removeBtnWidth( QStyleOptionViewItemV4 opt ) const;
int removeBtnWidth( QStyleOptionViewItem opt ) const;
int m_hoveringOver;
QPersistentModelIndex m_hoveringItem, m_configPressed;

View File

@@ -44,7 +44,7 @@ AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
void
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption( &opt, index );
const int center = opt.rect.height() / 2 + opt.rect.top();
@@ -61,7 +61,7 @@ AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewIt
// Checkbox on left edge, then text
const QRect checkRect( PADDING/4, PADDING/4 + opt.rect.top(), opt.rect.height() - PADDING/4, opt.rect.height() - PADDING/4 );
m_cachedCheckRects[ index ] = checkRect;
QStyleOptionViewItemV4 opt2 = opt;
QStyleOptionViewItem opt2 = opt;
opt2.rect = checkRect;
opt.checkState == Qt::Checked ? opt2.state |= QStyle::State_On : opt2.state |= QStyle::State_Off;
style->drawPrimitive( QStyle::PE_IndicatorViewItemCheck, &opt2, painter, w );

View File

@@ -23,11 +23,7 @@
#ifdef Q_OS_MAC
#include "TomahawkSettings.h"
#else
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
#include <qtkeychain/keychain.h>
#else
#include <qt5keychain/keychain.h>
#endif
#include <qt5keychain/keychain.h>
#include "utils/Json.h"
#endif

View File

@@ -68,6 +68,7 @@ DelegateConfigWrapper::DelegateConfigWrapper( Tomahawk::Accounts::Account* accou
h->setContentsMargins( m_widget->contentsMargins() );
m_errorLabel->setAlignment( Qt::AlignCenter );
m_errorLabel->setWordWrap( true );
v->addWidget( m_errorLabel );
v->addLayout( h );
@@ -81,7 +82,7 @@ DelegateConfigWrapper::DelegateConfigWrapper( Tomahawk::Accounts::Account* accou
if ( m_widget->metaObject()->indexOfSignal( "sizeHintChanged()" ) > -1 )
connect( m_widget, SIGNAL( sizeHintChanged() ), this, SLOT( updateSizeHint() ) );
connect( m_account, SIGNAL( configTestResult( Tomahawk::Accounts::ConfigTestResultType ) ), SLOT( onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType ) ) );
connect( m_account, SIGNAL( configTestResult( int, const QString& ) ), SLOT( onConfigTestResult( int, const QString& ) ) );
}
@@ -192,11 +193,11 @@ DelegateConfigWrapper::aboutClicked( bool )
void
DelegateConfigWrapper::onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType result )
DelegateConfigWrapper::onConfigTestResult( int code, const QString& message )
{
tLog() << Q_FUNC_INFO << result;
tLog() << Q_FUNC_INFO << code << ": " << message;
if( result == Tomahawk::Accounts::ConfigTestResultSuccess )
if( code == Tomahawk::Accounts::ConfigTestResultSuccess )
{
m_invalidData = QVariantMap();
closeDialog( QDialog::Accepted );
@@ -226,8 +227,25 @@ DelegateConfigWrapper::onConfigTestResult( Tomahawk::Accounts::ConfigTestResultT
m_invalidData = m_widget->readData();
// TODO: generate message based on status code
m_errorLabel->setText( QString( "<font color='red'>%1</font>" ).arg( tr( "Your config is invalid." ) ) );
QString msg = !message.isEmpty() ? message : getTestConfigMessage( code );
m_errorLabel->setText( QString( "<font color='red'>%1</font>" ).arg( msg ) );
}
}
QString
DelegateConfigWrapper::getTestConfigMessage( int code )
{
switch(code) {
case Tomahawk::Accounts::ConfigTestResultCommunicationError:
return tr( "Unable to authenticate. Please check your connection." );
case Tomahawk::Accounts::ConfigTestResultInvalidCredentials:
return tr( "Username or password incorrect." );
case Tomahawk::Accounts::ConfigTestResultInvalidAccount:
return tr( "Account rejected by server." );
case Tomahawk::Accounts::ConfigTestResultPlayingElsewhere:
return tr( "Action not allowed, account is in use elsewhere." );
case Tomahawk::Accounts::ConfigTestResultAccountExpired:
return tr( "Your account has expired." );
}
}

View File

@@ -60,10 +60,11 @@ protected:
private slots:
void aboutClicked( bool );
void onConfigTestResult( Tomahawk::Accounts::ConfigTestResultType );
void onConfigTestResult( int, const QString& );
private:
void closeDialog( QDialog::DialogCode code );
QString getTestConfigMessage( int code );
Tomahawk::Accounts::Account* m_account;
AccountConfigWidget* m_widget;

View File

@@ -542,7 +542,7 @@ ResolverAccount::testConfig()
{
QVariantMap data = resolver->loadDataFromWidgets();
ScriptJob* job = resolver->scriptObject()->invoke( "testConfig", data );
connect( job, SIGNAL( done( QVariantMap ) ), SLOT( onTestConfig( QVariantMap ) ) );
connect( job, SIGNAL( done( QVariant ) ), SLOT( onTestConfig( QVariant ) ) );
job->start();
}
else
@@ -560,18 +560,17 @@ ResolverAccount::resolver() const
void
ResolverAccount::onTestConfig( const QVariantMap& result )
ResolverAccount::onTestConfig( const QVariant& result )
{
tLog() << Q_FUNC_INFO << result;
int resultCode = result[ "result" ].toInt();
if ( resultCode == 1 )
if ( result.type() == QVariant::String )
{
emit configTestResult( Accounts::ConfigTestResultSuccess );
emit configTestResult( Accounts::ConfigTestResultOther, result.toString() );
}
else
{
emit configTestResult( Accounts::ConfigTestResultOther );
emit configTestResult( result.toInt() );
}
sender()->deleteLater();
@@ -590,6 +589,7 @@ AtticaResolverAccount::AtticaResolverAccount( const QString& accountId )
}
AtticaResolverAccount::AtticaResolverAccount( const QString& accountId, const QString& path, const QString& atticaId, const QVariantHash& initialConfiguration )
: ResolverAccount( accountId, path, initialConfiguration )
, m_atticaId( atticaId )
@@ -619,8 +619,6 @@ AtticaResolverAccount::init()
loadIcon();
else
connect( AtticaManager::instance(), SIGNAL( resolversLoaded( Attica::Content::List ) ), this, SLOT( loadIcon() ) );
}

View File

@@ -110,7 +110,7 @@ public:
private slots:
void resolverChanged();
void onTestConfig( const QVariantMap& result );
void onTestConfig( const QVariant& result );
protected:
// Created by factory, when user installs a new resolver

View File

@@ -11,16 +11,3 @@ tomahawk_add_plugin(telepathy
${TELEPATHY_QT_LIBRARIES}
SHARED_LIB
)
if( KDE4_FOUND )
include_directories( ${KDE4_INCLUDES} )
tomahawk_add_plugin(kde
TYPE configstorage_telepathy
EXPORT_MACRO CONFIGSTORAGETELEPATHYDLLEXPORT_PRO
SOURCES
KdeTelepathyConfigWidget.cpp
LINK_LIBRARIES
${TOMAHAWK_BASE_TARGET_NAME}_configstorage_telepathy
${KDE4_KCMUTILS_LIBS}
)
endif()

View File

@@ -1,46 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#include "KdeTelepathyConfigWidget.h"
#include "utils/Logger.h"
#include <KCModuleProxy>
#include <QtPlugin>
QWidget*
KdeTelepathyConfigWidget::configWidget()
{
KCModuleProxy* proxy = new KCModuleProxy( "kcm_ktp_accounts" );
if ( !proxy->aboutData() )
{
qWarning() << "Could not load kcm_ktp_accounts... ";
delete proxy;
return 0;
}
return proxy;
}
Q_EXPORT_PLUGIN2( TelepathyConfigStorageConfigWidgetPlugin, KdeTelepathyConfigWidget )

View File

@@ -1,36 +0,0 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2013, Dominik Schmidt <domme@tomahawk-player.org>
*
* Tomahawk 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.
*
* Tomahawk 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 Tomahawk. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KDETELEPATHYCONFIGWIDGET_H
#define KDETELEPATHYCONFIGWIDGET_H
#include "TelepathyConfigStorageConfigWidgetPlugin.h"
#include "TelepathyConfigStorageConfigWidgetDllMacro.h"
class CONFIGSTORAGETELEPATHYDLLEXPORT KdeTelepathyConfigWidget : public TelepathyConfigStorageConfigWidgetPlugin
{
Q_OBJECT
Q_INTERFACES( TelepathyConfigStorageConfigWidgetPlugin )
public:
virtual QWidget* configWidget();
};
#endif // KDETELEPATHYCONFIGWIDGET_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/telepathy">
<file>kde.png</file>
</qresource>
</RCC>

View File

@@ -29,17 +29,10 @@
#include "utils/Closure.h"
#include "utils/NetworkAccessManager.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <lastfm5/ws.h>
#include <lastfm5/User.h>
#include <lastfm5/XmlQuery.h>
#include <lastfm5/Track.h>
#else
#include <lastfm/ws.h>
#include <lastfm/User.h>
#include <lastfm/XmlQuery.h>
#include <lastfm/Track.h>
#endif
using namespace Tomahawk::Accounts;

View File

@@ -34,13 +34,8 @@
#include "TomahawkSettings.h"
#include "utils/NetworkAccessManager.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <lastfm5/ws.h>
#include <lastfm5/XmlQuery.h>
#else
#include <lastfm/ws.h>
#include <lastfm/XmlQuery.h>
#endif
using namespace Tomahawk::Accounts;
using namespace Tomahawk::InfoSystem;

View File

@@ -24,15 +24,9 @@
#include "infosystem/InfoSystemWorker.h"
#include "DllMacro.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <lastfm5/Track.h>
#include <lastfm5/Audioscrobbler.h>
#include <lastfm5/ScrobblePoint.h>
#else
#include <lastfm/Track.h>
#include <lastfm/Audioscrobbler.h>
#include <lastfm/ScrobblePoint.h>
#endif
#include <QObject>

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
*
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2016, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* Copyright 2013, Teo Mrnjavac <teo@kde.org>
*
@@ -604,6 +604,7 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
job->start();
}
void
AudioEngine::gotStreamUrl( const QVariantMap& data )
{
@@ -611,14 +612,17 @@ AudioEngine::gotStreamUrl( const QVariantMap& data )
QVariantMap headers = data[ "headers" ].toMap();
Tomahawk::result_ptr result = sender()->property( "result" ).value<result_ptr>();
if ( streamUrl.isEmpty() || !( TomahawkUtils::isHttpResult( streamUrl ) || TomahawkUtils::isHttpsResult( streamUrl ) || TomahawkUtils::isRtmpResult( streamUrl ) ) )
if ( streamUrl.isEmpty() || headers.isEmpty() ||
!( TomahawkUtils::isHttpResult( streamUrl ) || TomahawkUtils::isHttpsResult( streamUrl ) ) )
{
// Not an http(s) or RTMP URL, get IO device
// We can't supply custom headers to VLC - but prefer using its HTTP streaming due to improved seeking ability
// Not an RTMP or HTTP-with-headers URL, get IO device
QSharedPointer< QIODevice > sp;
performLoadIODevice( result, streamUrl );
}
else
{
// We need our own QIODevice for streaming
// TODO: just make this part of the http(s) IoDeviceFactory (?)
QUrl url = QUrl::fromEncoded( streamUrl.toUtf8() );
QNetworkRequest req( url );
@@ -640,12 +644,13 @@ AudioEngine::gotStreamUrl( const QVariantMap& data )
tDebug() << "Creating a QNetworkReply with url:" << req.url().toString();
NetworkReply* reply = new NetworkReply( Tomahawk::Utils::nam()->get( req ) );
NewClosure( reply, SIGNAL( finalUrlReached() ), this, SLOT( gotRedirectedStreamUrl( Tomahawk::result_ptr, NetworkReply* )), result, reply );
NewClosure( reply, SIGNAL( finalUrlReached() ), this, SLOT( gotRedirectedStreamUrl( Tomahawk::result_ptr, NetworkReply* ) ), result, reply );
}
sender()->deleteLater();
}
void
AudioEngine::gotRedirectedStreamUrl( const Tomahawk::result_ptr& result, NetworkReply* reply )
{

View File

@@ -22,6 +22,7 @@
#include "AudioEngine.h"
#include "AudioOutput.h"
#include "TomahawkVersion.h"
#include "TomahawkSettings.h"
#include "audio/MediaStream.h"
#include "utils/Logger.h"
@@ -35,10 +36,12 @@
#include <vlc/libvlc.h>
#include <vlc/libvlc_media.h>
#include <vlc/libvlc_media_player.h>
#include <vlc/libvlc_events.h>
#include <vlc/libvlc_media_player.h>
#include <vlc/libvlc_version.h>
#include <algorithm>
AudioOutput* AudioOutput::s_instance = 0;
@@ -72,7 +75,7 @@ AudioOutput::AudioOutput( QObject* parent )
qRegisterMetaType<AudioOutput::AudioState>("AudioOutput::AudioState");
const char* vlcArgs[] = {
QVector<const char*> vlcArgs = {
"--ignore-config",
"--extraintf=logger",
qApp->arguments().contains( "--verbose" ) ? "--verbose=3" : "",
@@ -84,11 +87,28 @@ AudioOutput::AudioOutput( QObject* parent )
// "--no-snapshot-preview",
// "--services-discovery=''",
"--no-video",
//"--network-caching=10000",
//"--file-caching=10000",
//"--clock-synchro=0",
//"--cr-average=10000",
//"--clock-jitter=1",
"--no-xlib"
};
TomahawkSettings* s = TomahawkSettings::instance();
//Save a list of Latin1 byte arrays for additional args
auto additionalVlcArgs = s->vlcArguments().split(",");
QVector<QByteArray> additionalArgsChar;
std::transform(additionalVlcArgs.begin(), additionalVlcArgs.end(),
std::back_inserter(additionalArgsChar), [](QString str) { return str.toLatin1(); });
for (auto&& str : additionalArgsChar)
{
vlcArgs.append(str.constData());
}
// Create and initialize a libvlc instance (it should be done only once)
m_vlcInstance = libvlc_new( sizeof(vlcArgs) / sizeof(*vlcArgs), vlcArgs );
m_vlcInstance = libvlc_new( vlcArgs.size(), vlcArgs.constData() );
if ( !m_vlcInstance )
{
tDebug() << Q_FUNC_INFO << "libVLC: could not initialize";
@@ -98,8 +118,8 @@ AudioOutput::AudioOutput( QObject* parent )
TOMAHAWK_APPLICATION_NAME "/" TOMAHAWK_VERSION );
// FIXME: icon is named tomahawk, so we need the lowercase application name
#if (LIBVLC_VERSION_INT >= LIBVLC_VERSION(2, 1, 0, 0))
libvlc_set_app_id( m_vlcInstance, "org.tomahawk-player.desktop",
TOMAHAWK_VERSION, "tomahawk" );
libvlc_set_app_id( m_vlcInstance, TOMAHAWK_APPLICATION_PACKAGE_NAME,
TOMAHAWK_VERSION, TOMAHAWK_TARGET_NAME );
#endif
m_vlcPlayer = libvlc_media_player_new( m_vlcInstance );
@@ -144,7 +164,6 @@ AudioOutput::AudioOutput( QObject* parent )
setCurrentSource( new MediaStream( &m_silenceFile, true ) );
libvlc_media_player_play( m_vlcPlayer );
#if QT_VERSION >= QT_VERSION_CHECK(5,4,0)
// if the silence file did not play for 15 secs, we pretend the AudioOutput is initialized, to allow proper error reporting
QTimer::singleShot( 15000, [&]()
{
@@ -153,7 +172,6 @@ AudioOutput::AudioOutput( QObject* parent )
emit initialized();
}
} );
#endif
}
@@ -295,33 +313,22 @@ AudioOutput::setCurrentSource( MediaStream* stream )
tDebug() << Q_FUNC_INFO << "MediaStream::Final Url:" << url;
m_vlcMedia = libvlc_media_new_location( m_vlcInstance, url.constData() );
libvlc_event_manager_t* manager = libvlc_media_event_manager( m_vlcMedia );
libvlc_event_type_t events[] = {
libvlc_MediaDurationChanged,
};
const int eventCount = sizeof(events) / sizeof( *events );
for ( int i = 0; i < eventCount; i++ )
{
libvlc_event_attach( manager, events[ i ], &AudioOutput::vlcEventCallback, this );
}
libvlc_media_player_set_media( m_vlcPlayer, m_vlcMedia );
if ( stream->type() == MediaStream::Url )
{
m_totalTime = libvlc_media_get_duration( m_vlcMedia );
}
else if ( stream->type() == MediaStream::Stream || stream->type() == MediaStream::IODevice )
{
QString tempString;
libvlc_media_add_option_flag(m_vlcMedia, "imem-cat=4", libvlc_media_option_trusted);
const char* imemData = QString( "imem-data=%1" ).arg( (uintptr_t)stream ).toLatin1().constData();
libvlc_media_add_option_flag(m_vlcMedia, imemData, libvlc_media_option_trusted);
const char* imemGet = QString( "imem-get=%1" ).arg( (uintptr_t)&readCallback ).toLatin1().constData();
libvlc_media_add_option_flag(m_vlcMedia, imemGet, libvlc_media_option_trusted);
const char* imemRelease = QString( "imem-release=%1" ).arg( (uintptr_t)&readDoneCallback ).toLatin1().constData();
libvlc_media_add_option_flag(m_vlcMedia, imemRelease, libvlc_media_option_trusted);
const char* imemSeek = QString( "imem-seek=%1" ).arg( (uintptr_t)&MediaStream::seekCallback ).toLatin1().constData();
libvlc_media_add_option_flag(m_vlcMedia, imemSeek, libvlc_media_option_trusted);
tempString = QString( "imem-data=%1" ).arg( (uintptr_t)stream );
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
tempString = QString( "imem-get=%1" ).arg( (uintptr_t)&readCallback );
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
tempString = QString( "imem-release=%1" ).arg( (uintptr_t)&readDoneCallback );
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
tempString = QString( "imem-seek=%1" ).arg( (uintptr_t)&MediaStream::seekCallback );
libvlc_media_add_option_flag(m_vlcMedia, tempString.toLatin1().constData(), libvlc_media_option_trusted);
}
if ( qApp->arguments().contains( "--chromecast-ip" ) )
{
@@ -345,6 +352,18 @@ AudioOutput::setCurrentSource( MediaStream* stream )
}
}
libvlc_event_manager_t* manager = libvlc_media_event_manager( m_vlcMedia );
libvlc_event_type_t events[] = {
libvlc_MediaDurationChanged,
};
const int eventCount = sizeof(events) / sizeof( *events );
for ( int i = 0; i < eventCount; i++ )
{
libvlc_event_attach( manager, events[ i ], &AudioOutput::vlcEventCallback, this );
}
libvlc_media_player_set_media( m_vlcPlayer, m_vlcMedia );
// setState( Stopped );
}
@@ -481,16 +500,19 @@ AudioOutput::seek( qint64 milliseconds )
return;
}
qint64 duration = AudioEngine::instance()->currentTrackTotalTime();
// for some tracks, seeking to an end seems not to work correctly with libvlc
// (tracks enter a random and infinite loop) - this is a temporary fix for that
if (duration == milliseconds)
milliseconds -= 1;
if ( m_seekable )
{
// tDebug() << Q_FUNC_INFO << "AudioOutput:: seeking" << milliseconds << "msec";
libvlc_media_player_set_time( m_vlcPlayer, milliseconds );
setCurrentTime( milliseconds );
}
else
{
qint64 duration = AudioEngine::instance()->currentTrackTotalTime();
float position = float(float(milliseconds) / duration);
libvlc_media_player_set_position(m_vlcPlayer, position);
tDebug() << Q_FUNC_INFO << "AudioOutput:: seeking via position" << position << "pos";

View File

@@ -151,7 +151,6 @@ int
MediaStream::readDoneCallback ( const char *cookie, size_t bufferSize, void *buffer )
{
Q_UNUSED(cookie);
Q_UNUSED(bufferSize);
if ( ( m_type == Stream ) && buffer != nullptr && bufferSize > 0 ) {
delete[] reinterpret_cast< char* >( buffer );

View File

@@ -43,11 +43,6 @@
#include "DatabaseCommand_SetCollectionAttributes.h"
#include "DatabaseCommand_SetTrackAttributes.h"
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "collection/Collection.h"
#endif
#define DEFAULT_WORKER_THREADS 4
#define MAX_WORKER_THREADS 16

View File

@@ -128,10 +128,13 @@ DatabaseCollection::playlists()
QList< dynplaylist_ptr >
DatabaseCollection::autoPlaylists()
{
// echonest is dead, disable all echonest code
/*
if ( Collection::autoPlaylists().isEmpty() )
{
loadAutoPlaylists();
}
*/
return Collection::autoPlaylists();
}
@@ -140,10 +143,13 @@ DatabaseCollection::autoPlaylists()
QList< dynplaylist_ptr >
DatabaseCollection::stations()
{
// echonest is dead, disable all echonest code
/*
if ( Collection::stations().isEmpty() )
{
loadStations();
}
*/
return Collection::stations();
}

View File

@@ -59,10 +59,10 @@ public:
void setLimit( unsigned int amount ) { m_amount = amount; }
void setSortOrder( DatabaseCommand_AllArtists::SortOrder order ) { m_sortOrder = order; }
void setSortDescending( bool descending ) { m_sortDescending = descending; }
void setFilter( const QString& filter ) { m_filter = filter; }
void setFilter( const QString& filter ) override { m_filter = filter; }
signals:
void artists( const QList<Tomahawk::artist_ptr>& );
void artists( const QList<Tomahawk::artist_ptr>& ) override;
void done();
private:

View File

@@ -74,7 +74,7 @@ public:
signals:
void tracks( const QList<Tomahawk::query_ptr>&, const QVariant& data );
void tracks( const QList<Tomahawk::query_ptr>& );
void tracks( const QList<Tomahawk::query_ptr>& ) override;
void done( const Tomahawk::collection_ptr& );
private:

View File

@@ -25,11 +25,6 @@
#include "PlaylistEntry.h"
#include "SourceList.h"
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "collection/Collection.h"
#endif
using namespace Tomahawk;

View File

@@ -24,10 +24,6 @@
#include <QSqlQuery>
// Forward Declarations breaking QSharedPointer
#if QT_VERSION < QT_VERSION_CHECK( 5, 0, 0 )
#include "collection/Collection.h"
#endif
using namespace Tomahawk;

Some files were not shown because too many files have changed in this diff Show More