diff --git a/source/backend/engine/CarlaEngineInternal.cpp b/source/backend/engine/CarlaEngineInternal.cpp index 0d29dc7b1..304c82a53 100644 --- a/source/backend/engine/CarlaEngineInternal.cpp +++ b/source/backend/engine/CarlaEngineInternal.cpp @@ -262,14 +262,15 @@ void EngineInternalTime::fillJackTimeInfo(jack_position_t* const pos, const uint fillEngineTimeInfo(newFrames); - pos->valid = JackPositionBBT; - pos->bar = timeInfo.bbt.bar; - pos->beat = timeInfo.bbt.beat; - pos->tick = static_cast(timeInfo.bbt.tick + 0.5); - pos->bar_start_tick = timeInfo.bbt.barStartTick; - pos->beats_per_bar = timeInfo.bbt.beatsPerBar; - pos->beat_type = timeInfo.bbt.beatType; - pos->ticks_per_beat = kTicksPerBeat; + pos->valid = static_cast(JackPositionBBT|JackTickDouble); + pos->bar = timeInfo.bbt.bar; + pos->beat = timeInfo.bbt.beat; + pos->tick = static_cast(timeInfo.bbt.tick + 0.5); + pos->tick_double = timeInfo.bbt.tick; + pos->bar_start_tick = timeInfo.bbt.barStartTick; + pos->beats_per_bar = timeInfo.bbt.beatsPerBar; + pos->beat_type = timeInfo.bbt.beatType; + pos->ticks_per_beat = kTicksPerBeat; pos->beats_per_minute = beatsPerMinute; } diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index 6f3b6d036..4b7f73f97 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -1918,7 +1918,12 @@ public: timeInfo.bbt.valid = true; timeInfo.bbt.bar = jpos.bar; timeInfo.bbt.beat = jpos.beat; - timeInfo.bbt.tick = jpos.tick; +#ifdef JACK_TICK_DOUBLE + if (jpos.valid & JackTickDouble) + timeInfo.bbt.tick = jpos.tick_double; + else +#endif + timeInfo.bbt.tick = jpos.tick; timeInfo.bbt.barStartTick = jpos.bar_start_tick; timeInfo.bbt.beatsPerBar = jpos.beats_per_bar; timeInfo.bbt.beatType = jpos.beat_type; @@ -2922,7 +2927,12 @@ protected: timeInfo.bbt.valid = true; timeInfo.bbt.bar = jpos.bar; timeInfo.bbt.beat = jpos.beat; - timeInfo.bbt.tick = jpos.tick; +#ifdef JACK_TICK_DOUBLE + if (jpos.valid & JackTickDouble) + timeInfo.bbt.tick = jpos.tick_double; + else +#endif + timeInfo.bbt.tick = jpos.tick; timeInfo.bbt.barStartTick = jpos.bar_start_tick; timeInfo.bbt.beatsPerBar = jpos.beats_per_bar; timeInfo.bbt.beatType = jpos.beat_type; diff --git a/source/jackbridge/JackBridge.hpp b/source/jackbridge/JackBridge.hpp index 8c55670cc..3be207a46 100644 --- a/source/jackbridge/JackBridge.hpp +++ b/source/jackbridge/JackBridge.hpp @@ -98,6 +98,8 @@ #define JACK_UUID_SIZE 36 #define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */ +#define JACK_TICK_DOUBLE + extern "C" { enum JackOptions { @@ -152,7 +154,8 @@ enum JackPositionBits { JackPositionTimecode = 0x020, JackBBTFrameOffset = 0x040, JackAudioVideoRatio = 0x080, - JackVideoFrameOffset = 0x100 + JackVideoFrameOffset = 0x100, + JackTickDouble = 0x200 }; enum JackSessionEventType { @@ -222,7 +225,8 @@ struct _jack_position { jack_nframes_t bbt_offset; float audio_frames_per_video_frame; jack_nframes_t video_offset; - int32_t padding[7]; + double tick_double; + int32_t padding[5]; jack_unique_t unique_2; } POST_PACKED_STRUCTURE; diff --git a/source/libjack/libjack.cpp b/source/libjack/libjack.cpp index d16c95f67..9b405c353 100644 --- a/source/libjack/libjack.cpp +++ b/source/libjack/libjack.cpp @@ -822,11 +822,12 @@ bool CarlaJackAppClient::handleRtData() if (bridgeTimeInfo.validFlags & kPluginBridgeTimeInfoValidBBT) { - fServer.position.valid = JackPositionBBT; + fServer.position.valid = static_cast(JackPositionBBT|JackTickDouble); fServer.position.bar = bridgeTimeInfo.bar; fServer.position.beat = bridgeTimeInfo.beat; fServer.position.tick = static_cast(bridgeTimeInfo.tick + 0.5); + fServer.position.tick_double = bridgeTimeInfo.tick; fServer.position.beats_per_bar = bridgeTimeInfo.beatsPerBar; fServer.position.beat_type = bridgeTimeInfo.beatType;