diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-13 22:50:54 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-13 22:50:54 -0400 |
commit | 80a13145f398e1c4ea22b3f8a25a5b38d3c5e328 (patch) | |
tree | 078d80efe121a30f5898b9bd70c12e92a0f90810 /gtk2_ardour/plugin_ui.cc | |
parent | ea1dc499159d80903f07d116bfeb4b92e2f9de6a (diff) |
Generalize no-plugin-state from AudioUnits to all plugins
Replace AU_STATE_SUPPORT compile-time define with NO_PLUGIN_STATE and make it prevent plugin state setting, preset loading, preset saving and plugin state saving. Blocks on these actions exist partially in the backend and partially in the GUI (this latter class are not absolute, and should OSC or MIDI be able to drive Plugin::save_preset() the block could be circumvented). Set NO_PLUGIN_STATE if --freebie is used at waf-configure time
Diffstat (limited to 'gtk2_ardour/plugin_ui.cc')
-rw-r--r-- | gtk2_ardour/plugin_ui.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 943a7a8bce..9a85b78454 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -565,9 +565,14 @@ PlugUIBase::preset_selected () } } +#ifdef NO_PLUGIN_STATE +static bool seen_saving_message = false; +#endif + void PlugUIBase::add_plugin_setting () { +#ifndef NO_PLUGIN_STATE NewPluginPresetDialog d (plugin); switch (d.run ()) { @@ -586,23 +591,49 @@ PlugUIBase::add_plugin_setting () } break; } +#else + if (!seen_saving_message) { + info << string_compose (_("Plugin presets are not supported in this build of %1. Consider paying for a full version"), + PROGRAM_NAME) + << endmsg; + seen_saving_message = true; + } +#endif } void PlugUIBase::save_plugin_setting () { +#ifndef NO_PLUGIN_STATE string const name = _preset_combo.get_active_text (); plugin->remove_preset (name); Plugin::PresetRecord const r = plugin->save_preset (name); if (!r.uri.empty ()) { plugin->load_preset (r); } +#else + if (!seen_saving_message) { + info << string_compose (_("Plugin presets are not supported in this build of %1. Consider paying for a newer version"), + PROGRAM_NAME) + << endmsg; + seen_saving_message = true; + } +#endif } void PlugUIBase::delete_plugin_setting () { +#ifndef NO_PLUGIN_STATE plugin->remove_preset (_preset_combo.get_active_text ()); +#else + if (!seen_saving_message) { + info << string_compose (_("Plugin presets are not supported in this build of %1. Consider paying for a newer version"), + PROGRAM_NAME) + << endmsg; + seen_saving_message = true; + } +#endif } bool |