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/surfaces | |
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/surfaces')
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.cc | 20 | ||||
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.cc | 2 | ||||
-rw-r--r-- | libs/surfaces/tranzport/tranzport_control_protocol.cc | 3 |
3 files changed, 18 insertions, 7 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index d905c0bc41..a8a5b6eace 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -39,7 +39,7 @@ using namespace PBD; #include "i18n.h" GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s) - : ControlProtocol (s, _("GenericMIDI")) + : ControlProtocol (s, _("Generic MIDI")) { MIDI::Manager* mm = MIDI::Manager::instance(); @@ -173,7 +173,10 @@ GenericMidiControlProtocol::stop_learning (Controllable* c) XMLNode& GenericMidiControlProtocol::get_state () { - XMLNode* node = new XMLNode (_name); /* node name must match protocol name */ + XMLNode* node = new XMLNode ("Protocol"); + + node->add_property (X_("name"), _name); + XMLNode* children = new XMLNode (X_("controls")); node->add_child_nocopy (*children); @@ -215,19 +218,24 @@ GenericMidiControlProtocol::set_state (const XMLNode& node) XMLProperty* prop; if ((prop = (*niter)->property ("id")) != 0) { - + ID id = prop->value (); - + c = session->controllable_by_id (id); - + if (c) { MIDIControllable* mc = new MIDIControllable (*_port, *c); if (mc->set_state (**niter) == 0) { controllables.insert (mc); } + + } else { + warning << string_compose (_("Generic MIDI control: controllable %1 not found in session (ignored)"), + id) + << endmsg; } } } - + return 0; } diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index d6135fd2a8..1cf32f11f6 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -345,6 +345,8 @@ MIDIControllable::set_state (const XMLNode& node) return -1; } + bind_midi (control_channel, control_type, control_additional); + return 0; } diff --git a/libs/surfaces/tranzport/tranzport_control_protocol.cc b/libs/surfaces/tranzport/tranzport_control_protocol.cc index 04d56c575c..2e2d943244 100644 --- a/libs/surfaces/tranzport/tranzport_control_protocol.cc +++ b/libs/surfaces/tranzport/tranzport_control_protocol.cc @@ -1577,7 +1577,8 @@ TranzportControlProtocol::print (int row, int col, const char *text) XMLNode& TranzportControlProtocol::get_state () { - XMLNode* node = new XMLNode (_name); /* node name must match protocol name */ + XMLNode* node = new XMLNode (X_("Protocol")); + node->add_property (X_("name"), _name); return *node; } |