#if 0
if (_session->config.get_external_sync()) {
switch (Config->get_sync_source()) {
- case JACK:
+ case Engine:
break;
default:
/* transport controlled by the master */
if (_session->config.get_external_sync()) {
switch (Config->get_sync_source()) {
- case JACK:
+ case Engine:
break;
default:
/* transport controlled by the master */
{
if (_session) {
if (_session->config.get_video_pullup() != 0.0f) {
- if (Config->get_sync_source() == JACK) {
+ if (Config->get_sync_source() == Engine) {
MessageDialog msg (
_("It is not possible to use JACK as the the sync source\n\
when the pull up/down setting is non-zero."));
act->set_sensitive (true);
} else {
/* can't sync to JACK if video pullup != 0.0 */
- if (Config->get_sync_source() == JACK) {
+ if (Config->get_sync_source() == Engine) {
act->set_sensitive (false);
} else {
act->set_sensitive (true);
Slave* slave = _session->slave();
switch (sync_src) {
- case JACK:
+ case Engine:
_left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%2</span></span>",
INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
_right_layout->set_text ("");
if (_session->config.get_external_sync()) {
switch (Config->get_sync_source()) {
- case JACK:
+ case Engine:
break;
default:
/* transport controlled by the master */
{
OptionEditor::parameter_changed (p);
if (p == "external-sync") {
- if (Config->get_sync_source() == JACK) {
+ if (Config->get_sync_source() == Engine) {
_vpu->set_sensitive(!_session_config->get_external_sync());
} else {
_vpu->set_sensitive(true);
bool my_manual_seek = true;
if (_session->config.get_external_sync()) {
- if (ARDOUR::Config->get_sync_source() == ARDOUR::JACK)
+ if (ARDOUR::Config->get_sync_source() == ARDOUR::Engine)
my_manual_seek = false;
}
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)
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; }
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);
};
enum SyncSource {
- JACK,
+ Engine,
MTC,
MIDIClock,
LTC
--- /dev/null
+/*
+ Copyright (C) 2004 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <iostream>
+#include <cerrno>
+
+#include "ardour/audioengine.h"
+#include "ardour/slave.h"
+
+using namespace std;
+using namespace ARDOUR;
+
+Engine_Slave::Engine_Slave (AudioEngine& e)
+ : engine (e)
+{
+ double x;
+ framepos_t p;
+ /* call this to initialize things */
+ speed_and_position (x, p);
+}
+
+Engine_Slave::~Engine_Slave ()
+{
+}
+
+bool
+Engine_Slave::locked() const
+{
+ return true;
+}
+
+bool
+Engine_Slave::ok() const
+{
+ return true;
+}
+
+bool
+Engine_Slave::speed_and_position (double& sp, framepos_t& position)
+{
+ switch (engine.transport_state()) {
+ case TransportStopped:
+ speed = 0;
+ _starting = false;
+ break;
+ case TransportRolling:
+ speed = 1.0;
+ _starting = false;
+ break;
+ case TransportLooping:
+ speed = 1.0;
+ _starting = false;
+ break;
+ case TransportStarting:
+ _starting = true;
+ // don't adjust speed here, just leave it as it was
+ break;
+ }
+
+ sp = speed;
+ position = engine.transport_frame();
+ return true;
+}
REGISTER (_PluginType);
REGISTER_ENUM (MTC);
- REGISTER_ENUM (JACK);
+ REGISTER_ENUM (Engine);
REGISTER_ENUM (MIDIClock);
REGISTER_ENUM (LTC);
REGISTER (_SyncSource);
{
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);
+++ /dev/null
-/*
- Copyright (C) 2004 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <cerrno>
-
-#include "ardour/audioengine.h"
-#include "ardour/slave.h"
-
-using namespace std;
-using namespace ARDOUR;
-
-JACK_Slave::JACK_Slave (AudioEngine& e)
- : engine (e)
-{
- double x;
- framepos_t p;
- /* call this to initialize things */
- speed_and_position (x, p);
-}
-
-JACK_Slave::~JACK_Slave ()
-{
-}
-
-bool
-JACK_Slave::locked() const
-{
- return true;
-}
-
-bool
-JACK_Slave::ok() const
-{
- return true;
-}
-
-bool
-JACK_Slave::speed_and_position (double& sp, framepos_t& position)
-{
- switch (engine.transport_state()) {
- case TransportStopped:
- speed = 0;
- _starting = false;
- break;
- case TransportRolling:
- speed = 1.0;
- _starting = false;
- break;
- case TransportLooping:
- speed = 1.0;
- _starting = false;
- break;
- case TransportStarting:
- _starting = true;
- // don't adjust speed here, just leave it as it was
- break;
- }
-
- sp = speed;
- position = engine.transport_frame();
- return true;
-}
_engine.Running.connect_same_thread (*this, boost::bind (&Session::initialize_latencies, this));
- if (synced_to_jack()) {
+ if (synced_to_engine()) {
_engine.transport_stop ();
}
offset = current_block_size;
}
- if (synced_to_jack()) {
+ if (synced_to_engine()) {
tf = _engine.transport_frame();
} else {
tf = _transport_frame;
int
Session::backend_sync_callback (TransportState state, framepos_t pos)
{
- bool slave = synced_to_jack();
+ bool slave = synced_to_engine();
switch (state) {
case TransportStopped:
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 {
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 */
/* 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();
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)
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;
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 {
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.
set_track_monitor_input_status (false);
}
- if (synced_to_jack()) {
+ if (synced_to_engine()) {
_engine.transport_start ();
} else {
start_transport ();
/* 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)
}
break;
- case JACK:
- if (_slave && dynamic_cast<JACK_Slave*>(_slave)) {
+ case Engine:
+ if (_slave && dynamic_cast<Engine_Slave*>(_slave)) {
return;
}
return;
}
- new_slave = new JACK_Slave (*AudioEngine::instance());
+ new_slave = new Engine_Slave (*AudioEngine::instance());
break;
default:
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;
}
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 */
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:
'diskstream.cc',
'element_import_handler.cc',
'element_importer.cc',
+ 'engine_slave.cc',
'enums.cc',
'event_type_map.cc',
'export_channel.cc',
'interpolation.cc',
'io.cc',
'io_processor.cc',
- 'jack_slave.cc',
'kmeterdsp.cc',
'ladspa_plugin.cc',
'location.cc',