summaryrefslogtreecommitdiff
path: root/libs/ardour/jack_audiobackend.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-08-09 12:15:37 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-09 12:15:37 -0400
commita34d7071753867b9aba3bca2f3436ed4a980c895 (patch)
tree20e7e3658bec5eb220b7330695c74b8a9034df52 /libs/ardour/jack_audiobackend.cc
parentda7451991178ad224acac55d177011e32204cac7 (diff)
split up session code that uses parts of the JACK API (timebase + session event handling) and connect it directly to the jack audiobackend
i've made the audiobackend call the session directly so that only one object (ARDOUR::Session) has a need for the JACK types and only one .cc file (session_jack.cc) needs jack.h. having ARDOUR::AudioEngine act as an intermediary would be cleaner conceptually but would end up causing two different ARDOUR objects to have jack types in their own API.
Diffstat (limited to 'libs/ardour/jack_audiobackend.cc')
-rw-r--r--libs/ardour/jack_audiobackend.cc36
1 files changed, 11 insertions, 25 deletions
diff --git a/libs/ardour/jack_audiobackend.cc b/libs/ardour/jack_audiobackend.cc
index a3bbaecb2d..ece8c4788e 100644
--- a/libs/ardour/jack_audiobackend.cc
+++ b/libs/ardour/jack_audiobackend.cc
@@ -28,7 +28,9 @@
#include "jack/thread.h"
#include "ardour/audioengine.h"
+#include "ardour/session.h"
#include "ardour/types.h"
+
#include "ardour/jack_audiobackend.h"
#include "ardour/jack_connection.h"
#include "ardour/jack_portengine.h"
@@ -680,32 +682,14 @@ JACKAudioBackend::_jack_timebase_callback (jack_transport_state_t state, pframes
}
void
-JACKAudioBackend::jack_timebase_callback (jack_transport_state_t state, pframes_t /*nframes*/,
- jack_position_t* pos, int /*new_position*/)
+JACKAudioBackend::jack_timebase_callback (jack_transport_state_t state, pframes_t nframes,
+ jack_position_t* pos, int new_position)
{
- TransportState tstate;
- framepos_t position;
-
- switch (state) {
- case JackTransportStopped:
- tstate = TransportStopped;
- break;
- case JackTransportRolling:
- tstate = TransportRolling;
- break;
- case JackTransportLooping:
- tstate = TransportLooping;
- break;
- case JackTransportStarting:
- tstate = TransportStarting;
- break;
- }
+ ARDOUR::Session* session = engine.session();
- if (pos) {
- position = pos->frame;
+ if (session) {
+ session->jack_timebase_callback (state, nframes, pos, new_position);
}
-
- // engine.timebase_callback (tstate, nframes, position, new_position);
}
int
@@ -754,8 +738,10 @@ void
JACKAudioBackend::_session_callback (jack_session_event_t *event, void *arg)
{
JACKAudioBackend* ae = static_cast<JACKAudioBackend*> (arg);
- if (ae->connected()) {
- ae->engine.JackSessionEvent (event); /* EMIT SIGNAL */
+ ARDOUR::Session* session = ae->engine.session();
+
+ if (session) {
+ session->jack_session_event (event);
}
}
#endif