summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Grandin <grandinp@altern.org>2016-12-06 18:10:30 -0800
committerPierre Grandin <grandinp@altern.org>2016-12-06 18:10:30 -0800
commitd25cc7a1bcb2d8c79c503c265baf683d409c44de (patch)
tree1370743a2135a5fb0ac43445ff8e2a356f8b2a04
parentb48fca09622a3472a7c990a6cb4db1adbadc9268 (diff)
downloadnavit-audio_merge.tar.gz
Updating spotify code for the audio_merge branchaudio_merge
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--navit/audio/player-spotify/CMakeLists.txt1
-rw-r--r--navit/audio/player-spotify/spotify.c32
-rw-r--r--navit/xpm/media_playlist_downloading.svg5
-rw-r--r--navit/xpm/media_playlist_no_offline.svg5
-rw-r--r--navit/xpm/media_playlist_offline.svg5
-rw-r--r--navit/xpm/media_playlist_pending.svg5
-rw-r--r--navit/xpm/media_track_downloading.svg5
-rw-r--r--navit/xpm/media_track_offline.svg5
-rw-r--r--navit/xpm/media_track_offline_done.svg5
-rw-r--r--navit/xpm/media_track_pending.svg5
11 files changed, 61 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 401647bd8..42da1c7c1 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -469,8 +469,6 @@ endif (ALSA_FOUND)
if (LIBSPOTIFY_FOUND)
if (ALSA_FOUND)#
set_with_reason(audio/player-spotify "libspotify and alsa found" TRUE)
- # FIXME : this is a bad way to do it as maptool also gets linked
- list(APPEND NAVIT_LIBS "-lasound -lspotify -lpthread")
else (ALSA_FOUND)
set_with_reason(audio/player-spotify "libspotify found but alsalib is missing" FALSE)
endif (ALSA_FOUND)
diff --git a/navit/audio/player-spotify/CMakeLists.txt b/navit/audio/player-spotify/CMakeLists.txt
index 0f7345bc0..acef63504 100644
--- a/navit/audio/player-spotify/CMakeLists.txt
+++ b/navit/audio/player-spotify/CMakeLists.txt
@@ -1 +1,2 @@
module_add_library(audio_player-spotify spotify.c api_keys.c alsa-audio.c audio.c)
+target_link_libraries(audio_player-spotify ${ALSA_LIBRARY} ${LIBSPOTIFY_LIBRARIES})
diff --git a/navit/audio/player-spotify/spotify.c b/navit/audio/player-spotify/spotify.c
index 86d7cbc7b..49825fbc4 100644
--- a/navit/audio/player-spotify/spotify.c
+++ b/navit/audio/player-spotify/spotify.c
@@ -36,7 +36,7 @@ struct audio_priv {
int width;
gboolean muted;
int playing;
- char *login;
+ char *login;
char *password;
char *playlist;
sp_playlistcontainer *pc;
@@ -341,11 +341,11 @@ action_do(struct audio_priv *this, const int action)
switch(action)
{
case AUDIO_PLAYBACK_PAUSE:{
- //spotify_pause();
+ spotify_pause();
break;
}
case AUDIO_PLAYBACK_PLAY:{
- //spotify_play();
+ spotify_play();
break;
}
case AUDIO_PLAYBACK_TOGGLE:{
@@ -809,6 +809,14 @@ spotify_toggle_playback (struct audio_actions *action)
callback_list_call_attr_0(spotify->cbl, attr_playing);
}
+void spotify_play(){
+ try_jukebox_start ();
+}
+
+void spotify_pause(){
+ try_jukebox_start ();
+}
+
GList *
playlists(struct audio_priv *this)
{
@@ -831,23 +839,23 @@ playlists(struct audio_priv *this)
switch (sp_playlist_get_offline_status (g_sess, spl))
{
case SP_PLAYLIST_OFFLINE_STATUS_NO:
- pl->icon = "playlist_no_offline";
+ pl->icon = "media_playlist_no_offline";
break;
case SP_PLAYLIST_OFFLINE_STATUS_YES:
- pl->icon = "playlist_offline";
+ pl->icon = "media_playlist_offline";
break;
case SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING:
- pl->icon = "playlist_downloading";
+ pl->icon = "media_playlist_downloading";
break;
case SP_PLAYLIST_OFFLINE_STATUS_WAITING:
- pl->icon = "playlist_pending";
+ pl->icon = "media_playlist_pending";
break;
default:
- pl->icon = "music_red";
+ pl->icon = "media_playlist_no_offline";
break;
}
}
@@ -877,16 +885,16 @@ tracks(struct audio_priv *this, int playlist_index)
switch (sp_track_offline_get_status (track))
{
case SP_TRACK_OFFLINE_DONE:
- t->icon = "music_green";
+ t->icon = "media_track_offline_done";
break;
case SP_TRACK_OFFLINE_DOWNLOADING:
- t->icon = "music_orange";
+ t->icon = "media_track_downloading";
break;
case SP_TRACK_OFFLINE_NO:
- t->icon = "music_blue";
+ t->icon = "media_track_pending";
break;
default:
- t->icon = "music_red";
+ t->icon = "media_track_offline";
}
t->icon=g_strdup ((i == g_track_index) ? "play" : t->icon);
diff --git a/navit/xpm/media_playlist_downloading.svg b/navit/xpm/media_playlist_downloading.svg
new file mode 100644
index 000000000..66b6a3f0e
--- /dev/null
+++ b/navit/xpm/media_playlist_downloading.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="blue" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57,35.5808L 57,55C 57,56.4468 56.8159,57.5384 56.4476,58.2749C 56.0794,59.0113 55.2259,59.8757 54.3455,60.3543C 53.4651,60.8328 52.4698,61.072 51.3595,61.072C 50.0847,61.072 49.0678,60.7066 48.3089,59.9757C 47.55,59.2449 47.1706,58.3019 47.1706,57.1467C 47.1706,55.9803 47.6201,54.9728 48.5192,54.1242C 49.4183,53.2755 50.58,52.8512 52.0044,52.8512L 53.2408,52.9746L 54,53.25L 54,41.2251L 45,44.3472L 45,59C 45,60.4131 44.8131,61.5141 44.4392,62.3029C 44.0654,63.0917 43.2099,63.7151 42.2996,64.1824C 41.3893,64.6497 40.3958,64.8833 39.3191,64.8833C 38.0481,64.8833 37.0415,64.5245 36.2994,63.8067C 35.5573,63.0889 35.1863,62.1506 35.1863,60.9916C 35.1863,59.7654 35.6302,58.7346 36.5181,57.899C 37.406,57.0635 38.5677,56.6457 40.0033,56.6457C 40.6818,56.6457 41.2918,56.5962 42,56.8778L 42,41L 57,35.5808 Z M 20,17L 43.25,17L 56,29.75L 56,34.75L 52,36.25L 52,34L 39,34L 39,21L 24,21L 24,55L 37.5,55L 34,59L 20,59L 20,17 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z "/>
+</svg>
diff --git a/navit/xpm/media_playlist_no_offline.svg b/navit/xpm/media_playlist_no_offline.svg
new file mode 100644
index 000000000..49bc927f1
--- /dev/null
+++ b/navit/xpm/media_playlist_no_offline.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="red" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57,35.5808L 57,55C 57,56.4468 56.8159,57.5384 56.4476,58.2749C 56.0794,59.0113 55.2259,59.8757 54.3455,60.3543C 53.4651,60.8328 52.4698,61.072 51.3595,61.072C 50.0847,61.072 49.0678,60.7066 48.3089,59.9757C 47.55,59.2449 47.1706,58.3019 47.1706,57.1467C 47.1706,55.9803 47.6201,54.9728 48.5192,54.1242C 49.4183,53.2755 50.58,52.8512 52.0044,52.8512L 53.2408,52.9746L 54,53.25L 54,41.2251L 45,44.3472L 45,59C 45,60.4131 44.8131,61.5141 44.4392,62.3029C 44.0654,63.0917 43.2099,63.7151 42.2996,64.1824C 41.3893,64.6497 40.3958,64.8833 39.3191,64.8833C 38.0481,64.8833 37.0415,64.5245 36.2994,63.8067C 35.5573,63.0889 35.1863,62.1506 35.1863,60.9916C 35.1863,59.7654 35.6302,58.7346 36.5181,57.899C 37.406,57.0635 38.5677,56.6457 40.0033,56.6457C 40.6818,56.6457 41.2918,56.5962 42,56.8778L 42,41L 57,35.5808 Z M 20,17L 43.25,17L 56,29.75L 56,34.75L 52,36.25L 52,34L 39,34L 39,21L 24,21L 24,55L 37.5,55L 34,59L 20,59L 20,17 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z "/>
+</svg>
diff --git a/navit/xpm/media_playlist_offline.svg b/navit/xpm/media_playlist_offline.svg
new file mode 100644
index 000000000..0750b8758
--- /dev/null
+++ b/navit/xpm/media_playlist_offline.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="green" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57,35.5808L 57,55C 57,56.4468 56.8159,57.5384 56.4476,58.2749C 56.0794,59.0113 55.2259,59.8757 54.3455,60.3543C 53.4651,60.8328 52.4698,61.072 51.3595,61.072C 50.0847,61.072 49.0678,60.7066 48.3089,59.9757C 47.55,59.2449 47.1706,58.3019 47.1706,57.1467C 47.1706,55.9803 47.6201,54.9728 48.5192,54.1242C 49.4183,53.2755 50.58,52.8512 52.0044,52.8512L 53.2408,52.9746L 54,53.25L 54,41.2251L 45,44.3472L 45,59C 45,60.4131 44.8131,61.5141 44.4392,62.3029C 44.0654,63.0917 43.2099,63.7151 42.2996,64.1824C 41.3893,64.6497 40.3958,64.8833 39.3191,64.8833C 38.0481,64.8833 37.0415,64.5245 36.2994,63.8067C 35.5573,63.0889 35.1863,62.1506 35.1863,60.9916C 35.1863,59.7654 35.6302,58.7346 36.5181,57.899C 37.406,57.0635 38.5677,56.6457 40.0033,56.6457C 40.6818,56.6457 41.2918,56.5962 42,56.8778L 42,41L 57,35.5808 Z M 20,17L 43.25,17L 56,29.75L 56,34.75L 52,36.25L 52,34L 39,34L 39,21L 24,21L 24,55L 37.5,55L 34,59L 20,59L 20,17 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z "/>
+</svg>
diff --git a/navit/xpm/media_playlist_pending.svg b/navit/xpm/media_playlist_pending.svg
new file mode 100644
index 000000000..2692ae67f
--- /dev/null
+++ b/navit/xpm/media_playlist_pending.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="orange" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57,35.5808L 57,55C 57,56.4468 56.8159,57.5384 56.4476,58.2749C 56.0794,59.0113 55.2259,59.8757 54.3455,60.3543C 53.4651,60.8328 52.4698,61.072 51.3595,61.072C 50.0847,61.072 49.0678,60.7066 48.3089,59.9757C 47.55,59.2449 47.1706,58.3019 47.1706,57.1467C 47.1706,55.9803 47.6201,54.9728 48.5192,54.1242C 49.4183,53.2755 50.58,52.8512 52.0044,52.8512L 53.2408,52.9746L 54,53.25L 54,41.2251L 45,44.3472L 45,59C 45,60.4131 44.8131,61.5141 44.4392,62.3029C 44.0654,63.0917 43.2099,63.7151 42.2996,64.1824C 41.3893,64.6497 40.3958,64.8833 39.3191,64.8833C 38.0481,64.8833 37.0415,64.5245 36.2994,63.8067C 35.5573,63.0889 35.1863,62.1506 35.1863,60.9916C 35.1863,59.7654 35.6302,58.7346 36.5181,57.899C 37.406,57.0635 38.5677,56.6457 40.0033,56.6457C 40.6818,56.6457 41.2918,56.5962 42,56.8778L 42,41L 57,35.5808 Z M 20,17L 43.25,17L 56,29.75L 56,34.75L 52,36.25L 52,34L 39,34L 39,21L 24,21L 24,55L 37.5,55L 34,59L 20,59L 20,17 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z "/>
+</svg>
diff --git a/navit/xpm/media_track_downloading.svg b/navit/xpm/media_track_downloading.svg
new file mode 100644
index 000000000..8f8ccfc62
--- /dev/null
+++ b/navit/xpm/media_track_downloading.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="orange" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,47.5L 28.5,47.6496L 28.5,23.75L 53.8333,19L 53.8333,47.5C 53.8333,50.1234 50.9978,52.25 47.5,52.25C 44.0022,52.25 41.1667,50.1234 41.1667,47.5C 41.1667,44.8766 44.0022,42.75 47.5,42.75C 48.0467,42.75 48.5773,42.802 49.0833,42.8997L 49.0833,24.6406L 33.25,27.6094L 33.25,52.25C 33.25,54.8734 30.4145,57 26.9167,57C 23.4189,57 20.5833,54.8734 20.5833,52.25C 20.5833,49.6266 23.4189,47.5 26.9167,47.5 Z "/>
+</svg>
diff --git a/navit/xpm/media_track_offline.svg b/navit/xpm/media_track_offline.svg
new file mode 100644
index 000000000..650a3cd4d
--- /dev/null
+++ b/navit/xpm/media_track_offline.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="red" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,47.5L 28.5,47.6496L 28.5,23.75L 53.8333,19L 53.8333,47.5C 53.8333,50.1234 50.9978,52.25 47.5,52.25C 44.0022,52.25 41.1667,50.1234 41.1667,47.5C 41.1667,44.8766 44.0022,42.75 47.5,42.75C 48.0467,42.75 48.5773,42.802 49.0833,42.8997L 49.0833,24.6406L 33.25,27.6094L 33.25,52.25C 33.25,54.8734 30.4145,57 26.9167,57C 23.4189,57 20.5833,54.8734 20.5833,52.25C 20.5833,49.6266 23.4189,47.5 26.9167,47.5 Z "/>
+</svg>
diff --git a/navit/xpm/media_track_offline_done.svg b/navit/xpm/media_track_offline_done.svg
new file mode 100644
index 000000000..ddf3edda8
--- /dev/null
+++ b/navit/xpm/media_track_offline_done.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="green" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,47.5L 28.5,47.6496L 28.5,23.75L 53.8333,19L 53.8333,47.5C 53.8333,50.1234 50.9978,52.25 47.5,52.25C 44.0022,52.25 41.1667,50.1234 41.1667,47.5C 41.1667,44.8766 44.0022,42.75 47.5,42.75C 48.0467,42.75 48.5773,42.802 49.0833,42.8997L 49.0833,24.6406L 33.25,27.6094L 33.25,52.25C 33.25,54.8734 30.4145,57 26.9167,57C 23.4189,57 20.5833,54.8734 20.5833,52.25C 20.5833,49.6266 23.4189,47.5 26.9167,47.5 Z "/>
+</svg>
diff --git a/navit/xpm/media_track_pending.svg b/navit/xpm/media_track_pending.svg
new file mode 100644
index 000000000..99ea6d7e2
--- /dev/null
+++ b/navit/xpm/media_track_pending.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
+ <path fill="blue" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,47.5L 28.5,47.6496L 28.5,23.75L 53.8333,19L 53.8333,47.5C 53.8333,50.1234 50.9978,52.25 47.5,52.25C 44.0022,52.25 41.1667,50.1234 41.1667,47.5C 41.1667,44.8766 44.0022,42.75 47.5,42.75C 48.0467,42.75 48.5773,42.802 49.0833,42.8997L 49.0833,24.6406L 33.25,27.6094L 33.25,52.25C 33.25,54.8734 30.4145,57 26.9167,57C 23.4189,57 20.5833,54.8734 20.5833,52.25C 20.5833,49.6266 23.4189,47.5 26.9167,47.5 Z "/>
+</svg>