Update backend API: read-only MIDI input buffers
[ardour.git] / libs / backends / jack / jack_session.cc
index ca51dafcccbc67c99c841e26f32e7b91723bd1b7..ce325321f317303013ed789992b3b7e874d67188 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <glibmm/miscutils.h>
 
-#include <jack/jack.h>
+#include "pbd/localtime_r.h"
 
 #include "ardour/audioengine.h"
 #include "ardour/filename_extensions.h"
@@ -89,12 +89,12 @@ JACKSession::session_event (jack_session_event_t* event)
                 }
         }
 
-       /* this won't be called if the port engine in use is not JACK, so we do 
+       /* this won't be called if the port engine in use is not JACK, so we do
           not have to worry about the type of PortEngine::private_handle()
        */
 
        jack_client_t* jack_client = (jack_client_t*) AudioEngine::instance()->port_engine().private_handle();
-       
+
        if (jack_client) {
                jack_session_reply (jack_client, event);
        }
@@ -119,23 +119,23 @@ JACKSession::timebase_callback (jack_transport_state_t /*state*/,
        /* BBT info */
 
        TempoMetric metric (tempo_map.metric_at (tf));
-       
+
        try {
-               tempo_map.bbt_time_rt (tf, bbt);
-               
+               bbt = tempo_map.bbt_at_frame (tf);
+
                pos->bar = bbt.bars;
                pos->beat = bbt.beats;
                pos->tick = bbt.ticks;
-               
+
                // XXX still need to set bar_start_tick
-               
+
                pos->beats_per_bar = metric.meter().divisions_per_bar();
                pos->beat_type = metric.meter().note_divisor();
                pos->ticks_per_beat = Timecode::BBT_Time::ticks_per_beat;
-               pos->beats_per_minute = metric.tempo().beats_per_minute();
-               
+               pos->beats_per_minute = metric.tempo().note_types_per_minute();
+
                pos->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
-               
+
        } catch (...) {
                /* no message */
        }