mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-03 04:37:33 +01:00
Make the GPL spotify code non-optional
(cherry picked from commit 2c55688601964861797d605a1230f51942e9c0e3)
This commit is contained in:
parent
d89fb97701
commit
96a8c5a9fe
@ -76,7 +76,7 @@ pkg_check_modules(LIBGPOD libgpod-1.0>=0.7.92)
|
|||||||
pkg_check_modules(LIBMTP libmtp>=1.0)
|
pkg_check_modules(LIBMTP libmtp>=1.0)
|
||||||
pkg_check_modules(LIBMYGPO_QT libmygpo-qt>=1.0.7)
|
pkg_check_modules(LIBMYGPO_QT libmygpo-qt>=1.0.7)
|
||||||
pkg_check_modules(LIBXML libxml-2.0)
|
pkg_check_modules(LIBXML libxml-2.0)
|
||||||
pkg_check_modules(QCA qca2)
|
pkg_check_modules(QCA REQUIRED qca2)
|
||||||
pkg_check_modules(QJSON REQUIRED QJson)
|
pkg_check_modules(QJSON REQUIRED QJson)
|
||||||
pkg_check_modules(SPOTIFY libspotify>=12.1.45)
|
pkg_check_modules(SPOTIFY libspotify>=12.1.45)
|
||||||
pkg_check_modules(TAGLIB REQUIRED taglib>=1.6)
|
pkg_check_modules(TAGLIB REQUIRED taglib>=1.6)
|
||||||
@ -254,24 +254,9 @@ optional_component(DEVICEKIT ON "Devices: DeviceKit backend"
|
|||||||
DEPENDS "D-Bus support" HAVE_DBUS
|
DEPENDS "D-Bus support" HAVE_DBUS
|
||||||
)
|
)
|
||||||
|
|
||||||
optional_component(SPOTIFY ON "Spotify support: core code"
|
|
||||||
DEPENDS "protobuf" PROTOBUF_FOUND PROTOBUF_PROTOC_EXECUTABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
optional_component(SPOTIFY_BLOB ON "Spotify support: non-GPL binary helper"
|
optional_component(SPOTIFY_BLOB ON "Spotify support: non-GPL binary helper"
|
||||||
DEPENDS "protobuf" PROTOBUF_FOUND PROTOBUF_PROTOC_EXECUTABLE
|
DEPENDS "protobuf" PROTOBUF_FOUND PROTOBUF_PROTOC_EXECUTABLE
|
||||||
DEPENDS "libspotify" SPOTIFY_FOUND
|
DEPENDS "libspotify" SPOTIFY_FOUND
|
||||||
DEPENDS "Spotify support: core code" HAVE_SPOTIFY
|
|
||||||
)
|
|
||||||
|
|
||||||
set(NEED_SPOTIFY_DOWNLOADER OFF)
|
|
||||||
if(HAVE_SPOTIFY AND NOT HAVE_SPOTIFY_BLOB)
|
|
||||||
set(NEED_SPOTIFY_DOWNLOADER ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
optional_component(SPOTIFY_DOWNLOADER
|
|
||||||
${NEED_SPOTIFY_DOWNLOADER} "Spotify support: blob downloader"
|
|
||||||
DEPENDS "qca2" QCA_FOUND
|
|
||||||
)
|
)
|
||||||
|
|
||||||
optional_component(MOODBAR ON "Moodbar support"
|
optional_component(MOODBAR ON "Moodbar support"
|
||||||
@ -450,6 +435,7 @@ add_subdirectory(ext/libclementine-common)
|
|||||||
add_subdirectory(ext/libclementine-tagreader)
|
add_subdirectory(ext/libclementine-tagreader)
|
||||||
add_subdirectory(ext/clementine-tagreader)
|
add_subdirectory(ext/clementine-tagreader)
|
||||||
add_subdirectory(ext/libclementine-remote)
|
add_subdirectory(ext/libclementine-remote)
|
||||||
|
add_subdirectory(ext/libclementine-spotifyblob)
|
||||||
|
|
||||||
option(WITH_DEBIAN OFF)
|
option(WITH_DEBIAN OFF)
|
||||||
if(WITH_DEBIAN)
|
if(WITH_DEBIAN)
|
||||||
@ -460,10 +446,6 @@ if(HAVE_BREAKPAD)
|
|||||||
add_subdirectory(3rdparty/google-breakpad)
|
add_subdirectory(3rdparty/google-breakpad)
|
||||||
endif(HAVE_BREAKPAD)
|
endif(HAVE_BREAKPAD)
|
||||||
|
|
||||||
if(HAVE_SPOTIFY)
|
|
||||||
add_subdirectory(ext/libclementine-spotifyblob)
|
|
||||||
endif(HAVE_SPOTIFY)
|
|
||||||
|
|
||||||
if(HAVE_SPOTIFY_BLOB)
|
if(HAVE_SPOTIFY_BLOB)
|
||||||
add_subdirectory(ext/clementine-spotifyblob)
|
add_subdirectory(ext/clementine-spotifyblob)
|
||||||
endif(HAVE_SPOTIFY_BLOB)
|
endif(HAVE_SPOTIFY_BLOB)
|
||||||
|
@ -10,6 +10,8 @@ if(BUILD_WERROR)
|
|||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
endif(BUILD_WERROR)
|
endif(BUILD_WERROR)
|
||||||
|
|
||||||
|
link_directories(${QCA_LIBRARY_DIRS})
|
||||||
|
|
||||||
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
include_directories(../3rdparty/gmock/gtest/include)
|
include_directories(../3rdparty/gmock/gtest/include)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -38,6 +40,7 @@ include_directories(${ECHONEST_INCLUDE_DIRS})
|
|||||||
include_directories(${SHA2_INCLUDE_DIRS})
|
include_directories(${SHA2_INCLUDE_DIRS})
|
||||||
include_directories(${CHROMAPRINT_INCLUDE_DIRS})
|
include_directories(${CHROMAPRINT_INCLUDE_DIRS})
|
||||||
include_directories(${MYGPOQT_INCLUDE_DIRS})
|
include_directories(${MYGPOQT_INCLUDE_DIRS})
|
||||||
|
include_directories(${QCA_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
@ -60,6 +63,8 @@ include_directories(${CMAKE_SOURCE_DIR}/ext/libclementine-tagreader)
|
|||||||
include_directories(${CMAKE_BINARY_DIR}/ext/libclementine-tagreader)
|
include_directories(${CMAKE_BINARY_DIR}/ext/libclementine-tagreader)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/ext/libclementine-remote)
|
include_directories(${CMAKE_SOURCE_DIR}/ext/libclementine-remote)
|
||||||
include_directories(${CMAKE_BINARY_DIR}/ext/libclementine-remote)
|
include_directories(${CMAKE_BINARY_DIR}/ext/libclementine-remote)
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/ext/libclementine-spotifyblob)
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/ext/libclementine-spotifyblob)
|
||||||
|
|
||||||
cmake_policy(SET CMP0011 NEW)
|
cmake_policy(SET CMP0011 NEW)
|
||||||
include(../cmake/ParseArguments.cmake)
|
include(../cmake/ParseArguments.cmake)
|
||||||
@ -155,6 +160,7 @@ set(SOURCES
|
|||||||
globalsearch/simplesearchprovider.cpp
|
globalsearch/simplesearchprovider.cpp
|
||||||
globalsearch/somafmsearchprovider.cpp
|
globalsearch/somafmsearchprovider.cpp
|
||||||
globalsearch/soundcloudsearchprovider.cpp
|
globalsearch/soundcloudsearchprovider.cpp
|
||||||
|
globalsearch/spotifysearchprovider.cpp
|
||||||
globalsearch/suggestionwidget.cpp
|
globalsearch/suggestionwidget.cpp
|
||||||
globalsearch/urlsearchprovider.cpp
|
globalsearch/urlsearchprovider.cpp
|
||||||
|
|
||||||
@ -183,8 +189,8 @@ set(SOURCES
|
|||||||
internet/localredirectserver.cpp
|
internet/localredirectserver.cpp
|
||||||
internet/magnatunedownloaddialog.cpp
|
internet/magnatunedownloaddialog.cpp
|
||||||
internet/magnatuneplaylistitem.cpp
|
internet/magnatuneplaylistitem.cpp
|
||||||
internet/magnatunesettingspage.cpp
|
|
||||||
internet/magnatuneservice.cpp
|
internet/magnatuneservice.cpp
|
||||||
|
internet/magnatunesettingspage.cpp
|
||||||
internet/magnatuneurlhandler.cpp
|
internet/magnatuneurlhandler.cpp
|
||||||
internet/oauthenticator.cpp
|
internet/oauthenticator.cpp
|
||||||
internet/savedradio.cpp
|
internet/savedradio.cpp
|
||||||
@ -192,6 +198,10 @@ set(SOURCES
|
|||||||
internet/somafmservice.cpp
|
internet/somafmservice.cpp
|
||||||
internet/somafmurlhandler.cpp
|
internet/somafmurlhandler.cpp
|
||||||
internet/soundcloudservice.cpp
|
internet/soundcloudservice.cpp
|
||||||
|
internet/spotifyblobdownloader.cpp
|
||||||
|
internet/spotifyserver.cpp
|
||||||
|
internet/spotifyservice.cpp
|
||||||
|
internet/spotifysettingspage.cpp
|
||||||
internet/subsonicservice.cpp
|
internet/subsonicservice.cpp
|
||||||
internet/subsonicsettingspage.cpp
|
internet/subsonicsettingspage.cpp
|
||||||
internet/subsonicurlhandler.cpp
|
internet/subsonicurlhandler.cpp
|
||||||
@ -386,6 +396,7 @@ set(SOURCES
|
|||||||
widgets/tracksliderpopup.cpp
|
widgets/tracksliderpopup.cpp
|
||||||
widgets/tracksliderslider.cpp
|
widgets/tracksliderslider.cpp
|
||||||
widgets/widgetfadehelper.cpp
|
widgets/widgetfadehelper.cpp
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(HEADERS
|
set(HEADERS
|
||||||
@ -454,6 +465,7 @@ set(HEADERS
|
|||||||
globalsearch/searchprovider.h
|
globalsearch/searchprovider.h
|
||||||
globalsearch/simplesearchprovider.h
|
globalsearch/simplesearchprovider.h
|
||||||
globalsearch/soundcloudsearchprovider.h
|
globalsearch/soundcloudsearchprovider.h
|
||||||
|
globalsearch/spotifysearchprovider.h
|
||||||
globalsearch/suggestionwidget.h
|
globalsearch/suggestionwidget.h
|
||||||
|
|
||||||
internet/cloudfileservice.h
|
internet/cloudfileservice.h
|
||||||
@ -478,14 +490,18 @@ set(HEADERS
|
|||||||
internet/jamendoservice.h
|
internet/jamendoservice.h
|
||||||
internet/localredirectserver.h
|
internet/localredirectserver.h
|
||||||
internet/magnatunedownloaddialog.h
|
internet/magnatunedownloaddialog.h
|
||||||
internet/magnatunesettingspage.h
|
|
||||||
internet/magnatuneservice.h
|
internet/magnatuneservice.h
|
||||||
|
internet/magnatunesettingspage.h
|
||||||
internet/oauthenticator.h
|
internet/oauthenticator.h
|
||||||
internet/savedradio.h
|
internet/savedradio.h
|
||||||
internet/searchboxwidget.h
|
internet/searchboxwidget.h
|
||||||
internet/somafmservice.h
|
internet/somafmservice.h
|
||||||
internet/somafmurlhandler.h
|
internet/somafmurlhandler.h
|
||||||
internet/soundcloudservice.h
|
internet/soundcloudservice.h
|
||||||
|
internet/spotifyblobdownloader.h
|
||||||
|
internet/spotifyserver.h
|
||||||
|
internet/spotifyservice.h
|
||||||
|
internet/spotifysettingspage.h
|
||||||
internet/subsonicservice.h
|
internet/subsonicservice.h
|
||||||
internet/subsonicsettingspage.h
|
internet/subsonicsettingspage.h
|
||||||
internet/subsonicurlhandler.h
|
internet/subsonicurlhandler.h
|
||||||
@ -823,32 +839,6 @@ optional_source(HAVE_LIBLASTFM
|
|||||||
internet/lastfmstationdialog.ui
|
internet/lastfmstationdialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
# Spotify
|
|
||||||
optional_source(HAVE_SPOTIFY
|
|
||||||
SOURCES
|
|
||||||
globalsearch/spotifysearchprovider.cpp
|
|
||||||
internet/spotifyserver.cpp
|
|
||||||
internet/spotifyservice.cpp
|
|
||||||
internet/spotifysettingspage.cpp
|
|
||||||
HEADERS
|
|
||||||
globalsearch/spotifysearchprovider.h
|
|
||||||
internet/spotifyserver.h
|
|
||||||
internet/spotifyservice.h
|
|
||||||
internet/spotifysettingspage.h
|
|
||||||
INCLUDE_DIRECTORIES
|
|
||||||
${CMAKE_SOURCE_DIR}/ext/libclementine-spotifyblob
|
|
||||||
${CMAKE_BINARY_DIR}/ext/libclementine-spotifyblob
|
|
||||||
)
|
|
||||||
|
|
||||||
optional_source(HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
SOURCES
|
|
||||||
internet/spotifyblobdownloader.cpp
|
|
||||||
HEADERS
|
|
||||||
internet/spotifyblobdownloader.h
|
|
||||||
INCLUDE_DIRECTORIES
|
|
||||||
${QCA_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Platform specific - OS X
|
# Platform specific - OS X
|
||||||
optional_source(APPLE
|
optional_source(APPLE
|
||||||
INCLUDE_DIRECTORIES
|
INCLUDE_DIRECTORIES
|
||||||
@ -1175,6 +1165,7 @@ add_dependencies(clementine_lib pot)
|
|||||||
|
|
||||||
|
|
||||||
target_link_libraries(clementine_lib
|
target_link_libraries(clementine_lib
|
||||||
|
clementine-spotifyblob-messages
|
||||||
libclementine-common
|
libclementine-common
|
||||||
libclementine-tagreader
|
libclementine-tagreader
|
||||||
libclementine-remote
|
libclementine-remote
|
||||||
@ -1195,6 +1186,7 @@ target_link_libraries(clementine_lib
|
|||||||
${QTSINGLECOREAPPLICATION_LIBRARIES}
|
${QTSINGLECOREAPPLICATION_LIBRARIES}
|
||||||
${QTIOCOMPRESSOR_LIBRARIES}
|
${QTIOCOMPRESSOR_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
${QCA_LIBRARIES}
|
||||||
z
|
z
|
||||||
Qocoa
|
Qocoa
|
||||||
)
|
)
|
||||||
@ -1243,19 +1235,6 @@ if(HAVE_BREAKPAD)
|
|||||||
endif (LINUX)
|
endif (LINUX)
|
||||||
endif(HAVE_BREAKPAD)
|
endif(HAVE_BREAKPAD)
|
||||||
|
|
||||||
if(HAVE_SPOTIFY)
|
|
||||||
target_link_libraries(clementine_lib
|
|
||||||
clementine-spotifyblob-messages
|
|
||||||
)
|
|
||||||
endif(HAVE_SPOTIFY)
|
|
||||||
|
|
||||||
if(HAVE_SPOTIFY_DOWNLOADER)
|
|
||||||
target_link_libraries(clementine_lib
|
|
||||||
${QCA_LIBRARIES}
|
|
||||||
)
|
|
||||||
link_directories(${QCA_LIBRARY_DIRS})
|
|
||||||
endif(HAVE_SPOTIFY_DOWNLOADER)
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
target_link_libraries(clementine_lib
|
target_link_libraries(clementine_lib
|
||||||
${GROWL}
|
${GROWL}
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
#cmakedefine HAVE_QCA
|
#cmakedefine HAVE_QCA
|
||||||
#cmakedefine HAVE_SKYDRIVE
|
#cmakedefine HAVE_SKYDRIVE
|
||||||
#cmakedefine HAVE_SPARKLE
|
#cmakedefine HAVE_SPARKLE
|
||||||
#cmakedefine HAVE_SPOTIFY
|
|
||||||
#cmakedefine HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
#cmakedefine HAVE_STATIC_SQLITE
|
#cmakedefine HAVE_STATIC_SQLITE
|
||||||
#cmakedefine HAVE_UBUNTU_ONE
|
#cmakedefine HAVE_UBUNTU_ONE
|
||||||
#cmakedefine HAVE_WIIMOTEDEV
|
#cmakedefine HAVE_WIIMOTEDEV
|
||||||
|
@ -30,10 +30,8 @@
|
|||||||
#include "core/tagreaderclient.h"
|
#include "core/tagreaderclient.h"
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
#include "internet/internetmodel.h"
|
#include "internet/internetmodel.h"
|
||||||
|
#include "internet/spotifyservice.h"
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
# include "internet/spotifyservice.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
AlbumCoverLoader::AlbumCoverLoader(QObject* parent)
|
AlbumCoverLoader::AlbumCoverLoader(QObject* parent)
|
||||||
@ -173,28 +171,24 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(
|
|||||||
return TryLoadResult(true, false, QImage());
|
return TryLoadResult(true, false, QImage());
|
||||||
} else if (filename.toLower().startsWith("spotify://image/")) {
|
} else if (filename.toLower().startsWith("spotify://image/")) {
|
||||||
// HACK: we should add generic image URL handlers
|
// HACK: we should add generic image URL handlers
|
||||||
#ifdef HAVE_SPOTIFY
|
SpotifyService* spotify = InternetModel::Service<SpotifyService>();
|
||||||
SpotifyService* spotify = InternetModel::Service<SpotifyService>();
|
|
||||||
|
|
||||||
if (!connected_spotify_) {
|
if (!connected_spotify_) {
|
||||||
connect(spotify, SIGNAL(ImageLoaded(QString,QImage)),
|
connect(spotify, SIGNAL(ImageLoaded(QString,QImage)),
|
||||||
SLOT(SpotifyImageLoaded(QString,QImage)));
|
SLOT(SpotifyImageLoaded(QString,QImage)));
|
||||||
connected_spotify_ = true;
|
connected_spotify_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString id = QUrl(filename).path();
|
QString id = QUrl(filename).path();
|
||||||
if (id.startsWith('/')) {
|
if (id.startsWith('/')) {
|
||||||
id.remove(0, 1);
|
id.remove(0, 1);
|
||||||
}
|
}
|
||||||
remote_spotify_tasks_.insert(id, task);
|
remote_spotify_tasks_.insert(id, task);
|
||||||
|
|
||||||
// Need to schedule this in the spotify service's thread
|
// Need to schedule this in the spotify service's thread
|
||||||
QMetaObject::invokeMethod(spotify, "LoadImage", Qt::QueuedConnection,
|
QMetaObject::invokeMethod(spotify, "LoadImage", Qt::QueuedConnection,
|
||||||
Q_ARG(QString, id));
|
Q_ARG(QString, id));
|
||||||
return TryLoadResult(true, false, QImage());
|
return TryLoadResult(true, false, QImage());
|
||||||
#else
|
|
||||||
return TryLoadResult(false, false, QImage());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage image(filename);
|
QImage image(filename);
|
||||||
|
@ -29,11 +29,9 @@
|
|||||||
#include "core/signalchecker.h"
|
#include "core/signalchecker.h"
|
||||||
#include "core/utilities.h"
|
#include "core/utilities.h"
|
||||||
#include "internet/internetmodel.h"
|
#include "internet/internetmodel.h"
|
||||||
|
#include "internet/spotifyserver.h"
|
||||||
|
#include "internet/spotifyservice.h"
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
# include "internet/spotifyserver.h"
|
|
||||||
# include "internet/spotifyservice.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const int GstEnginePipeline::kGstStateTimeoutNanosecs = 10000000;
|
const int GstEnginePipeline::kGstStateTimeoutNanosecs = 10000000;
|
||||||
const int GstEnginePipeline::kFaderFudgeMsec = 2000;
|
const int GstEnginePipeline::kFaderFudgeMsec = 2000;
|
||||||
@ -144,34 +142,29 @@ bool GstEnginePipeline::ReplaceDecodeBin(const QUrl& url) {
|
|||||||
GstElement* new_bin = NULL;
|
GstElement* new_bin = NULL;
|
||||||
|
|
||||||
if (url.scheme() == "spotify") {
|
if (url.scheme() == "spotify") {
|
||||||
#ifdef HAVE_SPOTIFY
|
new_bin = gst_bin_new("spotify_bin");
|
||||||
new_bin = gst_bin_new("spotify_bin");
|
|
||||||
|
|
||||||
// Create elements
|
// Create elements
|
||||||
GstElement* src = engine_->CreateElement("tcpserversrc", new_bin);
|
GstElement* src = engine_->CreateElement("tcpserversrc", new_bin);
|
||||||
GstElement* gdp = engine_->CreateElement("gdpdepay", new_bin);
|
GstElement* gdp = engine_->CreateElement("gdpdepay", new_bin);
|
||||||
if (!src || !gdp)
|
if (!src || !gdp)
|
||||||
return false;
|
|
||||||
|
|
||||||
// Pick a port number
|
|
||||||
const int port = Utilities::PickUnusedPort();
|
|
||||||
g_object_set(G_OBJECT(src), "host", "127.0.0.1", NULL);
|
|
||||||
g_object_set(G_OBJECT(src), "port", port, NULL);
|
|
||||||
|
|
||||||
// Link the elements
|
|
||||||
gst_element_link(src, gdp);
|
|
||||||
|
|
||||||
// Add a ghost pad
|
|
||||||
GstPad* pad = gst_element_get_static_pad(gdp, "src");
|
|
||||||
gst_element_add_pad(GST_ELEMENT(new_bin), gst_ghost_pad_new("src", pad));
|
|
||||||
gst_object_unref(GST_OBJECT(pad));
|
|
||||||
|
|
||||||
// Tell spotify to start sending data to us.
|
|
||||||
InternetModel::Service<SpotifyService>()->server()->StartPlaybackLater(url.toString(), port);
|
|
||||||
#else // HAVE_SPOTIFY
|
|
||||||
qLog(Error) << "Tried to play a spotify:// url, but spotify support is not compiled in";
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
|
// Pick a port number
|
||||||
|
const int port = Utilities::PickUnusedPort();
|
||||||
|
g_object_set(G_OBJECT(src), "host", "127.0.0.1", NULL);
|
||||||
|
g_object_set(G_OBJECT(src), "port", port, NULL);
|
||||||
|
|
||||||
|
// Link the elements
|
||||||
|
gst_element_link(src, gdp);
|
||||||
|
|
||||||
|
// Add a ghost pad
|
||||||
|
GstPad* pad = gst_element_get_static_pad(gdp, "src");
|
||||||
|
gst_element_add_pad(GST_ELEMENT(new_bin), gst_ghost_pad_new("src", pad));
|
||||||
|
gst_object_unref(GST_OBJECT(pad));
|
||||||
|
|
||||||
|
// Tell spotify to start sending data to us.
|
||||||
|
InternetModel::Service<SpotifyService>()->server()->StartPlaybackLater(url.toString(), port);
|
||||||
} else {
|
} else {
|
||||||
new_bin = engine_->CreateElement("uridecodebin");
|
new_bin = engine_->CreateElement("uridecodebin");
|
||||||
g_object_set(G_OBJECT(new_bin), "uri", url.toEncoded().constData(), NULL);
|
g_object_set(G_OBJECT(new_bin), "uri", url.toEncoded().constData(), NULL);
|
||||||
|
@ -23,14 +23,14 @@
|
|||||||
#include "digitallyimportedservicebase.h"
|
#include "digitallyimportedservicebase.h"
|
||||||
#include "groovesharkservice.h"
|
#include "groovesharkservice.h"
|
||||||
#include "icecastservice.h"
|
#include "icecastservice.h"
|
||||||
#include "jamendoservice.h"
|
|
||||||
#include "magnatuneservice.h"
|
|
||||||
#include "internetmimedata.h"
|
#include "internetmimedata.h"
|
||||||
#include "internetservice.h"
|
#include "internetservice.h"
|
||||||
|
#include "jamendoservice.h"
|
||||||
|
#include "magnatuneservice.h"
|
||||||
#include "savedradio.h"
|
#include "savedradio.h"
|
||||||
#include "somafmservice.h"
|
#include "somafmservice.h"
|
||||||
#include "groovesharkservice.h"
|
|
||||||
#include "soundcloudservice.h"
|
#include "soundcloudservice.h"
|
||||||
|
#include "spotifyservice.h"
|
||||||
#include "subsonicservice.h"
|
#include "subsonicservice.h"
|
||||||
#include "core/closure.h"
|
#include "core/closure.h"
|
||||||
#include "core/logging.h"
|
#include "core/logging.h"
|
||||||
@ -41,9 +41,6 @@
|
|||||||
#ifdef HAVE_LIBLASTFM
|
#ifdef HAVE_LIBLASTFM
|
||||||
#include "lastfmservice.h"
|
#include "lastfmservice.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
#include "spotifyservice.h"
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_GOOGLE_DRIVE
|
#ifdef HAVE_GOOGLE_DRIVE
|
||||||
#include "googledriveservice.h"
|
#include "googledriveservice.h"
|
||||||
#endif
|
#endif
|
||||||
@ -97,9 +94,7 @@ InternetModel::InternetModel(Application* app, QObject* parent)
|
|||||||
AddService(new SkyFmService(app, this));
|
AddService(new SkyFmService(app, this));
|
||||||
AddService(new SomaFMService(app, this));
|
AddService(new SomaFMService(app, this));
|
||||||
AddService(new SoundCloudService(app, this));
|
AddService(new SoundCloudService(app, this));
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
AddService(new SpotifyService(app, this));
|
AddService(new SpotifyService(app, this));
|
||||||
#endif
|
|
||||||
AddService(new SubsonicService(app, this));
|
AddService(new SubsonicService(app, this));
|
||||||
#ifdef HAVE_UBUNTU_ONE
|
#ifdef HAVE_UBUNTU_ONE
|
||||||
AddService(new UbuntuOneService(app, this));
|
AddService(new UbuntuOneService(app, this));
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "internetmodel.h"
|
#include "internetmodel.h"
|
||||||
#include "searchboxwidget.h"
|
#include "searchboxwidget.h"
|
||||||
|
#include "spotifyblobdownloader.h"
|
||||||
#include "spotifyserver.h"
|
#include "spotifyserver.h"
|
||||||
#include "spotifyservice.h"
|
#include "spotifyservice.h"
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
@ -30,9 +31,6 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
#include "spotifyblobdownloader.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QStandardItem*);
|
Q_DECLARE_METATYPE(QStandardItem*);
|
||||||
|
|
||||||
@ -292,11 +290,9 @@ void SpotifyService::StartBlobProcess() {
|
|||||||
app_->task_manager()->SetTaskFinished(login_task_id_);
|
app_->task_manager()->SetTaskFinished(login_task_id_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
if (SpotifyBlobDownloader::Prompt()) {
|
||||||
if (SpotifyBlobDownloader::Prompt()) {
|
InstallBlob();
|
||||||
InstallBlob();
|
}
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -321,14 +317,12 @@ bool SpotifyService::IsBlobInstalled() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SpotifyService::InstallBlob() {
|
void SpotifyService::InstallBlob() {
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
// The downloader deletes itself when it finishes
|
// The downloader deletes itself when it finishes
|
||||||
SpotifyBlobDownloader* downloader = new SpotifyBlobDownloader(
|
SpotifyBlobDownloader* downloader = new SpotifyBlobDownloader(
|
||||||
local_blob_version_, QFileInfo(local_blob_path_).path(), this);
|
local_blob_version_, QFileInfo(local_blob_path_).path(), this);
|
||||||
connect(downloader, SIGNAL(Finished()), SLOT(BlobDownloadFinished()));
|
connect(downloader, SIGNAL(Finished()), SLOT(BlobDownloadFinished()));
|
||||||
connect(downloader, SIGNAL(Finished()), SIGNAL(BlobStateChanged()));
|
connect(downloader, SIGNAL(Finished()), SIGNAL(BlobStateChanged()));
|
||||||
downloader->Start();
|
downloader->Start();
|
||||||
#endif // HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpotifyService::BlobDownloadFinished() {
|
void SpotifyService::BlobDownloadFinished() {
|
||||||
|
@ -73,12 +73,7 @@ void SpotifySettingsPage::BlobStateChanged() {
|
|||||||
|
|
||||||
ui_->account_group->setEnabled(installed);
|
ui_->account_group->setEnabled(installed);
|
||||||
ui_->blob_status->setText(installed ? tr("Installed") : tr("Not installed"));
|
ui_->blob_status->setText(installed ? tr("Installed") : tr("Not installed"));
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
ui_->download_blob->setEnabled(!installed);
|
ui_->download_blob->setEnabled(!installed);
|
||||||
#else
|
|
||||||
ui_->download_blob->hide();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpotifySettingsPage::DownloadBlob() {
|
void SpotifySettingsPage::DownloadBlob() {
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
#include <QTextCodec>
|
#include <QTextCodec>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QtConcurrentRun>
|
#include <QtConcurrentRun>
|
||||||
|
#include <QtCrypto>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
@ -74,9 +75,6 @@ using boost::scoped_ptr;
|
|||||||
|
|
||||||
#include <echonest/Config.h>
|
#include <echonest/Config.h>
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
#include <QtCrypto>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_OS_DARWIN
|
#ifdef Q_OS_DARWIN
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
@ -358,9 +356,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY_DOWNLOADER
|
|
||||||
QCA::Initializer qca_initializer;
|
QCA::Initializer qca_initializer;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Resources
|
// Resources
|
||||||
Q_INIT_RESOURCE(data);
|
Q_INIT_RESOURCE(data);
|
||||||
|
@ -80,11 +80,9 @@ QString About::MakeHtml() const {
|
|||||||
ret += QString("<br /><a href=\"http://www.smitelli.com/?page=blog&p=54\">Scott Smitelli</a>");
|
ret += QString("<br /><a href=\"http://www.smitelli.com/?page=blog&p=54\">Scott Smitelli</a>");
|
||||||
ret += QString("<br /><a href=\"http://hyperboleandahalf.blogspot.com\">Allie Brosh</a></p>");
|
ret += QString("<br /><a href=\"http://hyperboleandahalf.blogspot.com\">Allie Brosh</a></p>");
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
ret += "<p>This product uses Music by Spotify but is not endorsed, certified "
|
ret += "<p>This product uses Music by Spotify but is not endorsed, certified "
|
||||||
"or otherwise approved in any way by Spotify. Spotify is the registered "
|
"or otherwise approved in any way by Spotify. Spotify is the registered "
|
||||||
"trade mark of the Spotify Group.</p>";
|
"trade mark of the Spotify Group.</p>";
|
||||||
#endif // HAVE_SPOTIFY
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include "internet/digitallyimportedsettingspage.h"
|
#include "internet/digitallyimportedsettingspage.h"
|
||||||
#include "internet/groovesharksettingspage.h"
|
#include "internet/groovesharksettingspage.h"
|
||||||
#include "internet/magnatunesettingspage.h"
|
#include "internet/magnatunesettingspage.h"
|
||||||
|
#include "internet/spotifysettingspage.h"
|
||||||
#include "internet/subsonicsettingspage.h"
|
#include "internet/subsonicsettingspage.h"
|
||||||
#include "internet/ubuntuonesettingspage.h"
|
#include "internet/ubuntuonesettingspage.h"
|
||||||
#include "library/librarysettingspage.h"
|
#include "library/librarysettingspage.h"
|
||||||
@ -58,9 +59,6 @@
|
|||||||
# include "wiimotedev/wiimotesettingspage.h"
|
# include "wiimotedev/wiimotesettingspage.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
# include "internet/spotifysettingspage.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GOOGLE_DRIVE
|
#ifdef HAVE_GOOGLE_DRIVE
|
||||||
# include "internet/googledrivesettingspage.h"
|
# include "internet/googledrivesettingspage.h"
|
||||||
@ -176,10 +174,7 @@ SettingsDialog::SettingsDialog(Application* app, BackgroundStreams* streams, QWi
|
|||||||
AddPage(Page_Box, new BoxSettingsPage(this), providers);
|
AddPage(Page_Box, new BoxSettingsPage(this), providers);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SPOTIFY
|
|
||||||
AddPage(Page_Spotify, new SpotifySettingsPage(this), providers);
|
AddPage(Page_Spotify, new SpotifySettingsPage(this), providers);
|
||||||
#endif
|
|
||||||
|
|
||||||
AddPage(Page_Magnatune, new MagnatuneSettingsPage(this), providers);
|
AddPage(Page_Magnatune, new MagnatuneSettingsPage(this), providers);
|
||||||
AddPage(Page_DigitallyImported, new DigitallyImportedSettingsPage(this), providers);
|
AddPage(Page_DigitallyImported, new DigitallyImportedSettingsPage(this), providers);
|
||||||
AddPage(Page_BackgroundStreams, new BackgroundStreamsSettingsPage(this), providers);
|
AddPage(Page_BackgroundStreams, new BackgroundStreamsSettingsPage(this), providers);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user