From 91caa09c2e4021dcda1af79360527d0f15b2a4cd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 29 Aug 2013 09:52:26 +0000 Subject: rg: avoid adding gain if fallback_gain + preamp is near zero No need to add the vol effect if it's going to be a noop. --- lib/dtas/rg_state.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/dtas/rg_state.rb b/lib/dtas/rg_state.rb index a6c56f5..1cf97c7 100644 --- a/lib/dtas/rg_state.rb +++ b/lib/dtas/rg_state.rb @@ -74,8 +74,10 @@ class DTAS::RGState # :nodoc: # tag slips into the queue def rg_fallback_effect(reason) @fallback_gain or return + val = @fallback_gain + @preamp + return if val.abs < @gain_threshold warn(reason) if $DEBUG - "vol #{@fallback_gain + @preamp}dB" + "vol #{val}dB" end # returns an array (for command-line argument) for the effect needed -- cgit v1.2.3-24-ge0c7