summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-07 00:40:58 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-07 00:40:58 +0000
commitea23298f10e9587eba483cb54a6f7d75ca68126a (patch)
treebdd396ac05d0be01cbbcc6447844a04814e79cbf /libs/ardour
parent6cccf3ce7dc86998d6797f393bec5b69610fc5f3 (diff)
Setup fixed ports for MIDI control data; hence remove configuration of those ports. Move MIDI tracer to the Windows menu. Trim some unused code from the midi++ Manager.
git-svn-id: svn://localhost/ardour2/branches/3.0@7384 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/ardour.h7
-rw-r--r--libs/ardour/ardour/rc_configuration.h2
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h4
-rw-r--r--libs/ardour/ardour/session.h29
-rw-r--r--libs/ardour/globals.cc88
-rw-r--r--libs/ardour/rc_configuration.cc21
-rw-r--r--libs/ardour/session.cc14
-rw-r--r--libs/ardour/session_midi.cc300
-rw-r--r--libs/ardour/session_state.cc53
-rw-r--r--libs/ardour/session_transport.cc8
-rw-r--r--libs/ardour/ticker.cc2
11 files changed, 51 insertions, 477 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h
index 2b1f7bbb04..11a5940c7c 100644
--- a/libs/ardour/ardour/ardour.h
+++ b/libs/ardour/ardour/ardour.h
@@ -71,13 +71,6 @@ namespace ARDOUR {
static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */
void setup_fpu ();
-
- extern MIDI::Port* default_mmc_port;
- extern MIDI::Port* default_mtc_port;
- extern MIDI::Port* default_midi_port;
- extern MIDI::Port *default_midi_clock_port;
-
- int setup_midi ();
}
#endif /* __ardour_ardour_h__ */
diff --git a/libs/ardour/ardour/rc_configuration.h b/libs/ardour/ardour/rc_configuration.h
index 35b22106dd..de697a0b88 100644
--- a/libs/ardour/ardour/rc_configuration.h
+++ b/libs/ardour/ardour/rc_configuration.h
@@ -43,8 +43,6 @@ class RCConfiguration : public Configuration
XMLNode& get_variables ();
void set_variables (XMLNode const &);
- std::map<std::string, XMLNode> midi_ports;
-
int load_state ();
int save_state ();
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index e98f396b95..be07069f7f 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -25,10 +25,6 @@ CONFIG_VARIABLE (AutoConnectOption, input_auto_connect, "input-auto-connect", Au
/* MIDI and MIDI related */
-CONFIG_VARIABLE (std::string, mtc_port_name, "mtc-port-name", "control")
-CONFIG_VARIABLE (std::string, mmc_port_name, "mmc-port-name", "control")
-CONFIG_VARIABLE (std::string, midi_port_name, "midi-port-name", "control")
-CONFIG_VARIABLE (std::string, midi_clock_port_name, "midi-clock-port-name", "control")
CONFIG_VARIABLE (bool, trace_midi_input, "trace-midi-input", false)
CONFIG_VARIABLE (bool, trace_midi_output, "trace-midi-output", false)
CONFIG_VARIABLE (bool, send_mtc, "send-mtc", false)
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 77b75a819a..a7c3aae7a7 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -641,23 +641,17 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/* MIDI control */
void midi_panic(void);
- int set_mtc_port (std::string port_tag);
- int set_midi_port (std::string port_tag);
- int set_midi_clock_port (std::string port_tag);
- MIDI::Port *mtc_port() const { return _mtc_port; }
- MIDI::Port *midi_port() const { return _midi_port; }
- MIDI::Port *midi_clock_port() const { return _midi_clock_port; }
+ MIDI::Port *mtc_input_port() const { return _mtc_input_port; }
+ MIDI::Port *mtc_output_port() const { return _mtc_output_port; }
+ MIDI::Port *midi_input_port() const { return _midi_input_port; }
+ MIDI::Port *midi_output_port() const { return _midi_output_port; }
+ MIDI::Port *midi_clock_input_port() const { return _midi_clock_input_port; }
+ MIDI::Port *midi_clock_output_port() const { return _midi_clock_output_port; }
PBD::Signal0<void> MTC_PortChanged;
PBD::Signal0<void> MIDI_PortChanged;
PBD::Signal0<void> MIDIClock_PortChanged;
- void set_trace_midi_input (bool, MIDI::Port* port = 0);
- void set_trace_midi_output (bool, MIDI::Port* port = 0);
-
- bool get_trace_midi_input(MIDI::Port *port = 0);
- bool get_trace_midi_output(MIDI::Port *port = 0);
-
/* Scrubbing */
void start_scrub (nframes_t where);
@@ -950,9 +944,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
void check_declick_out ();
MIDI::MachineControl* _mmc;
- MIDI::Port* _mtc_port;
- MIDI::Port* _midi_port;
- MIDI::Port* _midi_clock_port;
+ MIDI::Port* _mtc_input_port;
+ MIDI::Port* _mtc_output_port;
+ MIDI::Port* _midi_input_port;
+ MIDI::Port* _midi_output_port;
+ MIDI::Port* _midi_clock_input_port;
+ MIDI::Port* _midi_clock_output_port;
std::string _path;
std::string _name;
bool _is_new;
@@ -1154,8 +1151,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
int start_midi_thread ();
void terminate_midi_thread ();
- int use_config_midi_ports ();
-
void set_play_loop (bool yn);
void unset_play_loop ();
void overwrite_some_buffers (Track *);
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index e4addcd88a..111b824c28 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -98,11 +98,6 @@ using namespace ARDOUR;
using namespace std;
using namespace PBD;
-MIDI::Port *ARDOUR::default_mmc_port = 0;
-MIDI::Port *ARDOUR::default_mtc_port = 0;
-MIDI::Port *ARDOUR::default_midi_port = 0;
-MIDI::Port *ARDOUR::default_midi_clock_port = 0;
-
compute_peak_t ARDOUR::compute_peak = 0;
find_peaks_t ARDOUR::find_peaks = 0;
apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0;
@@ -146,87 +141,6 @@ ARDOUR::make_property_quarks ()
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for envelope_FAKE = %1\n", Properties::envelope.property_id));
}
-int
-ARDOUR::setup_midi ()
-{
- if (Config->midi_ports.size() == 0) {
- return 0;
- }
-
- BootMessage (_("Configuring MIDI ports"));
-
- for (std::map<string,XMLNode>::iterator i = Config->midi_ports.begin(); i != Config->midi_ports.end(); ++i) {
- MIDI::Manager::instance()->add_port (i->second);
- }
-
- MIDI::Port* first;
- const MIDI::Manager::PortList& ports = MIDI::Manager::instance()->get_midi_ports();
-
- if (ports.size() > 1) {
-
- first = ports.front();
-
- /* More than one port, so try using specific names for each port */
-
- default_mmc_port = MIDI::Manager::instance()->port (Config->get_mmc_port_name());
- default_mtc_port = MIDI::Manager::instance()->port (Config->get_mtc_port_name());
- default_midi_port = MIDI::Manager::instance()->port (Config->get_midi_port_name());
- default_midi_clock_port = MIDI::Manager::instance()->port (Config->get_midi_clock_port_name());
-
- /* If that didn't work, just use the first listed port */
-
- if (default_mmc_port == 0) {
- default_mmc_port = first;
- }
-
- if (default_mtc_port == 0) {
- default_mtc_port = first;
- }
-
- if (default_midi_port == 0) {
- default_midi_port = first;
- }
-
- if (default_midi_clock_port == 0) {
- default_midi_clock_port = first;
- }
-
- } else if (ports.size() == 1) {
-
- first = ports.front();
-
- /* Only one port described, so use it for both MTC and MMC */
-
- default_mmc_port = first;
- default_mtc_port = default_mmc_port;
- default_midi_port = default_mmc_port;
- default_midi_clock_port = default_mmc_port;
- }
-
- if (default_mmc_port == 0) {
- warning << string_compose (_("No MMC control (MIDI port \"%1\" not available)"), Config->get_mmc_port_name())
- << endmsg;
- }
-
-
- if (default_mtc_port == 0) {
- warning << string_compose (_("No MTC support (MIDI port \"%1\" not available)"), Config->get_mtc_port_name())
- << endmsg;
- }
-
- if (default_midi_port == 0) {
- warning << string_compose (_("No MIDI parameter support (MIDI port \"%1\" not available)"), Config->get_midi_port_name())
- << endmsg;
- }
-
- if (default_midi_clock_port == 0) {
- warning << string_compose (_("No MIDI Clock support (MIDI port \"%1\" not available)"), Config->get_midi_clock_port_name())
- << endmsg;
- }
-
- return 0;
-}
-
void
setup_hardware_optimization (bool try_optimization)
{
@@ -373,8 +287,6 @@ ARDOUR::init (bool use_vst, bool try_optimization)
Config->set_use_vst (use_vst);
- cerr << "After config loaded, MTC port name = " << Config->get_mtc_port_name() << endl;
-
Profile = new RuntimeProfile;
diff --git a/libs/ardour/rc_configuration.cc b/libs/ardour/rc_configuration.cc
index d503fb3503..a50a994f87 100644
--- a/libs/ardour/rc_configuration.cc
+++ b/libs/ardour/rc_configuration.cc
@@ -258,26 +258,7 @@ RCConfiguration::set_state (const XMLNode& root, int /*version*/)
node = *niter;
- if (node->name() == "MIDI-port") {
-
- try {
-
- MIDI::Port::Descriptor desc (*node);
- map<string,XMLNode>::iterator x;
-
- if ((x = midi_ports.find (desc.tag)) != midi_ports.end()) {
- warning << string_compose (_("Duplicate MIDI port definition found (tag=\"%1\") - ignored"),
- desc.tag) << endmsg;
- continue;
- }
- midi_ports.insert (pair<string,XMLNode>(desc.tag,*node));
- }
-
- catch (failed_constructor& err) {
- warning << _("ill-formed MIDI port specification in ardour rcfile (ignored)") << endmsg;
- }
-
- } else if (node->name() == "Config") {
+ if (node->name() == "Config") {
set_variables (*node);
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 5e56b82e68..a098bc3948 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -137,9 +137,6 @@ Session::Session (AudioEngine &eng,
_target_transport_speed (0.0),
_requested_return_frame (-1),
_mmc (0),
- _mtc_port (default_mtc_port),
- _midi_port (default_midi_port),
- _midi_clock_port (default_midi_clock_port),
_session_dir (new SessionDirectory(fullpath)),
state_tree (0),
_butler (new Butler (*this)),
@@ -307,6 +304,13 @@ Session::destroy ()
delete _mmc;
+ delete _mtc_input_port;
+ delete _mtc_output_port;
+ delete _midi_input_port;
+ delete _midi_output_port;
+ delete _midi_clock_input_port;
+ delete _midi_clock_output_port;
+
/* not strictly necessary, but doing it here allows the shared_ptr debugging to work */
playlists.reset ();
@@ -3855,11 +3859,11 @@ Session::get_available_sync_options () const
ret.push_back (JACK);
- if (mtc_port()) {
+ if (mtc_input_port()) {
ret.push_back (MTC);
}
- if (midi_clock_port()) {
+ if (midi_clock_input_port()) {
ret.push_back (MIDIClock);
}
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index 1f8f28cfc1..109a2bb5bc 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -71,298 +71,6 @@ Session::midi_panic()
}
}
-int
-Session::use_config_midi_ports ()
-{
- string port_name;
-
- if (default_mmc_port) {
- _mmc->set_port (default_mmc_port);
- }
-
- if (default_mtc_port) {
- set_mtc_port (default_mtc_port->name());
- } else {
- set_mtc_port ("");
- }
-
- if (default_midi_port) {
- set_midi_port (default_midi_port->name());
- } else {
- set_midi_port ("");
- }
-
- if (default_midi_clock_port) {
- set_midi_clock_port (default_midi_clock_port->name());
- } else {
- set_midi_clock_port ("");
- }
-
- return 0;
-}
-
-
-/***********************************************************************
- MTC, MMC, etc.
-**********************************************************************/
-
-int
-Session::set_mtc_port (string port_tag)
-{
- MTC_Slave *ms;
-
- if (port_tag.length() == 0) {
-
- if (_slave && ((ms = dynamic_cast<MTC_Slave*> (_slave)) != 0)) {
- error << string_compose (_("%1 is slaved to MTC - port cannot be reset"), PROGRAM_NAME) << endmsg;
- return -1;
- }
-
- if (_mtc_port == 0) {
- return 0;
- }
-
- _mtc_port = 0;
- goto out;
- }
-
- MIDI::Port* port;
-
- if ((port = MIDI::Manager::instance()->port (port_tag)) == 0) {
- error << string_compose (_("unknown port %1 requested for MTC"), port_tag) << endl;
- return -1;
- }
-
- _mtc_port = port;
-
- if (_slave && ((ms = dynamic_cast<MTC_Slave*> (_slave)) != 0)) {
- ms->rebind (*port);
- }
-
- Config->set_mtc_port_name (port_tag);
-
- out:
- MTC_PortChanged(); /* EMIT SIGNAL */
- set_dirty();
- return 0;
-}
-
-int
-Session::set_midi_port (string /*port_tag*/)
-{
-#if 0
- if (port_tag.length() == 0) {
- if (_midi_port == 0) {
- return 0;
- }
- _midi_port = 0;
- goto out;
- }
-
- MIDI::Port* port;
-
- if ((port = MIDI::Manager::instance()->port (port_tag)) == 0) {
- return -1;
- }
-
- _midi_port = port;
-
- /* XXX need something to forward this to control protocols ? or just
- use the signal below
- */
-
- Config->set_midi_port_name (port_tag);
-
- out:
-#endif
- MIDI_PortChanged(); /* EMIT SIGNAL */
- set_dirty();
- return 0;
-}
-
-int
-Session::set_midi_clock_port (string port_tag)
-{
- MIDIClock_Slave *ms;
-
- if (port_tag.length() == 0) {
-
- if (_slave && ((ms = dynamic_cast<MIDIClock_Slave*> (_slave)) != 0)) {
- error << string_compose (_("%1 is slaved to MIDI Clock - port cannot be reset"), PROGRAM_NAME) << endmsg;
- return -1;
- }
-
- if (_midi_clock_port == 0) {
- return 0;
- }
-
- _midi_clock_port = 0;
- goto out;
- }
-
- MIDI::Port* port;
-
- if ((port = MIDI::Manager::instance()->port (port_tag)) == 0) {
- error << string_compose (_("unknown port %1 requested for MIDI Clock"), port_tag) << endl;
- return -1;
- }
-
- _midi_clock_port = port;
-
- if (_slave && ((ms = dynamic_cast<MIDIClock_Slave*> (_slave)) != 0)) {
- ms->rebind (*port);
- }
-
- Config->set_midi_clock_port_name (port_tag);
-
- out:
- MIDIClock_PortChanged(); /* EMIT SIGNAL */
- set_dirty();
- return 0;
-}
-
-void
-Session::set_trace_midi_input (bool yn, MIDI::Port* port)
-{
- MIDI::Parser* input_parser;
-
- cerr << "enabling tracing: " << yn << " for input port " << port->name() << endl;
-
- if (port) {
- if ((input_parser = port->input()) != 0) {
- input_parser->trace (yn, &cout, "input: ");
- }
- } else {
-
- if (_mmc->port()) {
- if ((input_parser = _mmc->port()->input()) != 0) {
- input_parser->trace (yn, &cout, "input: ");
- }
- }
-
- if (_mtc_port && _mtc_port != _mmc->port()) {
- if ((input_parser = _mtc_port->input()) != 0) {
- input_parser->trace (yn, &cout, "input: ");
- }
- }
-
- if (_midi_port && _midi_port != _mmc->port() && _midi_port != _mtc_port) {
- if ((input_parser = _midi_port->input()) != 0) {
- input_parser->trace (yn, &cout, "input: ");
- }
- }
-
- if (_midi_clock_port
- && _midi_clock_port != _mmc->port()
- && _midi_clock_port != _mtc_port
- && _midi_clock_port != _midi_port) {
- if ((input_parser = _midi_clock_port->input()) != 0) {
- input_parser->trace (yn, &cout, "input: ");
- }
- }
- }
-
- Config->set_trace_midi_input (yn);
-}
-
-void
-Session::set_trace_midi_output (bool yn, MIDI::Port* port)
-{
- MIDI::Parser* output_parser;
-
- if (port) {
- if ((output_parser = port->output()) != 0) {
- output_parser->trace (yn, &cout, "output: ");
- }
- } else {
- if (_mmc->port()) {
- if ((output_parser = _mmc->port()->output()) != 0) {
- output_parser->trace (yn, &cout, "output: ");
- }
- }
-
- if (_mtc_port && _mtc_port != _mmc->port()) {
- if ((output_parser = _mtc_port->output()) != 0) {
- output_parser->trace (yn, &cout, "output: ");
- }
- }
-
- if (_midi_port && _midi_port != _mmc->port() && _midi_port != _mtc_port) {
- if ((output_parser = _midi_port->output()) != 0) {
- output_parser->trace (yn, &cout, "output: ");
- }
- }
-
- }
-
- Config->set_trace_midi_output (yn);
-}
-
-bool
-Session::get_trace_midi_input(MIDI::Port *port)
-{
- MIDI::Parser* input_parser;
- if (port) {
- if ((input_parser = port->input()) != 0) {
- return input_parser->tracing();
- }
- }
- else {
- if (_mmc->port()) {
- if ((input_parser = _mmc->port()->input()) != 0) {
- return input_parser->tracing();
- }
- }
-
- if (_mtc_port) {
- if ((input_parser = _mtc_port->input()) != 0) {
- return input_parser->tracing();
- }
- }
-
- if (_midi_port) {
- if ((input_parser = _midi_port->input()) != 0) {
- return input_parser->tracing();
- }
- }
- }
-
- return false;
-}
-
-bool
-Session::get_trace_midi_output(MIDI::Port *port)
-{
- MIDI::Parser* output_parser;
- if (port) {
- if ((output_parser = port->output()) != 0) {
- return output_parser->tracing();
- }
- }
- else {
- if (_mmc->port()) {
- if ((output_parser = _mmc->port()->output()) != 0) {
- return output_parser->tracing();
- }
- }
-
- if (_mtc_port) {
- if ((output_parser = _mtc_port->output()) != 0) {
- return output_parser->tracing();
- }
- }
-
- if (_midi_port) {
- if ((output_parser = _midi_port->output()) != 0) {
- return output_parser->tracing();
- }
- }
- }
-
- return false;
-
-}
-
void
Session::setup_midi_control ()
{
@@ -649,7 +357,7 @@ Session::send_full_time_code(nframes_t /*nframes*/)
_send_timecode_update = false;
- if (_mtc_port == 0 || !session_send_mtc || _slave) {
+ if (_mtc_output_port == 0 || !session_send_mtc || _slave) {
return 0;
}
@@ -684,7 +392,7 @@ Session::send_full_time_code(nframes_t /*nframes*/)
msg[8] = timecode.frames;
// Send message at offset 0, sent time is for the start of this cycle
- if (_mtc_port->midimsg (msg, sizeof (msg), 0)) {
+ if (_mtc_output_port->midimsg (msg, sizeof (msg), 0)) {
error << _("Session: could not send full MIDI time code") << endmsg;
return -1;
}
@@ -702,7 +410,7 @@ Session::send_full_time_code(nframes_t /*nframes*/)
int
Session::send_midi_time_code_for_cycle(nframes_t nframes)
{
- if (_mtc_port == 0 || _slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
+ if (_mtc_output_port == 0 || _slave || !session_send_mtc || transmitting_timecode_time.negative || (next_quarter_frame_to_send < 0)) {
// cerr << "(MTC) Not sending MTC\n";
return 0;
}
@@ -763,7 +471,7 @@ Session::send_midi_time_code_for_cycle(nframes_t nframes)
nframes_t out_stamp = msg_time - _transport_frame;
assert(out_stamp < nframes);
- if (_mtc_port->midimsg (mtc_msg, 2, out_stamp)) {
+ if (_mtc_output_port->midimsg (mtc_msg, 2, out_stamp)) {
error << string_compose(_("Session: cannot send quarter-frame MTC message (%1)"), strerror (errno))
<< endmsg;
return -1;
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 6800aced51..76570cb64a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -55,6 +55,7 @@
#include "midi++/mmc.h"
#include "midi++/port.h"
+#include "midi++/manager.h"
#include "pbd/boost_debug.h"
#include "pbd/controllable_descriptor.h"
@@ -276,6 +277,17 @@ Session::first_stage_init (string fullpath, string snapshot_name)
Delivery::disable_panners ();
IO::disable_connecting ();
+
+ /* Create MIDI control ports */
+
+ MIDI::Manager* m = MIDI::Manager::instance ();
+
+ _mtc_input_port = m->add_port (new MIDI::Port ("MTC", O_RDONLY, _engine.jack()));
+ _mtc_output_port = m->add_port (new MIDI::Port ("MTC", O_WRONLY, _engine.jack()));
+ _midi_input_port = m->add_port (new MIDI::Port ("MIDI control", O_RDONLY, _engine.jack()));
+ _midi_output_port = m->add_port (new MIDI::Port ("MIDI control", O_WRONLY, _engine.jack()));
+ _midi_clock_input_port = m->add_port (new MIDI::Port ("MIDI clock", O_RDONLY, _engine.jack()));
+ _midi_clock_output_port = m->add_port (new MIDI::Port ("MIDI clock", O_WRONLY, _engine.jack()));
}
int
@@ -1243,8 +1255,6 @@ Session::set_state (const XMLNode& node, int version)
error << _("Session: XML state has no options section") << endmsg;
}
- use_config_midi_ports ();
-
if (version >= 3000) {
if ((child = find_named_node (node, "Metadata")) == 0) {
warning << _("Session: XML state has no metadata section") << endmsg;
@@ -3247,18 +3257,10 @@ Session::config_changed (std::string p, bool ours)
} else if (p == "send-mtc") {
- /* only set the internal flag if we have
- a port.
- */
-
- if (_mtc_port != 0) {
- session_send_mtc = Config->get_send_mtc();
- if (session_send_mtc) {
- /* mark us ready to send */
- next_quarter_frame_to_send = 0;
- }
- } else {
- session_send_mtc = false;
+ session_send_mtc = Config->get_send_mtc();
+ if (session_send_mtc) {
+ /* mark us ready to send */
+ next_quarter_frame_to_send = 0;
}
} else if (p == "send-mmc") {
@@ -3267,13 +3269,7 @@ Session::config_changed (std::string p, bool ours)
} else if (p == "midi-feedback") {
- /* only set the internal flag if we have
- a port.
- */
-
- if (_mtc_port != 0) {
- session_midi_feedback = Config->get_midi_feedback();
- }
+ session_midi_feedback = Config->get_midi_feedback();
} else if (p == "jack-time-master") {
@@ -3311,22 +3307,13 @@ Session::config_changed (std::string p, bool ours)
sync_order_keys ("session");
} else if (p == "initial-program-change") {
- if (_mmc->port() && Config->get_initial_program_change() >= 0) {
+ if (_mmc->output_port() && Config->get_initial_program_change() >= 0) {
MIDI::byte buf[2];
buf[0] = MIDI::program; // channel zero by default
buf[1] = (Config->get_initial_program_change() & 0x7f);
- _mmc->port()->midimsg (buf, sizeof (buf), 0);
- }
- } else if (p == "initial-program-change") {
-
- if (_mmc->port() && Config->get_initial_program_change() >= 0) {
- MIDI::byte* buf = new MIDI::byte[2];
-
- buf[0] = MIDI::program; // channel zero by default
- buf[1] = (Config->get_initial_program_change() & 0x7f);
- // deliver_midi (_mmc_port, buf, 2);
+ _mmc->output_port()->midimsg (buf, sizeof (buf), 0);
}
} else if (p == "solo-mute-override") {
// catch_up_on_solo_mute_override ();
@@ -3379,7 +3366,7 @@ Session::load_diskstreams_2X (XMLNode const & node, int)
void
Session::setup_midi_machine_control ()
{
- _mmc = new MIDI::MachineControl;
+ _mmc = new MIDI::MachineControl (_engine.jack());
_mmc->Play.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
_mmc->DeferredPlay.connect_same_thread (*this, boost::bind (&Session::mmc_deferred_play, this, _1));
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index cc90dc3c7d..1123a6038b 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -1246,9 +1246,9 @@ Session::switch_to_sync_source (SyncSource src)
return;
}
- if (_mtc_port) {
+ if (_mtc_input_port) {
try {
- new_slave = new MTC_Slave (*this, *_mtc_port);
+ new_slave = new MTC_Slave (*this, *_mtc_input_port);
}
catch (failed_constructor& err) {
@@ -1266,9 +1266,9 @@ Session::switch_to_sync_source (SyncSource src)
return;
}
- if (_midi_clock_port) {
+ if (_midi_clock_input_port) {
try {
- new_slave = new MIDIClock_Slave (*this, *_midi_clock_port, 24);
+ new_slave = new MIDIClock_Slave (*this, *_midi_clock_input_port, 24);
}
catch (failed_constructor& err) {
diff --git a/libs/ardour/ticker.cc b/libs/ardour/ticker.cc
index 4327e25c72..f1792e3ffd 100644
--- a/libs/ardour/ticker.cc
+++ b/libs/ardour/ticker.cc
@@ -62,7 +62,7 @@ MidiClockTicker::session_going_away ()
void MidiClockTicker::update_midi_clock_port()
{
- _midi_port = _session->midi_clock_port();
+ _midi_port = _session->midi_clock_output_port();
}
void MidiClockTicker::transport_state_changed()