everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: <dtas-all@nongnu.org>
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 3/3] player: support "source restart" command
Date: Sat, 27 Dec 2014 12:02:58 +0000	[thread overview]
Message-ID: <1419681778-6183-4-git-send-email-e@80x24.org> (raw)
In-Reply-To: <1419681778-6183-1-git-send-email-e@80x24.org>

This becomes useful for systems without inotify when we're editing
YAML (or whatever) files frequently and want changes to be reflected
right away during playback.  This is a weaker version of the plain
"restart" command, which restarts the entire playback chain.
 Documentation/dtas-player_protocol.txt | 12 +++++++++++-
 lib/dtas/player/client_handler.rb      |  6 +++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Documentation/dtas-player_protocol.txt b/Documentation/dtas-player_protocol.txt
index b8f8264..ff8f7ae 100644
--- a/Documentation/dtas-player_protocol.txt
+++ b/Documentation/dtas-player_protocol.txt
@@ -169,7 +169,9 @@ Commands here should be alphabetized according to `LC_ALL=C sort'
 * 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
-  libraries (e.g. a LADSPA plugin) is upgraded.
+  libraries (e.g. a LADSPA plugin) is upgraded.  Use "source restart"
+  instead to only restart the source chain, leaving the sinks
+  untouched.
 * rg RGARGS - configure ReplayGain support
   All FLOAT values may be adjusted via '+=' or '-=' instead of simple
@@ -233,6 +235,14 @@ Commands here should be alphabetized according to `LC_ALL=C sort'
         1. input type (flac/opus/mp3/etc)
         2. transport protocol (local FS/http/ftp/sftp/etc)
+* source ls - dump the names of sources sorted by tryorder
+* source restart - restart the current source command
+  This can be useful if the source file is changed during playback
+  and the current player process is holding onto an unlinked inode.
+  This is advantageous over a full "restart" as there is no audible
+  gap on most systems.
 * state dump [FILENAME]
   Immediately dump the state of the player.  If a FILENAME is specified,
   the state is written to that file.  Otherwise, the default state file
diff --git a/lib/dtas/player/client_handler.rb b/lib/dtas/player/client_handler.rb
index 37357f7..35f85c2 100644
--- a/lib/dtas/player/client_handler.rb
+++ b/lib/dtas/player/client_handler.rb
@@ -463,7 +463,11 @@ module DTAS::Player::ClientHandler # :nodoc:
   def source_handler(io, msg)
     map = @source_map
     op = msg.shift
-    if op == "ls"
+    case op
+    when "restart"
+      __current_requeue
+      return io.emit("OK")
+    when "ls"
       s = map.keys.sort { |a,b| map[a].tryorder <=> map[b].tryorder }
       return io.emit(s.join(' '))

      parent reply	other threads:[~2014-12-27 12:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-27 12:02 [PATCH 0/3] more functionality for editing audio Eric Wong
2014-12-27 12:02 ` [PATCH 1/3] dtas-console: keys for "cue next/prev" Eric Wong
2014-12-27 12:02 ` [PATCH 2/3] player: support playing splitfx YAML files Eric Wong
2014-12-27 12:02 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://80x24.org/dtas/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1419681778-6183-4-git-send-email-e@80x24.org \
    --to=e@80x24.org \
    --cc=dtas-all@nongnu.org \
    --subject='Re: [PATCH 3/3] player: support "source restart" command' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).