#include "midi++/jack.h"
+#include "ardour/amp.h"
+#include "ardour/audio_port.h"
#include "ardour/audioengine.h"
#include "ardour/buffer.h"
-#include "ardour/port.h"
-#include "ardour/audio_port.h"
-#include "ardour/midi_port.h"
-#include "ardour/session.h"
+#include "ardour/buffer_set.h"
#include "ardour/cycle_timer.h"
-#include "ardour/utils.h"
+#include "ardour/delivery.h"
#include "ardour/event_type_map.h"
+#include "ardour/internal_return.h"
#include "ardour/io.h"
-#include "ardour/amp.h"
+#include "ardour/meter.h"
+#include "ardour/midi_port.h"
+#include "ardour/port.h"
#include "ardour/port_set.h"
-#include "ardour/buffer_set.h"
-
+#include "ardour/session.h"
#include "ardour/timestamps.h"
+#include "ardour/utils.h"
#include "i18n.h"
jack_set_sync_callback (_jack, _jack_sync_callback, this);
jack_set_freewheel_callback (_jack, _freewheel_callback, this);
- if (Config->get_jack_time_master()) {
+ if (session && session->config.get_jack_time_master()) {
jack_set_timebase_callback (_jack, 0, _jack_timebase_callback, this);
}
AudioEngine::process_callback (nframes_t nframes)
{
// CycleTimer ct ("AudioEngine::process");
+
Glib::Mutex::Lock tm (_process_lock, Glib::TRY_LOCK);
/// The number of frames that will have been processed when we've finished
return 0;
}
- /* tell all IO objects that we're starting a new cycle */
+ /* tell all relevant objects that we're starting a new cycle */
- IO::CycleStart (nframes);
+ Delivery::CycleStart (nframes);
Port::set_port_offset (0);
+ InternalReturn::CycleStart (nframes);
/* tell all Ports that we're starting a new cycle */
if (g_atomic_int_get(&m_meter_exit)) {
break;
}
- IO::update_meters ();
+ Metering::update_meters ();
}
}
}
if (ret > 0) {
- error << string_compose(_("AudioEngine: connection already exists: %1 (%2) to %3 (%4)"),
- source, s, destination, d)
- << endmsg;
+ /* already exists - no error, no warning */
} else if (ret < 0) {
error << string_compose(_("AudioEngine: cannot connect %1 (%2) to %3 (%4)"),
source, s, destination, d)
Port *
AudioEngine::get_port_by_name (const string& portname)
{
- assert (portname.find_first_of (':') != string::npos);
+ string s;
+ if (portname.find_first_of (':') == string::npos) {
+ s = make_port_name_non_relative (portname);
+ } else {
+ s = portname;
+ }
Glib::Mutex::Lock lm (_process_lock);
- return get_port_by_name_locked (portname);
+ return get_port_by_name_locked (s);
}
Port *
int
AudioEngine::reset_timebase ()
{
- if (_jack) {
- if (Config->get_jack_time_master()) {
+ if (_jack && session) {
+ if (session->config.get_jack_time_master()) {
return jack_set_timebase_callback (_jack, 0, _jack_timebase_callback, this);
} else {
return jack_release_timebase (_jack);
}
-#ifdef HAVE_JACK_CLIENT_OPEN
-
static void
ardour_jack_error (const char* msg)
{
return 0;
}
-#else
-
-int
-AudioEngine::connect_to_jack (string client_name)
-{
- jack_client_name = client_name;
-
- if ((_jack = jack_client_new (client_name.c_str())) == 0) {
- return -1;
- }
-
- return 0;
-}
-
-#endif /* HAVE_JACK_CLIENT_OPEN */
-
int
AudioEngine::disconnect_from_jack ()
{
jack_set_sync_callback (_jack, _jack_sync_callback, this);
jack_set_freewheel_callback (_jack, _freewheel_callback, this);
- if (Config->get_jack_time_master()) {
+ if (session && session->config.get_jack_time_master()) {
jack_set_timebase_callback (_jack, 0, _jack_timebase_callback, this);
}