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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
#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)) {
|
||||
// Update the current CCs
|
||||
self->cc_current[cc] = desc.ccValue[cc];
|
||||
self->resync_cc = true;
|
||||
|
||||
if (desc.ccLabel[cc].empty())
|
||||
cursor += snprintf(cursor, end - cursor, "- %d\n", cc);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ struct sfizz_plugin_t
|
|||
// Current CC values in the synth (synchronized by `synth_mutex`)
|
||||
// updated by hdcc or file load
|
||||
float *cc_current {};
|
||||
volatile bool resync_cc { false };
|
||||
|
||||
// Timing data
|
||||
int bar {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue