about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--Documentation/dtas-splitfx.txt4
-rw-r--r--examples/splitfx.sample.yml2
-rw-r--r--examples/tfx.sample.yml2
-rw-r--r--lib/dtas/player.rb6
4 files changed, 10 insertions, 4 deletions
diff --git a/Documentation/dtas-splitfx.txt b/Documentation/dtas-splitfx.txt
index 3c421a4..8e37523 100644
--- a/Documentation/dtas-splitfx.txt
+++ b/Documentation/dtas-splitfx.txt
@@ -38,8 +38,8 @@ to use ecasound(1), too.
 # FILE FORMAT
 
 * infile - string, the pathname of the original audio file
-* env - hash of environment variables to set for all commands
-    env:
+* env - ordered hash of environment variables to set for all commands
+    env: !omap
       FX: vol +3dB stats
 * comments - hash of common tags for all audio (e.g. ARTIST, ALBUM, YEAR)
     comments:
diff --git a/examples/splitfx.sample.yml b/examples/splitfx.sample.yml
index d7ee06b..bbd224b 100644
--- a/examples/splitfx.sample.yml
+++ b/examples/splitfx.sample.yml
@@ -11,7 +11,7 @@ comments:
 # the sox command for dtas-player playback, there is no need to
 # specify this as it is the default:
 # command: exec sox "$INFILE" $SOXFMT - $TRIMFX $RGFX $FX
-env:
+env: !omap
   PATH: $PATH
   # these effects may be used in any command in this file, including targets
   SOX_OPTS: $SOX_OPTS -R
diff --git a/examples/tfx.sample.yml b/examples/tfx.sample.yml
index 2cbfbbc..205a0a1 100644
--- a/examples/tfx.sample.yml
+++ b/examples/tfx.sample.yml
@@ -4,7 +4,7 @@
 # test_trimfx.rb relies on this.
 ---
 infile: foo.flac
-env:
+env: !omap
   PATH: $PATH
   SOX_OPTS: $SOX_OPTS -R
   I2: second.flac
diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index d63bc8a..d6707c3 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -120,6 +120,10 @@ class DTAS::Player # :nodoc:
     rv
   end
 
+  def to_omap(hash)
+    YAML::Omap === hash ? hash : YAML::Omap.new.merge!(hash)
+  end
+
   def self.load(hash)
     rv = new
     rv.instance_eval do
@@ -150,6 +154,7 @@ class DTAS::Player # :nodoc:
         @source_map.each do |name, src|
           src_hsh = v[name] or next
           src.load!(src_hsh)
+          src.env = to_omap(src.env)
         end
         source_map_reload
       end
@@ -161,6 +166,7 @@ class DTAS::Player # :nodoc:
       if sinks = hash["sinks"]
         sinks.each do |sink_hsh|
           sink = DTAS::Sink.load(sink_hsh)
+          sink.env = to_omap(sink.env)
           @sinks[sink.name] = sink
         end
       end