On plugin internal-state change, mark preset as modified

This commit is contained in:
Robin Gareus 2020-06-21 17:36:01 +02:00
parent ff8a6dd328
commit 1674261f89
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 23 additions and 5 deletions

View File

@ -376,6 +376,12 @@ protected:
/** Do the actual removal of a preset of the provided name */
virtual void do_remove_preset (std::string) = 0;
/** Plugin's [internal] state changed, mark preset and session
* as modified.
*/
void state_changed ();
ARDOUR::AudioEngine& _engine;
ARDOUR::Session& _session;
PluginInfoPtr _info;

View File

@ -2999,7 +2999,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
atom->type == _uri_map.urids.atom_Object) {
LV2_Atom_Object* obj = (LV2_Atom_Object*)atom;
if (obj->body.otype == _uri_map.urids.state_StateChanged) {
_session.set_dirty ();
Plugin::state_changed ();
}
}
}

View File

@ -493,6 +493,14 @@ Plugin::parameter_changed_externally (uint32_t which, float /* value */)
PresetDirty (); /* EMIT SIGNAL */
}
void
Plugin::state_changed ()
{
_parameter_changed_since_last_preset = true;
_session.set_dirty ();
PresetDirty (); /* EMIT SIGNAL */
}
int
Plugin::set_state (const XMLNode& node, int /*version*/)
{

View File

@ -502,10 +502,14 @@ intptr_t Session::vst_callback (
case audioMasterUpdateDisplay:
SHOW_CALLBACK ("audioMasterUpdateDisplay");
// something has changed, update 'multi-fx' display
/* TODO: consider emitting ParameterChangedExternally() for each ctrl input */
if (session) {
session->set_dirty ();
/* Something has changed, update 'multi-fx' display.
* (Ardour watches output ports already, and redraws when idle.)
*
* We assume that the internal state of the plugin has changed,
* and session as well as preset is marked as modified.
*/
if (plug) {
plug->state_changed ();
}
return 0;