Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osc: Pass user-visible piid to OSCSelectObserver
There are two ways to identify a plugin: 1. The user-visible number, usually named "piid". This is a 1-based index into the list of visible, non-channelstrip plugins only. 2. The plugin id. This is a 1-based index into the list of all plugins as passed to nth_plugin The sur->plugins vector is used to translate the former into the latter. Previously, the latter, already translated, index was passed to OSCSelectObserver to indicate the currently selected plugin. To prepare for sending the piid of the selected plugin in a feedback message (in the next commit), this commit moves the translation of piid to plugin id into OSCSelectObserver. To emphasize the new meaning of the plug_id variable, it is renamed to selected_piid. Also, since the piid is 1-based, change it to a uint32_t and use 0 to mean "no plugin selected" instead of -1. This commit is expected to subtly change behaviour: When selecting a different strip, OSCSelectObserver would (via OSC::_strip_select2 and refresh_strip) send feedback for the plugin with the same plugin id as the previously selected plugin. Then OSC::_strip_select2 would do the piid to plugin id translation for the new strip and call set_plugin, causing a second round of feedback for the plugin with the same piid as the previously selected plugin. If the new strip has hidden plugins (i.e. piid and plugin id do not match), this could mean that you get feedback for two different plugins. With this commit applied, the translation happens in both cases and the feedback returned should be for the same plugin twice.
- Loading branch information