[sound-juicer] 'play-row' should toggle playback when path is already playing



commit dd76687b704dc70908e54b05f5db2bc379cbba10
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Tue Aug 5 10:16:43 2014 +0100

    'play-row' should toggle playback when path is already playing
    
    If the track currently being played is the same as the one requested
    by 'play-row' then toggle playback rather than rewinding to the start
    of the track.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=151469

 src/sj-play.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/sj-play.c b/src/sj-play.c
index 396efaf..9b83779 100644
--- a/src/sj-play.c
+++ b/src/sj-play.c
@@ -435,6 +435,13 @@ on_tracklist_row_activate (GtkTreeView * treeview, GtkTreePath * path,
   if (!gtk_tree_model_get_iter (model, &iter, path))
     return;
   gtk_tree_model_get (model, &iter, COLUMN_NUMBER, &track, -1);
+  if (track == current_track + 1) {
+    if (is_playing () || is_paused ()) {
+      toggle_play ();
+      return;
+    }
+  }
+
   if (setup (&err)) {
     seek_to_track = track - 1;
     set_gst_ui_and_play ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]