summaryrefslogtreecommitdiff
path: root/libs/ardour/session_time.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/session_time.cc')
-rw-r--r--libs/ardour/session_time.cc97
1 files changed, 8 insertions, 89 deletions
diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc
index 18805afa90..0f2186c09b 100644
--- a/libs/ardour/session_time.cc
+++ b/libs/ardour/session_time.cc
@@ -180,31 +180,30 @@ Session::timecode_time (Timecode::Time &t)
}
int
-Session::jack_sync_callback (jack_transport_state_t state,
- jack_position_t* pos)
+Session::backend_sync_callback (TransportState state, framepos_t pos)
{
bool slave = synced_to_jack();
switch (state) {
- case JackTransportStopped:
- if (slave && _transport_frame != pos->frame && post_transport_work() == 0) {
- request_locate (pos->frame, false);
+ case TransportStopped:
+ if (slave && _transport_frame != pos && post_transport_work() == 0) {
+ request_locate (pos, false);
// cerr << "SYNC: stopped, locate to " << pos->frame << " from " << _transport_frame << endl;
return false;
} else {
return true;
}
- case JackTransportStarting:
+ case TransportStarting:
// cerr << "SYNC: starting @ " << pos->frame << " a@ " << _transport_frame << " our work = " << post_transport_work() << " pos matches ? " << (_transport_frame == pos->frame) << endl;
if (slave) {
- return _transport_frame == pos->frame && post_transport_work() == 0;
+ return _transport_frame == pos && post_transport_work() == 0;
} else {
return true;
}
break;
- case JackTransportRolling:
+ case TransportRolling:
// cerr << "SYNC: rolling slave = " << slave << endl;
if (slave) {
start_transport ();
@@ -212,93 +211,13 @@ Session::jack_sync_callback (jack_transport_state_t state,
break;
default:
- error << string_compose (_("Unknown JACK transport state %1 in sync callback"), state)
+ error << string_compose (_("Unknown transport state %1 in sync callback"), state)
<< endmsg;
}
return true;
}
-void
-Session::jack_timebase_callback (jack_transport_state_t /*state*/,
- pframes_t /*nframes*/,
- jack_position_t* pos,
- int /*new_position*/)
-{
- Timecode::BBT_Time bbt;
-
- /* BBT info */
-
- if (_tempo_map) {
-
- TempoMetric metric (_tempo_map->metric_at (_transport_frame));
-
- try {
- _tempo_map->bbt_time_rt (_transport_frame, bbt);
-
- 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->valid = jack_position_bits_t (pos->valid | JackPositionBBT);
-
- } catch (...) {
- /* no message */
- }
- }
-
-#ifdef HAVE_JACK_VIDEO_SUPPORT
- //poke audio video ratio so Ardour can track Video Sync
- pos->audio_frames_per_video_frame = frame_rate() / timecode_frames_per_second();
- pos->valid = jack_position_bits_t (pos->valid | JackAudioVideoRatio);
-#endif
-
-#if 0
- /* Timecode info */
-
- pos->timecode_offset = config.get_timecode_offset();
- t.timecode_frame_rate = timecode_frames_per_second();
- pos->valid = jack_position_bits_t (pos->valid | JackPositionTimecode;
-
- if (_transport_speed) {
-
- if (play_loop) {
-
- Location* location = _locations.auto_loop_location();
-
- if (location) {
-
- t.transport_state = JackTransportLooping;
- t.loop_start = location->start();
- t.loop_end = location->end();
- t.valid = jack_transport_bits_t (t.valid | JackTransportLoop);
-
- } else {
-
- t.loop_start = 0;
- t.loop_end = 0;
- t.transport_state = JackTransportRolling;
-
- }
-
- } else {
-
- t.loop_start = 0;
- t.loop_end = 0;
- t.transport_state = JackTransportRolling;
-
- }
-
- }
-#endif
-}
ARDOUR::framecnt_t
Session::convert_to_frames (AnyTime const & position)