diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-19 17:34:23 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-19 17:34:23 -0400 |
commit | 960a47330a5d3e534e6275f42efc07585a2075e1 (patch) | |
tree | 7613700c9c2e942e55613de0470e01d503efb69a /libs | |
parent | d2ca0665bf63188b2004338d5238122f3714b89a (diff) |
switch from JACK_Slave to Engine_Slave
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/rc_configuration_vars.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/slave.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 2 | ||||
-rw-r--r-- | libs/ardour/engine_slave.cc (renamed from libs/ardour/jack_slave.cc) | 10 | ||||
-rw-r--r-- | libs/ardour/enums.cc | 2 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 6 | ||||
-rw-r--r-- | libs/ardour/session.cc | 4 | ||||
-rw-r--r-- | libs/ardour/session_time.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session_transport.cc | 30 | ||||
-rw-r--r-- | libs/ardour/utils.cc | 9 | ||||
-rw-r--r-- | libs/ardour/wscript | 2 |
12 files changed, 42 insertions, 35 deletions
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index e05efbd510..3c11304fdb 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -51,7 +51,7 @@ CONFIG_VARIABLE (int, mtc_qf_speed_tolerance, "mtc-qf-speed-tolerance", 5) CONFIG_VARIABLE (bool, timecode_sync_frame_rate, "timecode-sync-frame-rate", true) CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true) CONFIG_VARIABLE (bool, timecode_source_2997, "timecode-source-2997", false) -CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", JACK) +CONFIG_VARIABLE (SyncSource, sync_source, "sync-source", Engine) CONFIG_VARIABLE (std::string, ltc_source_port, "ltc-source-port", "system:capture_1") CONFIG_VARIABLE (bool, send_ltc, "send-ltc", false) CONFIG_VARIABLE (bool, ltc_send_continuously, "ltc-send-continuously", true) diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 7337e2d1ea..ae5339796c 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -509,7 +509,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi static PBD::Signal1<void, framepos_t> EndTimeChanged; void request_sync_source (Slave*); - bool synced_to_jack() const { return config.get_external_sync() && Config->get_sync_source() == JACK; } + bool synced_to_engine() const { return config.get_external_sync() && Config->get_sync_source() == Engine; } double transport_speed() const { return _transport_speed; } bool transport_stopped() const { return _transport_speed == 0.0f; } diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index c60acb1df7..a0b7b878e4 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -486,11 +486,11 @@ class MIDIClock_Slave : public Slave { bool _starting; }; -class JACK_Slave : public Slave +class Engine_Slave : public Slave { public: - JACK_Slave (AudioEngine&); - ~JACK_Slave (); + Engine_Slave (AudioEngine&); + ~Engine_Slave (); bool speed_and_position (double& speed, framepos_t& pos); diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index f2319d7669..658c64788e 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -489,7 +489,7 @@ namespace ARDOUR { }; enum SyncSource { - JACK, + Engine, MTC, MIDIClock, LTC diff --git a/libs/ardour/jack_slave.cc b/libs/ardour/engine_slave.cc index 4b2f3b1860..eb55c9ba54 100644 --- a/libs/ardour/jack_slave.cc +++ b/libs/ardour/engine_slave.cc @@ -26,7 +26,7 @@ using namespace std; using namespace ARDOUR; -JACK_Slave::JACK_Slave (AudioEngine& e) +Engine_Slave::Engine_Slave (AudioEngine& e) : engine (e) { double x; @@ -35,24 +35,24 @@ JACK_Slave::JACK_Slave (AudioEngine& e) speed_and_position (x, p); } -JACK_Slave::~JACK_Slave () +Engine_Slave::~Engine_Slave () { } bool -JACK_Slave::locked() const +Engine_Slave::locked() const { return true; } bool -JACK_Slave::ok() const +Engine_Slave::ok() const { return true; } bool -JACK_Slave::speed_and_position (double& sp, framepos_t& position) +Engine_Slave::speed_and_position (double& sp, framepos_t& position) { switch (engine.transport_state()) { case TransportStopped: diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc index bab0e8ed15..8fec499c35 100644 --- a/libs/ardour/enums.cc +++ b/libs/ardour/enums.cc @@ -335,7 +335,7 @@ setup_enum_writer () REGISTER (_PluginType); REGISTER_ENUM (MTC); - REGISTER_ENUM (JACK); + REGISTER_ENUM (Engine); REGISTER_ENUM (MIDIClock); REGISTER_ENUM (LTC); REGISTER (_SyncSource); diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index aac7709f90..459f6f0e51 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -530,7 +530,11 @@ ARDOUR::get_available_sync_options () { vector<SyncSource> ret; - ret.push_back (JACK); + boost::shared_ptr<AudioBackend> backend = AudioEngine::instance()->current_backend(); + if (backend && backend->name() == "JACK") { + ret.push_back (Engine); + } + ret.push_back (MTC); ret.push_back (MIDIClock); ret.push_back (LTC); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 746732f76e..4be52a7584 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -393,7 +393,7 @@ Session::immediately_post_engine () _engine.Running.connect_same_thread (*this, boost::bind (&Session::initialize_latencies, this)); - if (synced_to_jack()) { + if (synced_to_engine()) { _engine.transport_stop (); } @@ -1406,7 +1406,7 @@ Session::audible_frame () const offset = current_block_size; } - if (synced_to_jack()) { + if (synced_to_engine()) { tf = _engine.transport_frame(); } else { tf = _transport_frame; diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index 0f2186c09b..e35910f2df 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -182,7 +182,7 @@ Session::timecode_time (Timecode::Time &t) int Session::backend_sync_callback (TransportState state, framepos_t pos) { - bool slave = synced_to_jack(); + bool slave = synced_to_engine(); switch (state) { case TransportStopped: diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index ab6d68fd67..38ad521235 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -86,7 +86,7 @@ Session::request_sync_source (Slave* new_slave) seamless = Config->get_seamless_loop (); - if (dynamic_cast<JACK_Slave*>(new_slave)) { + if (dynamic_cast<Engine_Slave*>(new_slave)) { /* JACK cannot support seamless looping at present */ Config->set_seamless_loop (false); } else { @@ -514,13 +514,13 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) if (auto_return_enabled || (ptw & PostTransportLocate) || (_requested_return_frame >= 0) || - synced_to_jack()) { + synced_to_engine()) { if (pending_locate_flush) { flush_all_inserts (); } - if ((auto_return_enabled || synced_to_jack() || _requested_return_frame >= 0) && + if ((auto_return_enabled || synced_to_engine() || _requested_return_frame >= 0) && !(ptw & PostTransportLocate)) { /* no explicit locate queued */ @@ -543,7 +543,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished) /* don't try to handle loop play when synced to JACK */ - if (!synced_to_jack()) { + if (!synced_to_engine()) { Location *location = _locations->auto_loop_location(); @@ -734,7 +734,7 @@ Session::set_play_loop (bool yn) return; } - if (yn && Config->get_seamless_loop() && synced_to_jack()) { + if (yn && Config->get_seamless_loop() && synced_to_engine()) { warning << string_compose ( _("Seamless looping cannot be supported while %1 is using JACK transport.\n" "Recommend changing the configured options"), PROGRAM_NAME) @@ -811,7 +811,7 @@ Session::flush_all_inserts () void Session::start_locate (framepos_t target_frame, bool with_roll, bool with_flush, bool with_loop, bool force) { - if (synced_to_jack()) { + if (synced_to_engine()) { double sp; framepos_t pos; @@ -926,7 +926,7 @@ Session::locate (framepos_t target_frame, bool with_roll, bool with_flush, bool bool transport_was_stopped = !transport_rolling(); - if (transport_was_stopped && (!auto_play_legal || !config.get_auto_play()) && !with_roll && !(synced_to_jack() && play_loop)) { + if (transport_was_stopped && (!auto_play_legal || !config.get_auto_play()) && !with_roll && !(synced_to_engine() && play_loop)) { realtime_stop (false, true); // XXX paul - check if the 2nd arg is really correct transport_was_stopped = true; } else { @@ -1067,7 +1067,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a set_track_monitor_input_status (true); } - if (synced_to_jack ()) { + if (synced_to_engine ()) { if (clear_state) { /* do this here because our response to the slave won't take care of it. @@ -1090,7 +1090,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a set_track_monitor_input_status (false); } - if (synced_to_jack()) { + if (synced_to_engine()) { _engine.transport_start (); } else { start_transport (); @@ -1100,7 +1100,7 @@ Session::set_transport_speed (double speed, bool abort, bool clear_state, bool a /* not zero, not 1.0 ... varispeed */ - if ((synced_to_jack()) && speed != 0.0 && speed != 1.0) { + if ((synced_to_engine()) && speed != 0.0 && speed != 1.0) { warning << string_compose ( _("Global varispeed cannot be supported while %1 is connected to JACK transport control"), PROGRAM_NAME) @@ -1429,8 +1429,8 @@ Session::switch_to_sync_source (SyncSource src) } break; - case JACK: - if (_slave && dynamic_cast<JACK_Slave*>(_slave)) { + case Engine: + if (_slave && dynamic_cast<Engine_Slave*>(_slave)) { return; } @@ -1438,7 +1438,7 @@ Session::switch_to_sync_source (SyncSource src) return; } - new_slave = new JACK_Slave (*AudioEngine::instance()); + new_slave = new Engine_Slave (*AudioEngine::instance()); break; default: @@ -1632,9 +1632,9 @@ bool Session::maybe_stop (framepos_t limit) { if ((_transport_speed > 0.0f && _transport_frame >= limit) || (_transport_speed < 0.0f && _transport_frame == 0)) { - if (synced_to_jack () && config.get_jack_time_master ()) { + if (synced_to_engine () && config.get_jack_time_master ()) { _engine.transport_stop (); - } else if (!synced_to_jack ()) { + } else if (!synced_to_engine ()) { stop_transport (); } return true; diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index e7b7648149..0c98461974 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -395,12 +395,12 @@ string_to_sync_source (string str) } if (str == _("JACK")) { - return JACK; + return Engine; } fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg; /*NOTREACHED*/ - return JACK; + return Engine; } /** @param sh Return a short version of the string */ @@ -408,7 +408,10 @@ const char* sync_source_to_string (SyncSource src, bool sh) { switch (src) { - case JACK: + case Engine: + /* no other backends offer sync for now ... deal with this if we + * ever have to. + */ return _("JACK"); case MTC: diff --git a/libs/ardour/wscript b/libs/ardour/wscript index d367b2101e..474a9c58c6 100644 --- a/libs/ardour/wscript +++ b/libs/ardour/wscript @@ -69,6 +69,7 @@ libardour_sources = [ 'diskstream.cc', 'element_import_handler.cc', 'element_importer.cc', + 'engine_slave.cc', 'enums.cc', 'event_type_map.cc', 'export_channel.cc', @@ -103,7 +104,6 @@ libardour_sources = [ 'interpolation.cc', 'io.cc', 'io_processor.cc', - 'jack_slave.cc', 'kmeterdsp.cc', 'ladspa_plugin.cc', 'location.cc', |