#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
-#include "pbd/controllable_descriptor.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"
#include "pbd/file_utils.h"
#include "ardour/async_midi_port.h"
#include "ardour/audioengine.h"
#include "ardour/audioengine.h"
+#include "ardour/controllable_descriptor.h"
#include "ardour/filesystem_paths.h"
#include "ardour/session.h"
-#include "ardour/route.h"
#include "ardour/midi_ui.h"
#include "ardour/rc_configuration.h"
#include "ardour/midiport_manager.h"
using namespace PBD;
using namespace std;
-#include "i18n.h"
+#include "pbd/i18n.h"
#define midi_ui_context() MidiControlUI::instance() /* a UICallback-derived object that specifies the event loop for signal handling */
/* this one is cross-thread */
- Route::RemoteControlIDChange.connect (*this, MISSING_INVALIDATOR, boost::bind (&GenericMidiControlProtocol::reset_controllables, this), midi_ui_context());
+ PresentationInfo::Change.connect (*this, MISSING_INVALIDATOR, boost::bind (&GenericMidiControlProtocol::reset_controllables, this), midi_ui_context());
/* Catch port connections and disconnections (cross-thread) */
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR,
MapInfo mi;
- XMLProperty* prop = tree.root()->property ("name");
+ XMLProperty const * prop = tree.root()->property ("name");
if (!prop) {
continue;
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ) {
ptmp = i;
++ptmp;
- if (((*i)->first)->get_controllable() == c) {
- (*i)->second.disconnect();
- delete (*i)->first;
+ if (((*i)->mc)->get_controllable() == c) {
+ if ((*i)->own_mc) {
+ delete (*i)->mc;
+ }
+ (*i)->connection.disconnect();
delete *i;
pending_controllables.erase (i);
}
}
MIDIControllable* mc = 0;
+ bool own_mc = false;
for (MIDIControllables::iterator i = controllables.begin(); i != controllables.end(); ++i) {
if ((*i)->get_controllable() && ((*i)->get_controllable()->id() == c->id())) {
if (!mc) {
mc = new MIDIControllable (this, *_input_port->parser(), *c, false);
+ own_mc = true;
}
{
Glib::Threads::Mutex::Lock lm (pending_lock);
- MIDIPendingControllable* element = new MIDIPendingControllable;
- element->first = mc;
- c->LearningFinished.connect_same_thread (element->second, boost::bind (&GenericMidiControlProtocol::learning_stopped, this, mc));
+ MIDIPendingControllable* element = new MIDIPendingControllable (mc, own_mc);
+ c->LearningFinished.connect_same_thread (element->connection, boost::bind (&GenericMidiControlProtocol::learning_stopped, this, mc));
pending_controllables.push_back (element);
}
tmp = i;
++tmp;
- if ( (*i)->first == mc) {
- (*i)->second.disconnect();
+ if ( (*i)->mc == mc) {
+ (*i)->connection.disconnect();
delete *i;
pending_controllables.erase(i);
}
*/
for (MIDIPendingControllables::iterator i = pending_controllables.begin(); i != pending_controllables.end(); ++i) {
- if (((*i)->first)->get_controllable() == c) {
- (*i)->first->stop_learning ();
- dptr = (*i)->first;
- (*i)->second.disconnect();
+ if (((*i)->mc)->get_controllable() == c) {
+ (*i)->mc->stop_learning ();
+ dptr = (*i)->mc;
+ (*i)->connection.disconnect();
delete *i;
pending_controllables.erase (i);