Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the loop points in juce::AudioPlayHead::PositionInfo #155

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

asimilon
Copy link
Contributor

The wrapper wasn't setting the loop ppqStart and ppqEnd of juce::AudioPlayHead::PositionInfo::LoopPoints that can be accessed via getPlayHead()->getPosition()->getLoopPoints(), this proved to be an issue in one of my plugins.

There maybe an argument that within this code (that immediately follows my addition):

if (flags & CLAP_TRANSPORT_HAS_SECONDS_TIMELINE)
{
    auto timeInSeconds =
        1.0 * (double)transportInfo->song_pos_seconds / CLAP_SECTIME_FACTOR;
    posinfo.setTimeInSeconds(timeInSeconds);
    posinfo.setTimeInSamples((int64_t)(timeInSeconds * sampleRate()));
}

perhaps could try and set these loop point by converting seconds to PPQ iff they hadn't already been set by the preceding code, but I think it's a very tenuous argument and it's likely an extremely niche edge case scenario that wouldn't be able to set the loop points by beats anyway and not worth covering.

Proposed change fixes my issue.

@baconpaul
Copy link
Collaborator

I thought exact same as your comment when reading it, namely "oh hey we should try down here too" and then "oh but then we have to go seconds to PPQ which is a hard calculation" so I agree with your change. Will merge it.

@baconpaul baconpaul merged commit 24e70f7 into free-audio:main Jul 17, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants