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
}
}
+#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 ()) {
}
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
using namespace PBD;
using namespace ARDOUR;
-#ifndef AU_STATE_SUPPORT
-static bool seen_get_state_message = false;
-static bool seen_set_state_message = false;
-static bool seen_loading_message = false;
-static bool seen_saving_message = false;
-#endif
-
AUPluginInfo::CachedInfoMap AUPluginInfo::cached_info;
static string preset_search_path = "/Library/Audio/Presets:/Network/Library/Audio/Presets";
AUPlugin::add_state (XMLNode* root) const
{
LocaleGuard lg (X_("POSIX"));
-
-#ifdef AU_STATE_SUPPORT
CFDataRef xmlData;
CFPropertyListRef propertyList;
CFRelease (xmlData);
CFRelease (propertyList);
-#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
}
int
AUPlugin::set_state(const XMLNode& node, int version)
{
-#ifdef AU_STATE_SUPPORT
int ret = -1;
CFPropertyListRef propertyList;
LocaleGuard lg (X_("POSIX"));
Plugin::set_state (node, version);
return ret;
-#else
- if (!seen_set_state_message) {
- info << string_compose (_("Restoring AudioUnit settings is not supported in this build of %1. Consider paying for a newer version"),
- PROGRAM_NAME)
- << endmsg;
- }
- return Plugin::set_state (node, version);
-#endif
}
bool
{
Plugin::load_preset (r);
-#ifdef AU_STATE_SUPPORT
bool ret = false;
CFPropertyListRef propertyList;
Glib::ustring path;
}
return ret;
-#else
- if (!seen_loading_message) {
- info << string_compose (_("Loading AudioUnit presets is not supported in this build of %1. Consider paying for a newer version"),
- PROGRAM_NAME)
- << endmsg;
- seen_loading_message = true;
- }
- return true;
-#endif
}
void
string
AUPlugin::do_save_preset (string preset_name)
{
-#ifdef AU_STATE_SUPPORT
CFPropertyListRef propertyList;
vector<Glib::ustring> v;
Glib::ustring user_preset_path;
CFRelease(propertyList);
return string ("file:///") + user_preset_path;
-#else
- if (!seen_saving_message) {
- info << string_compose (_("Saving AudioUnit presets is not supported in this build of %1. Consider paying for a newer version"),
- PROGRAM_NAME)
- << endmsg;
- seen_saving_message = true;
- }
- return string();
-#endif
}
//-----------------------------------------------------------------------------
{
string preset_name;
-#ifdef AU_STATE_SUPPORT
CFPropertyListRef propertyList;
DEBUG_TRACE (DEBUG::AudioUnits, "get current preset for current_preset()\n");
preset_name = get_preset_name_in_plist (propertyList);
CFRelease(propertyList);
}
-#endif
+
return preset_name;
}
void
AUPlugin::find_presets ()
{
-#ifdef AU_STATE_SUPPORT
vector<string*>* preset_files;
PathScanner scanner;
string const uri = string_compose ("%1", _presets.size ());
_presets.insert (make_pair (uri, Plugin::PresetRecord (uri, i->first, i->second)));
}
-
-#endif
}
bool
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
{
_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;
}
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;
}
continue;
}
+#ifndef NO_PLUGIN_STATE
if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
/* This processor could not be configured. Turn it into a UnknownProcessor */
processor.reset (new UnknownProcessor (_session, **niter));
}
+#else
+ if (boost::dynamic_pointer_cast<PluginInsert>(processor)) {
+ if (processor->set_state (**niter, Stateful::current_state_version) != 0) {
+ /* This processor could not be configured. Turn it into a UnknownProcessor */
+ processor.reset (new UnknownProcessor (_session, **niter));
+ }
+ } else {
+ /* plugin, but ::set_state() not * allowed no message here - things will get too verbose */
+ }
+#endif
/* we have to note the monitor send here, otherwise a new one will be created
and the state of this one will be lost.
else:
autowaf.display_msg(conf, 'Will build against private Ardour dependency stack', 'no')
+ if Options.options.freebie:
+ conf.env.append_value ('CFLAGS', '-DNO_PLUGIN_STATE')
+ conf.env.append_value ('CXXFLAGS', '-DNO_PLUGIN_STATE')
+
if sys.platform == 'darwin':
# this is required, potentially, for anything we link and then relocate into a bundle
conf.define ('HAVE_COREAUDIO', 1)
conf.define ('AUDIOUNIT_SUPPORT', 1)
- if not Options.options.freebie:
- conf.define ('AU_STATE_SUPPORT', 1)
-
conf.define ('GTKOSX', 1)
conf.define ('TOP_MENUBAR',1)
conf.define ('GTKOSX',1)
conf.env.append_value('LINKFLAGS_AUDIOUNITS', ['-framework', 'Cocoa'])
if not Options.options.freebie:
- conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DAU_STATE_SUPPORT")
+ conf.env.append_value('CXXFLAGS_AUDIOUNITS')
if re.search ("^[1-9][0-9]\.", os.uname()[2]) == None and not Options.options.nocarbon:
conf.env.append_value('CXXFLAGS_AUDIOUNITS', "-DWITH_CARBON")