Add a Midi port per Midi Tracer window that can be connected to for debugging.
This commit is contained in:
parent
6f251f8b2f
commit
944eae53e6
|
@ -34,11 +34,14 @@
|
|||
#include "ardour/async_midi_port.h"
|
||||
#include "ardour/midi_port.h"
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/transport_master_manager.h"
|
||||
|
||||
#include "midi_tracer.h"
|
||||
#include "gui_thread.h"
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
unsigned int MidiTracer::window_count = 0;
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace std;
|
||||
using namespace MIDI;
|
||||
|
@ -62,6 +65,9 @@ MidiTracer::MidiTracer ()
|
|||
{
|
||||
g_atomic_int_set (&_update_queued, 0);
|
||||
|
||||
std::string portname (string_compose(X_("MIDI Tracer %1"), ++window_count));
|
||||
tracer_port = ARDOUR::AudioEngine::instance()->register_input_port (ARDOUR::DataType::MIDI, portname, false, ARDOUR::PortFlags::IsInput);
|
||||
|
||||
ARDOUR::AudioEngine::instance()->PortRegisteredOrUnregistered.connect
|
||||
(_manager_connection, invalidator (*this), boost::bind (&MidiTracer::ports_changed, this), gui_context());
|
||||
|
||||
|
@ -159,10 +165,14 @@ MidiTracer::port_changed ()
|
|||
|
||||
disconnect ();
|
||||
|
||||
if (_port_combo.get_active_text().empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ARDOUR::Port> p = AudioEngine::instance()->get_port_by_name (_port_combo.get_active_text());
|
||||
|
||||
if (!p) {
|
||||
std::cerr << "port not found\n";
|
||||
std::cerr << "port not found: " << _port_combo.get_active_text() << "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,10 @@ private:
|
|||
PBD::ScopedConnection _manager_connection;
|
||||
MIDI::Parser my_parser;
|
||||
|
||||
boost::shared_ptr<ARDOUR::Port> tracer_port;
|
||||
boost::shared_ptr<ARDOUR::MidiPort> traced_port;
|
||||
|
||||
static unsigned int window_count;
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_midi_tracer_h__ */
|
||||
|
|
|
@ -676,6 +676,10 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir
|
|||
reserved_io_names[_("Master")] = true;
|
||||
reserved_io_names[X_("auditioner")] = true; // auditioner.cc Track (s, "auditioner",...)
|
||||
reserved_io_names[X_("x-virtual-keyboard")] = false;
|
||||
reserved_io_names[X_("MIDI Tracer 1")] = false;
|
||||
reserved_io_names[X_("MIDI Tracer 2")] = false;
|
||||
reserved_io_names[X_("MIDI Tracer 3")] = false;
|
||||
reserved_io_names[X_("MIDI Tracer 4")] = false;
|
||||
|
||||
/* pure I/O */
|
||||
reserved_io_names[X_("Click")] = false; // session.cc ClickIO (*this, X_("Click")
|
||||
|
|
Loading…
Reference in New Issue