Skip to content

Commit

Permalink
Fixes bar position and playing state passed to process call
Browse files Browse the repository at this point in the history
  • Loading branch information
azeno committed Nov 1, 2024
1 parent 3416045 commit 97b4f6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/EffectHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ unsafe void Process(AudioBufferStereo audioBufferStereo)

PrepareBuffers();

var timer = AudioService.Engine.Timer;
var engine = AudioService.Engine;
var timer = engine.Timer;

var processContext = new ProcessContext()
{
Expand All @@ -533,18 +534,20 @@ unsafe void Process(AudioBufferStereo audioBufferStereo)
systemTime = DateTime.Now.Ticks * 100,
continousTimeSamples = timer.BufferStart, // TODO: This should be without loop, where to we get this value from?
projectTimeMusic = timer.Beat,
barPositionMusic = Math.Floor(timer.Beat / 4) * 4,
cycleStartMusic = timer.LoopStartBeat,
cycleEndMusic = timer.LoopEndBeat,
tempo = timer.BPM,
timeSigNumerator = timer.TimeSignatureNumerator,
timeSigDenominator = timer.TimeSignatureDenominator,
state = ProcessContext.StatesAndFlags.kPlaying |
state = (engine.Play ? ProcessContext.StatesAndFlags.kPlaying : default) |
ProcessContext.StatesAndFlags.kTempoValid |
ProcessContext.StatesAndFlags.kTimeSigValid |
ProcessContext.StatesAndFlags.kSystemTimeValid |
ProcessContext.StatesAndFlags.kContTimeValid |
ProcessContext.StatesAndFlags.kProjectTimeMusicValid |
ProcessContext.StatesAndFlags.kCycleValid |
ProcessContext.StatesAndFlags.kBarPositionValid |
(timer.Loop ? ProcessContext.StatesAndFlags.kCycleActive : default)
};

Expand Down

0 comments on commit 97b4f6f

Please sign in to comment.