diff options
-rw-r--r-- | features.txt | 7 | ||||
-rw-r--r-- | gtkplaylist.c | 17 | ||||
-rw-r--r-- | gtkplaylist.h | 3 | ||||
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | messages.h | 1 | ||||
-rw-r--r-- | playlist.c | 5 |
6 files changed, 33 insertions, 3 deletions
diff --git a/features.txt b/features.txt index 0e2de6f4..0a135a9c 100644 --- a/features.txt +++ b/features.txt @@ -1,6 +1,7 @@ -play song even if not in playlist +[+] play song even if not in playlist [+] volume changer must be software, and work with all codecs (at mix level) [+] volume changer must work even no song is playing +[-] eat minimum memory (dont hold all metainfo in memory, etc) +[+] seamless playback (no pauses between tracks) + * still needs some more work in some codecs playlist must be superfast -eat minimum memory (dont hold all metainfo in memory, etc) -seamless playback (no pauses between tracks) diff --git a/gtkplaylist.c b/gtkplaylist.c index 536e2bfe..9ebbcdb1 100644 --- a/gtkplaylist.c +++ b/gtkplaylist.c @@ -449,3 +449,20 @@ gtkps_update_songinfo (void) { } } +void +gtkps_songchanged (int from, int to) { + if (from >= 0 || to >= 0) { + GDK_THREADS_ENTER(); + GtkWidget *widget = lookup_widget (mainwin, "playlist"); + if (!widget) { + return; + } + if (from >= 0) { + redraw_ps_row (widget, from); + } + if (to >= 0) { + redraw_ps_row (widget, to); + } + GDK_THREADS_LEAVE(); + } +} diff --git a/gtkplaylist.h b/gtkplaylist.h index 61917cb8..886ce452 100644 --- a/gtkplaylist.h +++ b/gtkplaylist.h @@ -58,4 +58,7 @@ gtkps_playsongnum (int idx); void gtkps_update_songinfo (void); +void +gtkps_songchanged (int from, int to); + #endif @@ -27,6 +27,9 @@ psdl_thread (uintptr_t ctx) { uint32_t p2; while (messagepump_pop(&msg, &ctx, &p1, &p2) != -1) { switch (msg) { + case M_SONGCHANGED: + gtkps_songchanged (p1, p2); + break; case M_SONGFINISHED: // play next song in playlists GDK_THREADS_ENTER(); @@ -11,6 +11,7 @@ enum { M_PAUSESONG, M_PLAYRANDOM, M_SONGSEEK, + M_SONGCHANGED, // p1=from, p2=to }; #endif // __MESSAGES_H @@ -14,6 +14,8 @@ #include "cflac.h" #include "csid.h" #include "streamer.h" +#include "messagepump.h" +#include "messages.h" #define SKIP_BLANK_CUE_TRACKS 1 @@ -431,6 +433,8 @@ ps_item_free (playItem_t *it) { int ps_set_current (playItem_t *it) { int ret = 0; + int from = ps_get_idx_of (playlist_current_ptr); + int to = ps_get_idx_of (it); if (it == playlist_current_ptr) { if (it && it->codec) { codec_lock (); @@ -459,6 +463,7 @@ ps_set_current (playItem_t *it) { streamer_reset (); } codec_unlock (); + messagepump_push (M_SONGCHANGED, 0, from, to); return ret; } |