[Top][All Lists]

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

[PATCH 2/2] player: add "queue cat" command

From: Eric Wong
Subject: [PATCH 2/2] player: add "queue cat" command
Date: Mon, 7 Sep 2015 21:40:34 +0000

This will dump the contents of the current queue, including
positional seeking information and commands.  This is mainly
intended for debugging and tools which rely on dtas internals.
 Documentation/dtas-player_protocol.txt | 5 +++++
 lib/dtas/player.rb                     | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/Documentation/dtas-player_protocol.txt 
index e1b2487..b02d1e5 100644
--- a/Documentation/dtas-player_protocol.txt
+++ b/Documentation/dtas-player_protocol.txt
@@ -166,6 +166,11 @@ Commands here should be alphabetized according to 
`LC_ALL=C sort'
 * play_pause - toggle the play/pause state.  This starts playback if
   paused, and pauses playback if playing.
+* queue cat - dump the contents of the queue as YAML
+  This may include arbitrary commands to be executed, filenames,
+  and offsets for playback.  The format is not intended to be
+  stable and subject to internal changes in dtas-player.
 * restart - restarts all processes in the current pipeline.  Playback
   will be momentarily interrupted while this change occurs.  This is
   necessary if one of the commands (e.g. sox or ecasound) or loaded
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index a102618..a1e2040 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -251,6 +251,8 @@ class DTAS::Player # :nodoc:
       tl_handler(io, msg)
     when "trim"
       trim_handler(io, msg)
+    when "queue"
+      msg[0] == "cat" and io.emit(@queue.to_yaml)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]