summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-11-09 20:05:18 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-11-09 20:05:18 +0000
commit498dfebcca3b97cdd7b83444040042fe06626241 (patch)
tree09b397ba40679e67a1a265e6d227e39ee0b4b4da /libs
parent8f508460903ef628a3f34ee60611b75ed4e1a734 (diff)
90% done with external sync design changes (GUI now has toggle switch for ext/int sync; source chosen separately, currently in ardour prefs dialog ; fix libmidi++ and compilation scripts to correctly build JACK+ALSA support; minor contiuing tweaks on transport stuff
git-svn-id: svn://localhost/ardour2/branches/3.0@6048 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/rc_configuration_vars.h1
-rw-r--r--libs/ardour/ardour/session.h14
-rw-r--r--libs/ardour/ardour/session_configuration_vars.h2
-rw-r--r--libs/ardour/ardour/types.h9
-rw-r--r--libs/ardour/ardour/utils.h4
-rw-r--r--libs/ardour/enums.cc13
-rw-r--r--libs/ardour/globals.cc25
-rw-r--r--libs/ardour/rc_configuration.cc7
-rw-r--r--libs/ardour/session.cc18
-rw-r--r--libs/ardour/session_events.cc4
-rw-r--r--libs/ardour/session_export.cc8
-rw-r--r--libs/ardour/session_midi.cc10
-rw-r--r--libs/ardour/session_process.cc4
-rw-r--r--libs/ardour/session_state.cc17
-rw-r--r--libs/ardour/session_transport.cc59
-rw-r--r--libs/ardour/utils.cc25
-rw-r--r--libs/midi++2/factory.cc6
-rw-r--r--libs/midi++2/manager.cc7
-rw-r--r--libs/midi++2/wscript20
19 files changed, 140 insertions, 113 deletions
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h
index 5b0be5cccf..f8e61bff79 100644
--- a/libs/ardour/ardour/rc_configuration_vars.h
+++ b/libs/ardour/ardour/rc_configuration_vars.h
@@ -108,7 +108,6 @@ CONFIG_VARIABLE (nframes_t, postroll, "postroll", 0)
CONFIG_VARIABLE (float, rf_speed, "rf-speed", 2.0f)
CONFIG_VARIABLE (float, shuttle_speed_factor, "shuttle-speed-factor", 1.0f)
CONFIG_VARIABLE (float, shuttle_speed_threshold, "shuttle-speed-threshold", 5.0f)
-CONFIG_VARIABLE (SlaveSource, slave_source, "slave-source", None)
CONFIG_VARIABLE (ShuttleBehaviour, shuttle_behaviour, "shuttle-behaviour", Sprung)
CONFIG_VARIABLE (ShuttleUnits, shuttle_units, "shuttle-units", Percentage)
CONFIG_VARIABLE (bool, primary_clock_delta_edit_cursor, "primary-clock-delta-edit-cursor", false)
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 6ac36f98b6..d36bc51079 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -145,7 +145,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
RangeStop,
RangeLocate,
Overwrite,
- SetSlaveSource,
+ SetSyncSource,
Audition,
InputConfigurationChange,
SetPlayAudioRange,
@@ -173,7 +173,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void* ptr;
bool yes_or_no;
nframes64_t target2_frame;
- SlaveSource slave;
+ SyncSource sync_source;
Route* route;
};
@@ -576,8 +576,9 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
static sigc::signal<void> EndTimeChanged;
static sigc::signal<void> TimecodeOffsetChanged;
- void request_slave_source (SlaveSource);
- bool synced_to_jack() const { return Config->get_slave_source() == JACK; }
+ std::vector<SyncSource> get_available_sync_options() const;
+ void request_sync_source (SyncSource);
+ bool synced_to_jack() const { return config.get_external_sync() && config.get_sync_source() == JACK; }
double transport_speed() const { return _transport_speed; }
bool transport_stopped() const { return _transport_speed == 0.0f; }
@@ -1074,9 +1075,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
nframes_t this_delta, bool starting);
void follow_slave_silently(nframes_t nframes, float slave_speed);
- void set_slave_source (SlaveSource);
+ void use_sync_source (SyncSource);
+ void drop_sync_source ();
- SlaveSource post_export_slave;
+ bool post_export_sync;
nframes_t post_export_position;
bool _exporting;
diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h
index fd85993a29..2776787271 100644
--- a/libs/ardour/ardour/session_configuration_vars.h
+++ b/libs/ardour/ardour/session_configuration_vars.h
@@ -47,3 +47,5 @@ CONFIG_VARIABLE (bool, use_video_sync, "use-video-sync", false)
CONFIG_VARIABLE (float, video_pullup, "video-pullup", 0.0f)
CONFIG_VARIABLE (bool, show_summary, "show-summary", true)
CONFIG_VARIABLE (bool, show_group_tabs, "show-group-tabs", true)
+CONFIG_VARIABLE (bool, external_sync, "external-sync", false)
+CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK)
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index dd2c8861be..7e09417409 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -360,10 +360,9 @@ namespace ARDOUR {
ExportContext
};
- enum SlaveSource {
- None = 0,
- MTC,
+ enum SyncSource {
JACK,
+ MTC,
MIDIClock
};
@@ -444,7 +443,7 @@ std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ListenPosition& sf);
std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf);
std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);
-std::istream& operator>>(std::istream& o, ARDOUR::SlaveSource& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::SyncSource& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
std::istream& operator>>(std::istream& o, ARDOUR::TimecodeFormat& sf);
@@ -461,7 +460,7 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::RemoteModel& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ListenPosition& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::LayerModel& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeModel& sf);
-std::ostream& operator<<(std::ostream& o, const ARDOUR::SlaveSource& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::SyncSource& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleBehaviour& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleUnits& sf);
std::ostream& operator<<(std::ostream& o, const ARDOUR::TimecodeFormat& sf);
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index c43b7ed37e..6c6f754cf9 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -62,8 +62,8 @@ bool path_is_paired (Glib::ustring path, Glib::ustring& pair_base);
void compute_equal_power_fades (ARDOUR::nframes_t nframes, float* in, float* out);
-const char* slave_source_to_string (ARDOUR::SlaveSource src);
-ARDOUR::SlaveSource string_to_slave_source (std::string str);
+const char* sync_source_to_string (ARDOUR::SyncSource src);
+ARDOUR::SyncSource string_to_sync_source (std::string str);
const char* edit_mode_to_string (ARDOUR::EditMode);
ARDOUR::EditMode string_to_edit_mode (std::string);
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index 885ebeb27a..ed7ba88d8e 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -70,7 +70,7 @@ setup_enum_writer ()
CDMarkerFormat _CDMarkerFormat;
HeaderFormat _HeaderFormat;
PluginType _PluginType;
- SlaveSource _SlaveSource;
+ SyncSource _SyncSource;
ShuttleBehaviour _ShuttleBehaviour;
ShuttleUnits _ShuttleUnits;
Session::RecordState _Session_RecordState;
@@ -266,11 +266,10 @@ setup_enum_writer ()
REGISTER_ENUM (VST);
REGISTER (_PluginType);
- REGISTER_ENUM (None);
REGISTER_ENUM (MTC);
REGISTER_ENUM (JACK);
REGISTER_ENUM (MIDIClock);
- REGISTER (_SlaveSource);
+ REGISTER (_SyncSource);
REGISTER_ENUM (Sprung);
REGISTER_ENUM (Wheel);
@@ -296,7 +295,7 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (Session::Event, RangeStop);
REGISTER_CLASS_ENUM (Session::Event, RangeLocate);
REGISTER_CLASS_ENUM (Session::Event, Overwrite);
- REGISTER_CLASS_ENUM (Session::Event, SetSlaveSource);
+ REGISTER_CLASS_ENUM (Session::Event, SetSyncSource);
REGISTER_CLASS_ENUM (Session::Event, Audition);
REGISTER_CLASS_ENUM (Session::Event, InputConfigurationChange);
REGISTER_CLASS_ENUM (Session::Event, SetPlayAudioRange);
@@ -669,15 +668,15 @@ std::ostream& operator<<(std::ostream& o, const CrossfadeModel& var)
std::string s = enum_2_string (var);
return o << s;
}
-std::istream& operator>>(std::istream& o, SlaveSource& var)
+std::istream& operator>>(std::istream& o, SyncSource& var)
{
std::string s;
o >> s;
- var = (SlaveSource) string_2_enum (s, var);
+ var = (SyncSource) string_2_enum (s, var);
return o;
}
-std::ostream& operator<<(std::ostream& o, const SlaveSource& var)
+std::ostream& operator<<(std::ostream& o, const SyncSource& var)
{
std::string s = enum_2_string (var);
return o << s;
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 4d75c30a0d..8efb72cc8c 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -126,7 +126,6 @@ int
ARDOUR::setup_midi ()
{
if (Config->midi_ports.size() == 0) {
- //warning << _("no MIDI ports specified: no MMC or MTC control possible") << endmsg;
return 0;
}
@@ -139,27 +138,17 @@ ARDOUR::setup_midi ()
MIDI::Port* first;
const MIDI::Manager::PortMap& ports = MIDI::Manager::instance()->get_midi_ports();
+
if (ports.size() > 1) {
first = ports.begin()->second;
/* More than one port, so try using specific names for each port */
- if (Config->get_mmc_port_name() != N_("control")) {
- default_mmc_port = MIDI::Manager::instance()->port (Config->get_mmc_port_name());
- }
-
- if (Config->get_mtc_port_name() != N_("control")) {
- default_mtc_port = MIDI::Manager::instance()->port (Config->get_mtc_port_name());
- }
-
- if (Config->get_midi_port_name() != N_("control")) {
- default_midi_port = MIDI::Manager::instance()->port (Config->get_midi_port_name());
- }
-
- if (Config->get_midi_clock_port_name() != N_("control")) {
- default_midi_port = MIDI::Manager::instance()->port (Config->get_midi_clock_port_name());
- }
+ 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 */
@@ -194,7 +183,6 @@ ARDOUR::setup_midi ()
if (default_mmc_port == 0) {
warning << string_compose (_("No MMC control (MIDI port \"%1\" not available)"), Config->get_mmc_port_name())
<< endmsg;
- return 0;
}
@@ -339,8 +327,11 @@ ARDOUR::init (bool use_vst, bool try_optimization)
return -1;
}
+
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 f04c148ab7..b34a6fd1ee 100644
--- a/libs/ardour/rc_configuration.cc
+++ b/libs/ardour/rc_configuration.cc
@@ -203,6 +203,8 @@ RCConfiguration::get_state ()
MIDI::Manager::PortMap::const_iterator i;
const MIDI::Manager::PortMap& ports = MIDI::Manager::instance()->get_midi_ports();
+ cerr << "Saving " << ports.size() << " MIDI ports\n";
+
for (i = ports.begin(); i != ports.end(); ++i) {
root->add_child_nocopy(i->second->get_state());
}
@@ -260,8 +262,11 @@ RCConfiguration::set_state (const XMLNode& root, int /*version*/)
MIDI::Port::Descriptor desc (*node);
map<string,XMLNode>::iterator x;
+
if ((x = midi_ports.find (desc.tag)) != midi_ports.end()) {
- midi_ports.erase (x);
+ warning << string_compose (_("Duplicate MIDI port definition found (tag=\"%1\") - ignored"),
+ desc.tag) << endmsg;
+ continue;
}
midi_ports.insert (pair<string,XMLNode>(desc.tag,*node));
}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 509fb0a999..9d7d32d17e 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -4444,3 +4444,21 @@ Session::route_group_changed ()
{
RouteGroupChanged (); /* EMIT SIGNAL */
}
+
+vector<SyncSource>
+Session::get_available_sync_options () const
+{
+ vector<SyncSource> ret;
+
+ ret.push_back (JACK);
+
+ if (mtc_port()) {
+ ret.push_back (MTC);
+ }
+
+ if (midi_clock_port()) {
+ ret.push_back (MIDIClock);
+ }
+
+ return ret;
+}
diff --git a/libs/ardour/session_events.cc b/libs/ardour/session_events.cc
index fb993faa68..7304991948 100644
--- a/libs/ardour/session_events.cc
+++ b/libs/ardour/session_events.cc
@@ -393,8 +393,8 @@ Session::process_event (Event* ev)
set_diskstream_speed (static_cast<Diskstream*> (ev->ptr), ev->speed);
break;
- case Event::SetSlaveSource:
- set_slave_source (ev->slave);
+ case Event::SetSyncSource:
+ use_sync_source (ev->sync_source);
break;
case Event::Audition:
diff --git a/libs/ardour/session_export.cc b/libs/ardour/session_export.cc
index 0bf87591cd..da18ceb3cb 100644
--- a/libs/ardour/session_export.cc
+++ b/libs/ardour/session_export.cc
@@ -85,10 +85,10 @@ Session::pre_export ()
/* no slaving */
- post_export_slave = Config->get_slave_source ();
+ post_export_sync = config.get_external_sync ();
post_export_position = _transport_frame;
- Config->set_slave_source (None);
+ config.set_external_sync (false);
_exporting = true;
export_status->running = true;
@@ -244,8 +244,8 @@ Session::finalize_audio_export ()
/* restart slaving */
- if (post_export_slave != None) {
- Config->set_slave_source (post_export_slave);
+ if (post_export_sync) {
+ config.set_external_sync (true);
} else {
locate (post_export_position, false, false, false);
}
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index f7ee8ef3c9..34d9b470f5 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -141,6 +141,8 @@ Session::set_mtc_port (string port_tag)
ms->rebind (*port);
}
+ cerr << "!!SPT to " << port_tag << endl;
+
Config->set_mtc_port_name (port_tag);
out:
@@ -494,7 +496,7 @@ Session::setup_midi_control ()
void
Session::spp_start (Parser &, nframes_t /*timestamp*/)
{
- if (Config->get_mmc_control() && (Config->get_slave_source() != MTC)) {
+ if (Config->get_mmc_control() && (config.get_external_sync() && config.get_sync_source() != MTC)) {
request_transport_speed (1.0);
}
}
@@ -516,7 +518,7 @@ Session::spp_stop (Parser&, nframes_t /*timestamp*/)
void
Session::midi_clock_start (Parser& ignored, nframes_t timestamp)
{
- if (Config->get_slave_source() == MIDIClock) {
+ if (config.get_external_sync() && (config.get_sync_source() == MIDIClock)) {
request_transport_speed (1.0);
}
}
@@ -530,7 +532,7 @@ Session::midi_clock_continue (Parser& parser, nframes_t timestamp)
void
Session::midi_clock_stop (Parser& ignored, nframes_t timestamp)
{
- if (Config->get_slave_source() == MIDIClock) {
+ if (config.get_external_sync() && (config.get_slave_source() == MIDIClock)) {
request_stop ();
}
}
@@ -539,7 +541,7 @@ Session::midi_clock_stop (Parser& ignored, nframes_t timestamp)
void
Session::mmc_deferred_play (MIDI::MachineControl &/*mmc*/)
{
- if (Config->get_mmc_control() && (Config->get_slave_source() != MTC)) {
+ if (Config->get_mmc_control() && (config.get_external_sync() && (config.get_sync_source() != MTC))) {
request_transport_speed (1.0);
}
}
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 4bbe852687..a79a2e4cd8 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -469,7 +469,7 @@ Session::transport_locked () const
{
Slave* sl = _slave;
- if (!locate_pending() && ((Config->get_slave_source() == None) || (sl && sl->ok() && sl->locked()))) {
+ if (!locate_pending() && (!config.get_external_sync() || (sl && sl->ok() && sl->locked()))) {
return true;
}
@@ -487,7 +487,7 @@ Session::follow_slave (nframes_t nframes)
if (!_slave->ok()) {
stop_transport ();
- Config->set_slave_source (None);
+ config.set_external_sync (false);
goto noroll;
}
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 1a4758186e..2e564b7eee 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -215,6 +215,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
destructive_index = 0;
first_file_data_format_reset = true;
first_file_header_format_reset = true;
+ post_export_sync = false;
//midi_thread = (pthread_t) 0;
AudioDiskstream::allocate_working_buffers();
@@ -869,15 +870,7 @@ int
Session::load_options (const XMLNode& node)
{
LocaleGuard lg (X_("POSIX"));
-
config.set_variables (node);
-
- /* now reset MIDI ports because the session can have its own
- MIDI configuration.
- */
-
- setup_midi ();
-
return 0;
}
@@ -3200,8 +3193,12 @@ Session::config_changed (std::string p, bool ours)
first_file_data_format_reset = false;
- } else if (p == "slave-source") {
- set_slave_source (Config->get_slave_source());
+ } else if (p == "external-sync") {
+ if (!config.get_external_sync()) {
+ drop_sync_source ();
+ } else {
+ use_sync_source (config.get_sync_source());
+ }
} else if (p == "remote-model") {
set_remote_control_ids ();
} else if (p == "denormal-model") {
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 10429e9639..b7377d7dc6 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -79,9 +79,9 @@ Session::request_input_change_handling ()
}
void
-Session::request_slave_source (SlaveSource src)
+Session::request_sync_source (SyncSource src)
{
- Event* ev = new Event (Event::SetSlaveSource, Event::Add, Event::Immediate, 0, 0.0);
+ Event* ev = new Event (Event::SetSyncSource, Event::Add, Event::Immediate, 0, 0.0);
bool seamless;
seamless = Config->get_seamless_loop ();
@@ -97,7 +97,7 @@ Session::request_slave_source (SlaveSource src)
/* save value of seamless from before the switch */
_was_seamless = seamless;
- ev->slave = src;
+ ev->sync_source = src;
queue_event (ev);
}
@@ -230,7 +230,7 @@ Session::realtime_stop (bool abort, bool clear_state)
waiting_for_sync_offset = true;
}
- transport_sub_state = ((Config->get_slave_source() == None && config.get_auto_return()) ? AutoReturning : 0);
+ transport_sub_state = ((!config.get_external_sync()&& config.get_auto_return()) ? AutoReturning : 0);
}
void
@@ -439,7 +439,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
}
bool const auto_return_enabled =
- (Config->get_slave_source() == None && config.get_auto_return());
+ (!config.get_external_sync() && config.get_auto_return());
if (auto_return_enabled ||
(ptw & PostTransportLocate) ||
@@ -571,7 +571,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
/* and start it up again if relevant */
- if ((ptw & PostTransportLocate) && Config->get_slave_source() == None && pending_locate_roll) {
+ if ((ptw & PostTransportLocate) && !config.get_external_sync() && pending_locate_roll) {
request_transport_speed (1.0);
pending_locate_roll = false;
}
@@ -1106,7 +1106,7 @@ Session::post_transport ()
if (ptw & PostTransportLocate) {
- if (((Config->get_slave_source() == None && (auto_play_legal && config.get_auto_play())) && !_exporting) || (ptw & PostTransportRoll)) {
+ if (((!config.get_external_sync() && (auto_play_legal && config.get_auto_play())) && !_exporting) || (ptw & PostTransportRoll)) {
start_transport ();
} else {
@@ -1142,9 +1142,8 @@ Session::reset_rf_scale (nframes_t motion)
}
void
-Session::set_slave_source (SlaveSource src)
+Session::drop_sync_source ()
{
- bool reverse = false;
bool non_rt_required = false;
if (_transport_speed) {
@@ -1152,22 +1151,42 @@ Session::set_slave_source (SlaveSource src)
return;
}
-// if (src == JACK && Config->get_jack_time_master()) {
-// return;
-// }
-
delete _slave;
_slave = 0;
- if (_transport_speed < 0.0) {
- reverse = true;
+ boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
+ for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
+ if (!(*i)->hidden()) {
+ if ((*i)->realtime_set_speed ((*i)->speed(), true)) {
+ non_rt_required = true;
+ }
+ (*i)->set_slaved (0);
+ }
}
- switch (src) {
- case None:
- stop_transport ();
- break;
+ if (non_rt_required) {
+ add_post_transport_work (PostTransportSpeed);
+ _butler->schedule_transport_work ();
+ }
+ set_dirty();
+}
+
+void
+Session::use_sync_source (SyncSource src)
+{
+ bool reverse = false;
+ bool non_rt_required = false;
+
+ if (_transport_speed) {
+ error << _("please stop the transport before adjusting slave settings") << endmsg;
+ return;
+ }
+
+ delete _slave;
+ _slave = 0;
+
+ switch (src) {
case MTC:
if (_mtc_port) {
try {
@@ -1206,8 +1225,6 @@ Session::set_slave_source (SlaveSource src)
};
- Config->set_slave_source (src);
-
boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader();
for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) {
if (!(*i)->hidden()) {
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index abed926983..af90c935c9 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -331,14 +331,10 @@ edit_mode_to_string (EditMode mode)
}
}
-SlaveSource
-string_to_slave_source (string str)
+SyncSource
+string_to_sync_source (string str)
{
- if (str == _("Internal")) {
- return None;
- }
-
- if (str == _("MTC")) {
+ if (str == _("MIDI Timecode")) {
return MTC;
}
@@ -350,29 +346,26 @@ string_to_slave_source (string str)
return JACK;
}
- fatal << string_compose (_("programming error: unknown slave source string \"%1\""), str) << endmsg;
+ fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg;
/*NOTREACHED*/
- return None;
+ return JACK;
}
const char*
-slave_source_to_string (SlaveSource src)
+sync_source_to_string (SyncSource src)
{
switch (src) {
case JACK:
return _("JACK");
case MTC:
- return _("MTC");
+ return _("MIDI Timecode");
case MIDIClock:
return _("MIDI Clock");
-
- default:
- case None:
- return _("Internal");
-
}
+ /* GRRRR .... stupid, stupid gcc - you can't get here from there, all enum values are handled */
+ return _("JACK");
}
float
diff --git a/libs/midi++2/factory.cc b/libs/midi++2/factory.cc
index 1980ac508b..40cadd2390 100644
--- a/libs/midi++2/factory.cc
+++ b/libs/midi++2/factory.cc
@@ -110,6 +110,12 @@ PortFactory::ignore_duplicate_devices (Port::Type type)
break;
#endif // WITH_ALSA
+#ifdef WITH_JACK_MIDI
+ case Port::JACK_Midi:
+ ret = true;
+ break;
+#endif // WITH_JACK_MIDI
+
#if WITH_COREMIDI
case Port::CoreMidi_MidiPort:
ret = true;
diff --git a/libs/midi++2/manager.cc b/libs/midi++2/manager.cc
index ab03688e49..ab37073afd 100644
--- a/libs/midi++2/manager.cc
+++ b/libs/midi++2/manager.cc
@@ -70,12 +70,6 @@ Manager::add_port (const XMLNode& node)
PortMap::iterator existing;
pair<string, Port *> newpair;
- /* do not allow multiple ports with the same tag. if attempted, just return the existing
- port with the same tag. XXX this is really caused by the mess of setup_midi() being
- called twice in Ardour, once in the global init() function and once after the user RC file
- has been loaded (there may be extra ports in it).
- */
-
if ((existing = ports_by_tag.find (desc.tag)) != ports_by_tag.end()) {
port = (*existing).second;
@@ -150,6 +144,7 @@ Manager::add_port (const XMLNode& node)
}
port = factory.create_port (node, api_data);
+
if (port == 0) {
return 0;
diff --git a/libs/midi++2/wscript b/libs/midi++2/wscript
index 14974581a9..735d513179 100644
--- a/libs/midi++2/wscript
+++ b/libs/midi++2/wscript
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import autowaf
import os
+import sys
# Version of this package (even if built as a child)
MAJOR = '2'
@@ -36,10 +37,6 @@ def configure(conf):
autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
- # TODO
- conf.env['SYSMIDI'] = 'JACK MIDI'
- conf.env.append_value('CXXFLAGS', '-DWITH_JACK_MIDI')
-
# Boost headers
autowaf.check_header(conf, 'boost/shared_ptr.hpp')
autowaf.check_header(conf, 'boost/weak_ptr.hpp')
@@ -61,12 +58,17 @@ def build(bld):
mtc.cc
version.cc
'''
- if bld.env['SYSMIDI'] == 'JACK MIDI':
- obj.source += ' jack_midiport.cc '
- elif bld.env['SYSMIDI'] == 'Alsa Sequencer':
- obj.source += ' alsa_sequencer_midiport.cc '
- elif bld.env['SYSMIDI'] == 'CoreMIDI':
+ # everybody loves JACK
+ obj.source += ' jack_midiport.cc '
+ obj.cxxflags = [ '-DWITH_JACK_MIDI' ]
+ if sys.platform == 'darwin':
+ # OS X
obj.source += ' coremidi_midiport.cc '
+ obj.cxxflags += [ '-DWITH_COREMIDI' ]
+ else :
+ # linux
+ obj.source += ' alsa_sequencer_midiport.cc '
+ obj.cxxflags += [ '-DWITH_ALSA' ]
obj.export_incdirs = ['.']
obj.includes = ['.']
obj.name = 'libmidipp'