Browse Source

Use tick_double on jack transport

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.1
falkTX 3 years ago
parent
commit
43c1131039
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 29 additions and 13 deletions
  1. +9
    -8
      source/backend/engine/CarlaEngineInternal.cpp
  2. +12
    -2
      source/backend/engine/CarlaEngineJack.cpp
  3. +6
    -2
      source/jackbridge/JackBridge.hpp
  4. +2
    -1
      source/libjack/libjack.cpp

+ 9
- 8
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -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<int32_t>(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<jack_position_bits_t>(JackPositionBBT|JackTickDouble);
pos->bar = timeInfo.bbt.bar;
pos->beat = timeInfo.bbt.beat;
pos->tick = static_cast<int32_t>(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;
}



+ 12
- 2
source/backend/engine/CarlaEngineJack.cpp View File

@@ -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;


+ 6
- 2
source/jackbridge/JackBridge.hpp View File

@@ -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;



+ 2
- 1
source/libjack/libjack.cpp View File

@@ -822,11 +822,12 @@ bool CarlaJackAppClient::handleRtData()

if (bridgeTimeInfo.validFlags & kPluginBridgeTimeInfoValidBBT)
{
fServer.position.valid = JackPositionBBT;
fServer.position.valid = static_cast<jack_position_bits_t>(JackPositionBBT|JackTickDouble);

fServer.position.bar = bridgeTimeInfo.bar;
fServer.position.beat = bridgeTimeInfo.beat;
fServer.position.tick = static_cast<int32_t>(bridgeTimeInfo.tick + 0.5);
fServer.position.tick_double = bridgeTimeInfo.tick;

fServer.position.beats_per_bar = bridgeTimeInfo.beatsPerBar;
fServer.position.beat_type = bridgeTimeInfo.beatType;


Loading…
Cancel
Save