diff --git a/plugins/lv2/sfizz.cpp b/plugins/lv2/sfizz.cpp index 244c368b..53647a28 100644 --- a/plugins/lv2/sfizz.cpp +++ b/plugins/lv2/sfizz.cpp @@ -983,7 +983,6 @@ run(LV2_Handle instance, uint32_t sample_count) sfizz_render_block(self->synth, self->output_buffers, 2, (int)sample_count); // Request OSC updates - sfizz_send_message(self->synth, self->client, 0, "/cc/changed~", "", nullptr); sfizz_send_message(self->synth, self->client, 0, "/sw/last/current", "", nullptr); spin_mutex_unlock(self->synth_mutex); diff --git a/plugins/lv2/sfizz_ui.cpp b/plugins/lv2/sfizz_ui.cpp index 3986b41a..db91b4e0 100644 --- a/plugins/lv2/sfizz_ui.cpp +++ b/plugins/lv2/sfizz_ui.cpp @@ -102,6 +102,7 @@ struct sfizz_ui_t : EditorController, VSTGUIEditorInterface { LV2_Atom_Forge atom_forge; LV2_URID atom_event_transfer_uri; LV2_URID atom_object_uri; + LV2_URID atom_float_uri; LV2_URID atom_path_uri; LV2_URID atom_urid_uri; LV2_URID midi_event_uri; @@ -202,6 +203,7 @@ instantiate(const LV2UI_Descriptor *descriptor, lv2_atom_forge_init(forge, map); self->atom_event_transfer_uri = map->map(map->handle, LV2_ATOM__eventTransfer); self->atom_object_uri = map->map(map->handle, LV2_ATOM__Object); + self->atom_float_uri = map->map(map->handle, LV2_ATOM__Float); self->atom_path_uri = map->map(map->handle, LV2_ATOM__Path); self->atom_urid_uri = map->map(map->handle, LV2_ATOM__URID); self->midi_event_uri = map->map(map->handle, LV2_MIDI__MidiEvent); @@ -350,7 +352,15 @@ port_event(LV2UI_Handle ui, const LV2_URID prop_uri = reinterpret_cast(prop)->body; auto *value_body = reinterpret_cast(LV2_ATOM_BODY_CONST(value)); - if (prop_uri == self->sfizz_sfz_file_uri && value->type == self->atom_path_uri) { + int cc = sfizz_lv2_ccmap_unmap(self->ccmap.get(), prop_uri); + + if (cc != -1) { + if (value->type == self->atom_float_uri) { + float ccvalue = *reinterpret_cast(value_body); + self->uiReceiveValue(editIdForCC(cc), ccvalue); + } + } + else if (prop_uri == self->sfizz_sfz_file_uri && value->type == self->atom_path_uri) { std::string path(value_body, strnlen(value_body, value->size)); self->uiReceiveValue(EditId::SfzFile, path); }