summaryrefslogtreecommitdiff
path: root/libs/midi++2/port.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-08 22:55:20 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-08 22:55:20 +0000
commit648a169d8ff9987ba727e9ba50af4f33da6db165 (patch)
treed8e250205004633a9f5c94e15e8f3826fac183b6 /libs/midi++2/port.cc
parent3549189f87813b8c9f01f2f6484b34cf923a65ad (diff)
Move MIDI control port ownership into the MIDI Manager, since control port state should be Ardour-wide, not per-session. Fix up port connection state management.
git-svn-id: svn://localhost/ardour2/branches/3.0@7394 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/port.cc')
-rw-r--r--libs/midi++2/port.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/libs/midi++2/port.cc b/libs/midi++2/port.cc
index a6097c89dc..65cba24eb0 100644
--- a/libs/midi++2/port.cc
+++ b/libs/midi++2/port.cc
@@ -42,6 +42,7 @@ using namespace PBD;
pthread_t Port::_process_thread;
Signal0<void> Port::JackHalted;
Signal0<void> Port::MakeConnections;
+string Port::state_node_name = "MIDI-port";
Port::Port (string const & name, Flags flags, jack_client_t* jack_client)
: _currently_in_cycle (false)
@@ -406,7 +407,7 @@ Port::create_port ()
XMLNode&
Port::get_state () const
{
- XMLNode* root = new XMLNode ("MIDI-port");
+ XMLNode* root = new XMLNode (state_node_name);
root->add_property ("tag", _tagname);
if (_flags == IsInput) {
@@ -459,6 +460,10 @@ Port::set_state (const XMLNode& node)
{
const XMLProperty* prop;
+ if ((prop = node.property ("tag")) == 0 || prop->value() != _tagname) {
+ return;
+ }
+
if ((prop = node.property ("connections")) != 0 && _jack_port) {
_connections = prop->value ();
}
@@ -498,9 +503,9 @@ Port::is_process_thread()
}
void
-Port::reestablish (void* jack)
+Port::reestablish (jack_client_t* jack)
{
- _jack_client = static_cast<jack_client_t*> (jack);
+ _jack_client = jack;
int const r = create_port ();
if (r) {