chiark / gitweb /
Restore scratching from popup menu.
authorRichard Kettlewell <rjk@greenend.org.uk>
Wed, 11 Jun 2008 11:35:53 +0000 (12:35 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Wed, 11 Jun 2008 11:35:53 +0000 (12:35 +0100)
disobedience/queue-menu.c
disobedience/queue.c

index a8cd691..c8a224a 100644 (file)
@@ -72,12 +72,18 @@ void ql_properties_activate(GtkMenuItem attribute((unused)) *menuitem,
 /* Scratch */
 
 int ql_scratch_sensitive(struct queuelike attribute((unused)) *ql) {
-  return !!playing_track;
+  return !!(last_state & DISORDER_PLAYING)
+    && right_scratchable(last_rights, config->username, playing_track);
+}
+
+static void scratch_completed(void attribute((unused)) *v, const char *error) {
+  if(error)
+    popup_protocol_error(0, error);
 }
 
 void ql_scratch_activate(GtkMenuItem attribute((unused)) *menuitem,
                          gpointer attribute((unused)) user_data) {
-  /* TODO */
+  disorder_eclient_scratch_playing(client, scratch_completed, 0);
 }
 
 /* Remove */
index 9c0dcc4..3a481a2 100644 (file)
@@ -137,7 +137,7 @@ static struct queue_menuitem queue_menuitems[] = {
   { "Track properties", ql_properties_activate, ql_properties_sensitive, 0, 0 },
   { "Select all tracks", ql_selectall_activate, ql_selectall_sensitive, 0, 0 },
   { "Deselect all tracks", ql_selectnone_activate, ql_selectnone_sensitive, 0, 0 },
-  { "Scratch track", ql_scratch_activate, ql_scratch_sensitive, 0, 0 },
+  { "Scratch playing track", ql_scratch_activate, ql_scratch_sensitive, 0, 0 },
   { "Remove track from queue", ql_remove_activate, ql_remove_sensitive, 0, 0 },
 };