diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-23 21:29:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-06-23 21:29:39 +0000 |
commit | f71a197270588153316322e87b3ba7b58da0d8f5 (patch) | |
tree | 01552be8d02988b4e57d6065aca65cc66de6ccda /libs/ardour/amp.cc | |
parent | d13fdaa9d19e0db68ddcc792c3c3bb8ff661a72e (diff) |
save&restore gain levels; provide GUI control over relative route group bit; fix up solo/mute/recenable button naming as mixer strip width is set
git-svn-id: svn://localhost/ardour2/branches/3.0@5263 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/amp.cc')
-rw-r--r-- | libs/ardour/amp.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 28edaf43a0..d6c6f00ee5 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -222,6 +222,7 @@ void Amp::inc_gain (gain_t factor, void *src) { float desired_gain = _gain_control->user_float(); + if (desired_gain == 0.0f) { set_gain (0.000001f + (0.000001f * factor), src); } else { @@ -255,9 +256,33 @@ Amp::state (bool full_state) { XMLNode& node (Processor::state (full_state)); node.add_property("type", "amp"); + + char buf[32]; + snprintf (buf, sizeof (buf), "%2.12f", _gain_control->get_value()); + node.add_property("gain", buf); + return node; } +int +Amp::set_state (const XMLNode& node) +{ + const XMLProperty* prop; + + Processor::set_state (node); + prop = node.property ("gain"); + + if (prop) { + gain_t val; + + if (sscanf (prop->value().c_str(), "%f", &val) == 1) { + _gain_control->set_value (val); + } + } + + return 0; +} + void Amp::GainControl::set_value (float val) { |