diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-05 01:49:32 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-05 01:49:32 +0000 |
commit | ffdf5ada616d285fafb58f45c2e3d37b212a328a (patch) | |
tree | eb4fa2dcd1db72bcbeffebf86fc40a3cf30cf4be /libs/ardour/io.cc | |
parent | 5ad68cf2c5a7df68b7cc3a3d5a4f76f03a54c32e (diff) |
Generic MIDI control now saves+restores its state; PBD::ID now requires a buffer size for its print() method
git-svn-id: svn://localhost/ardour2/trunk@949 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r-- | libs/ardour/io.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index f38f938675..34070f3dff 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -107,7 +107,7 @@ IO::IO (Session& s, string name, : _session (s), _name (name), _default_type(default_type), - _gain_control (*this), + _gain_control (X_("gaincontrol"), *this), _gain_automation_curve (0.0, 2.0, 1.0), _input_minimum (input_min), _input_maximum (input_max), @@ -1431,7 +1431,7 @@ IO::state (bool full_state) Glib::Mutex::Lock lm (io_lock); node->add_property("name", _name); - id().print (buf); + id().print (buf, sizeof (buf)); node->add_property("id", buf); str = ""; @@ -1513,6 +1513,7 @@ IO::state (bool full_state) } node->add_child_nocopy (_panner->state (full_state)); + node->add_child_nocopy (_gain_control.get_state ()); snprintf (buf, sizeof(buf), "%2.12f", gain()); node->add_property ("gain", buf); @@ -1627,9 +1628,15 @@ IO::set_state (const XMLNode& node) } for (iter = node.children().begin(); iter != node.children().end(); ++iter) { + if ((*iter)->name() == "Panner") { _panner->set_state (**iter); } + + if ((*iter)->name() == X_("gaincontrol")) { + _gain_control.set_state (**iter); + _session.add_controllable (&_gain_control); + } } if ((prop = node.property ("automation-state")) != 0) { |