summaryrefslogtreecommitdiff
path: root/libs/ardour/plugin.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-13 22:50:54 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-13 22:50:54 -0400
commit80a13145f398e1c4ea22b3f8a25a5b38d3c5e328 (patch)
tree078d80efe121a30f5898b9bd70c12e92a0f90810 /libs/ardour/plugin.cc
parentea1dc499159d80903f07d116bfeb4b92e2f9de6a (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 'libs/ardour/plugin.cc')
-rw-r--r--libs/ardour/plugin.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc
index 57198475d7..e76353e8d5 100644
--- a/libs/ardour/plugin.cc
+++ b/libs/ardour/plugin.cc
@@ -68,6 +68,11 @@ using namespace PBD;
namespace ARDOUR { class AudioEngine; }
+#ifdef NO_PLUGIN_STATE
+static bool seen_get_state_message = false;
+static bool seen_set_state_message = false;
+#endif
+
bool
PluginInfo::is_instrument () const
{
@@ -299,18 +304,28 @@ Plugin::resolve_midi ()
_have_pending_stop_events = true;
}
+
vector<Plugin::PresetRecord>
Plugin::get_presets ()
{
+ vector<PresetRecord> p;
+
+#ifndef NO_PLUGIN_STATE
if (!_have_presets) {
find_presets ();
_have_presets = true;
}
- vector<PresetRecord> p;
for (map<string, PresetRecord>::const_iterator i = _presets.begin(); i != _presets.end(); ++i) {
p.push_back (i->second);
}
+#else
+ if (!seen_set_state_message) {
+ info << string_compose (_("Plugin presets are not supported in this build of %1. Consider paying for a full version"),
+ PROGRAM_NAME)
+ << endmsg;
+ }
+#endif
return p;
}
@@ -376,7 +391,17 @@ Plugin::get_state ()
root->add_property (X_("last-preset-label"), _last_preset.label);
root->add_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset ? X_("yes") : X_("no"));
+#ifndef NO_PLUGIN_STATE
add_state (root);
+#else
+ if (!seen_get_state_message) {
+ info << string_compose (_("Saving AudioUnit settings is not supported in this build of %1. Consider paying for a newer version"),
+ PROGRAM_NAME)
+ << endmsg;
+ seen_get_state_message = true;
+ }
+#endif
+
return *root;
}