Skip to content

Commit

Permalink
Merge pull request musescore#24122 from RomanPudashkin/update_musesam…
Browse files Browse the repository at this point in the history
…pler_blocksize

update_musesampler_blocksize
  • Loading branch information
RomanPudashkin committed Aug 21, 2024
2 parents 28a12fd + 8118905 commit 7d471fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/framework/musesampler/internal/musesamplerwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ MuseSamplerWrapper::MuseSamplerWrapper(MuseSamplerLibHandlerPtr samplerLib,
m_sequencer.setOnOffStreamFlushed([this]() {
m_allNotesOffRequested = true;
});

config()->samplesToPreallocateChanged().onReceive(this, [this](const samples_t samples) {
initSampler(m_samplerSampleRate, samples);
});
}

MuseSamplerWrapper::~MuseSamplerWrapper()
Expand Down Expand Up @@ -263,6 +267,14 @@ bool MuseSamplerWrapper::initSampler(const sample_rate_t sampleRate, const sampl
{
TRACEFUNC;

IF_ASSERT_FAILED(sampleRate != 0 && blockSize != 0) {
return false;
}

IF_ASSERT_FAILED(m_samplerLib) {
return false;
}

const bool isFirstInit = m_sampler == nullptr;

if (isFirstInit) {
Expand Down

0 comments on commit 7d471fb

Please sign in to comment.