Merge pull request #1069 from paulfd/lv2-default-bug
Add a resync cc flag for the main callback to update the CC state
This commit is contained in:
commit
1a793c8c7b
2 changed files with 10 additions and 0 deletions
|
|
@ -1266,6 +1266,13 @@ run(LV2_Handle instance, uint32_t sample_count)
|
||||||
self->midnam->update(self->midnam->handle);
|
self->midnam->update(self->midnam->handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self->resync_cc) {
|
||||||
|
for (unsigned cc = 0; cc < sfz::config::numCCs; ++cc)
|
||||||
|
sfizz_lv2_send_controller(self, self->patch_set_uri, cc, self->cc_current[cc]);
|
||||||
|
|
||||||
|
self->resync_cc = false;
|
||||||
|
}
|
||||||
|
|
||||||
spin_mutex_unlock(self->synth_mutex);
|
spin_mutex_unlock(self->synth_mutex);
|
||||||
|
|
||||||
#if defined(SFIZZ_LV2_UI)
|
#if defined(SFIZZ_LV2_UI)
|
||||||
|
|
@ -1418,6 +1425,8 @@ sfizz_lv2_update_sfz_info(sfizz_plugin_t *self)
|
||||||
if (desc.ccUsed.test(cc) && !desc.sustainOrSostenuto.test(cc)) {
|
if (desc.ccUsed.test(cc) && !desc.sustainOrSostenuto.test(cc)) {
|
||||||
// Update the current CCs
|
// Update the current CCs
|
||||||
self->cc_current[cc] = desc.ccValue[cc];
|
self->cc_current[cc] = desc.ccValue[cc];
|
||||||
|
self->resync_cc = true;
|
||||||
|
|
||||||
if (desc.ccLabel[cc].empty())
|
if (desc.ccLabel[cc].empty())
|
||||||
cursor += snprintf(cursor, end - cursor, "- %d\n", cc);
|
cursor += snprintf(cursor, end - cursor, "- %d\n", cc);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@ struct sfizz_plugin_t
|
||||||
// Current CC values in the synth (synchronized by `synth_mutex`)
|
// Current CC values in the synth (synchronized by `synth_mutex`)
|
||||||
// updated by hdcc or file load
|
// updated by hdcc or file load
|
||||||
float *cc_current {};
|
float *cc_current {};
|
||||||
|
volatile bool resync_cc { false };
|
||||||
|
|
||||||
// Timing data
|
// Timing data
|
||||||
int bar {};
|
int bar {};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue