13
0

restore jack timebase master and jack session callback functionality (moved into the JACK backend)

This commit is contained in:
Paul Davis 2013-10-08 14:02:03 -04:00
parent 7e077bdeba
commit c98abed37f
5 changed files with 15 additions and 19 deletions

View File

@ -881,15 +881,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
MIDI::MachineControl& mmc() { return *_mmc; }
/* Callbacks specifically related to JACK, and called directly
* from the JACK audio backend.
*/
#ifdef HAVE_JACK_SESSION
void jack_session_event (jack_session_event_t* event);
#endif
void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
protected:
friend class AudioEngine;
void set_block_size (pframes_t nframes);

View File

@ -180,7 +180,6 @@ libardour_sources = [
'session_events.cc',
'session_export.cc',
'session_handle.cc',
'session_jack.cc',
'session_ltc.cc',
'session_metadata.cc',
'session_midi.cc',

View File

@ -37,6 +37,7 @@
#include "jack_audiobackend.h"
#include "jack_connection.h"
#include "jack_utils.h"
#include "jack_session.h"
#include "i18n.h"
@ -64,6 +65,7 @@ JACKAudioBackend::JACKAudioBackend (AudioEngine& e, boost::shared_ptr<JackConnec
, _target_systemic_output_latency (0)
, _current_sample_rate (0)
, _current_buffer_size (0)
, _session (0)
{
_jack_connection->Connected.connect_same_thread (jack_connection_connection, boost::bind (&JACKAudioBackend::when_connected_to_jack, this));
_jack_connection->Disconnected.connect_same_thread (disconnect_connection, boost::bind (&JACKAudioBackend::disconnected, this, _1));
@ -748,7 +750,8 @@ JACKAudioBackend::jack_timebase_callback (jack_transport_state_t state, pframes_
ARDOUR::Session* session = engine.session();
if (session) {
session->jack_timebase_callback (state, nframes, pos, new_position);
JACKSession jsession (session);
jsession.timebase_callback (state, nframes, pos, new_position);
}
}
@ -793,7 +796,6 @@ JACKAudioBackend::_xrun_callback (void *arg)
return 0;
}
#ifdef HAVE_JACK_SESSION
void
JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
{
@ -801,10 +803,10 @@ JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
ARDOUR::Session* session = jab->engine.session();
if (session) {
session->jack_session_event (event);
JACKSession jsession (session);
jsession.session_event (event);
}
}
#endif
void
JACKAudioBackend::_freewheel_callback (int onoff, void *arg)

View File

@ -30,15 +30,14 @@
#include <boost/shared_ptr.hpp>
#include <jack/jack.h>
#ifdef HAVE_JACK_SESSION
#include <jack/session.h>
#endif
#include "ardour/audio_backend.h"
namespace ARDOUR {
class JackConnection;
class JACKSession;
class JACKAudioBackend : public AudioBackend {
public:
@ -196,9 +195,7 @@ class JACKAudioBackend : public AudioBackend {
static int _jack_sync_callback (jack_transport_state_t, jack_position_t*, void *arg);
static void _freewheel_callback (int , void *arg);
static void _latency_callback (jack_latency_callback_mode_t, void*);
#ifdef HAVE_JACK_SESSION
static void _session_callback (jack_session_event_t *event, void *arg);
#endif
void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
@ -261,6 +258,12 @@ class JACKAudioBackend : public AudioBackend {
void when_connected_to_jack ();
PBD::ScopedConnection jack_connection_connection;
/* Object to manage interactions with Session in a way that
keeps JACK out of libardour directly
*/
JACKSession* _session;
};
} // namespace

View File

@ -28,7 +28,8 @@ def build(bld):
'jack_connection.cc',
'jack_audiobackend.cc',
'jack_portengine.cc',
'jack_utils.cc'
'jack_utils.cc',
'jack_session.cc',
]
obj.includes = ['.']
obj.cxxflags = [ '-fPIC' ]