about summary refs log tree commit homepage
path: root/lib/dtas
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-01-17 11:30:51 +0000
committerEric Wong <e@80x24.org>2015-01-19 09:56:52 +0000
commitb5bc0240f47dba01ff0a09263c210e5d391f88dc (patch)
tree8ae74163f66a575d36ba80acc615d6e37c116dc0 /lib/dtas
parent8f07678251b20f41063cd0a8fbf81f3b4bd39967 (diff)
downloaddtas-b5bc0240f47dba01ff0a09263c210e5d391f88dc.tar.gz
This allows changes in the source YAML file to be reflected
immediately in player after the user saves the file in their
favorite $EDITOR.  Previously, a user would need to:

	1) start dtas-sourceedit, spawning $EDITOR
	2) edit the file
	3) save changes
	4) exit $EDITOR
	5) repeat starting from 1) until happy with the results

Now, the workflow allows avoiding the context switch between their
$EDITOR and terminal to restart dtas-sourcedit:

	1) start dtas-sourceedit, spawning $EDITOR
	2) edit the file
	3) save changes
	4) repeat starting from 1) until happy with the results
	5) exit $EDITOR

In my experience, this greatly speeds up tuning of the playback
change, giving all the repeatability and flexibility of editing text
files while having the immediacy of an interactive UI.

Keep in mind this can cause problems for those with auto-save
enabled in their $EDITOR buffer at inopportune times, so a
-N/--no-watch option is added.
Diffstat (limited to 'lib/dtas')
-rw-r--r--lib/dtas/source/splitfx.rb4
-rw-r--r--lib/dtas/watchable.rb (renamed from lib/dtas/source/watchable.rb)2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/dtas/source/splitfx.rb b/lib/dtas/source/splitfx.rb
index 19b2c16..80d8473 100644
--- a/lib/dtas/source/splitfx.rb
+++ b/lib/dtas/source/splitfx.rb
@@ -3,12 +3,12 @@
 require 'yaml'
 require_relative 'sox'
 require_relative '../splitfx'
-require_relative 'watchable'
+require_relative '../watchable'
 
 class DTAS::Source::SplitFX < DTAS::Source::Sox # :nodoc:
   MAX_YAML_SIZE = 512 * 1024
   attr_writer :sox, :sfx
-  include DTAS::Source::Watchable if defined?(DTAS::Source::Watchable)
+  include DTAS::Watchable if defined?(DTAS::Watchable)
 
   SPLITFX_DEFAULTS = SOX_DEFAULTS.merge(
     "command" => "#{SOX_DEFAULTS["command"]} $FX",
diff --git a/lib/dtas/source/watchable.rb b/lib/dtas/watchable.rb
index 3ff9ef8..d4c384c 100644
--- a/lib/dtas/source/watchable.rb
+++ b/lib/dtas/watchable.rb
@@ -7,7 +7,7 @@ end
 
 # used to restart DTAS::Source::SplitFX processing in dtas-player
 # if the YAML file is edited
-module DTAS::Source::Watchable
+module DTAS::Watchable
   class InotifyReadableIter < SleepyPenguin::Inotify
     def self.new
       super(:CLOEXEC)