}
}
-#ifdef NO_PLUGIN_STATE
-
- ARDOUR::RecentSessions rs;
- ARDOUR::read_recent_sessions (rs);
-
- string path = Glib::build_filename (user_config_directory(), ".iknowaboutfreeversion");
-
- if (!Glib::file_test (path, Glib::FILE_TEST_EXISTS) && !rs.empty()) {
-
- /* already used Ardour, have sessions ... warn about plugin state */
-
- ArdourDialog d (_("Free/Demo Version Warning"), true);
- Label l;
- Button b (string_compose (_("Subscribe and support development of %1"), PROGRAM_NAME));
- CheckButton c (_("Don't warn me about this again"));
-
- l.set_markup (string_compose (_("<span weight=\"bold\" size=\"large\">%1</span>\n\n<b>%2</b>\n\n<i>%3</i>\n\n%4"),
- string_compose (_("This is a free/demo version of %1"), PROGRAM_NAME),
- _("It will not restore OR save any plugin settings"),
- _("If you load an existing session with plugin settings\n"
- "they will not be used and will be lost."),
- _("To get full access to updates without this limitation\n"
- "consider becoming a subscriber for a low cost every month.")));
- l.set_justify (JUSTIFY_CENTER);
-
- b.signal_clicked().connect (mem_fun(*this, &ARDOUR_UI::launch_subscribe));
-
- d.get_vbox()->pack_start (l, true, true);
- d.get_vbox()->pack_start (b, false, false, 12);
- d.get_vbox()->pack_start (c, false, false, 12);
-
- d.add_button (_("Quit now"), RESPONSE_CANCEL);
- d.add_button (string_compose (_("Continue using %1"), PROGRAM_NAME), RESPONSE_OK);
-
- d.show_all ();
-
- c.signal_toggled().connect (sigc::hide_return (sigc::bind (sigc::ptr_fun (toggle_file_existence), path)));
-
- if (d.run () != RESPONSE_OK) {
- _exit (EXIT_SUCCESS);
- }
- }
-#endif
-
/* go get a session */
const bool new_session_required = (ARDOUR_COMMAND_LINE::new_session || (!ARDOUR::Profile->get_mixbus() && brand_new_user));
}
}
-#ifdef NO_PLUGIN_STATE
-static bool seen_saving_message = false;
-
-static void show_no_plugin_message()
-{
- info << string_compose (_("Plugin presets are not supported in this build of %1. Consider paying for a full version"),
- PROGRAM_NAME)
- << endmsg;
- info << _("To get full access to updates without this limitation\n"
- "consider becoming a subscriber for a low cost every month.")
- << endmsg;
- info << X_("https://community.ardour.org/s/subscribe")
- << endmsg;
- ARDOUR_UI::instance()->popup_error(_("Plugin presets are not supported in this build, see the Log window for more information."));
-}
-#endif
-
void
PlugUIBase::add_plugin_setting ()
{
-#ifndef NO_PLUGIN_STATE
NewPluginPresetDialog d (plugin, _("New Preset"));
switch (d.run ()) {
}
break;
}
-#else
- if (!seen_saving_message) {
- seen_saving_message = true;
- show_no_plugin_message();
- }
-#endif
}
void
PlugUIBase::save_plugin_setting ()
{
-#ifndef NO_PLUGIN_STATE
string const name = _preset_combo.get_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) {
- seen_saving_message = true;
- show_no_plugin_message();
- }
-#endif
}
void
PlugUIBase::delete_plugin_setting ()
{
-#ifndef NO_PLUGIN_STATE
plugin->remove_preset (_preset_combo.get_text ());
-#else
- if (!seen_saving_message) {
- seen_saving_message = true;
- show_no_plugin_message();
- }
-#endif
}
void
return -1;
}
-#ifndef NO_PLUGIN_STATE
if (node.children().empty()) {
return -1;
}
}
CFRelease (propertyList);
}
-#endif
Plugin::set_state (node, version);
return ret;
{
std::vector<Plugin::PresetRecord> p;
boost::shared_ptr<CAComponent> comp;
-#ifndef NO_PLUGIN_STATE
+
try {
comp = boost::shared_ptr<CAComponent>(new CAComponent(*descriptor));
if (!comp->IsValid()) {
CFRelease (presets);
unit->Uninitialize ();
-#endif // NO_PLUGIN_STATE
return p;
}
return set_state_2X (node, version);
}
-#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
XMLNodeConstIterator iter;
XMLNode *child;
-#endif
if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
return -1;
}
-#ifndef NO_PLUGIN_STATE
-
nodes = node.children ("Port");
for (iter = nodes.begin(); iter != nodes.end(); ++iter) {
set_parameter (port_id, value);
}
-#endif
latency_compute_run ();
int
LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
{
-#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
XMLProperty const * prop;
XMLNodeConstIterator iter;
const char *port;
const char *data;
uint32_t port_id;
-#endif
LocaleGuard lg;
if (node.name() != state_node_name()) {
return -1;
}
-#ifndef NO_PLUGIN_STATE
nodes = node.children ("port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
}
latency_compute_run ();
-#endif
return 0;
}
LadspaPluginInfo::get_presets (bool /*user_only*/) const
{
std::vector<Plugin::PresetRecord> p;
-#if (defined HAVE_LRDF && !defined NO_PLUGIN_STATE)
+#ifdef HAVE_LRDF
if (!isdigit (unique_id[0])) {
return p;
}
int
LuaProc::set_state (const XMLNode& node, int version)
{
-#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
XMLNodeConstIterator iter;
XMLNode *child;
-#endif
if (_script.empty ()) {
if (set_script_from_state (node)) {
}
}
-#ifndef NO_PLUGIN_STATE
if (node.name() != state_node_name()) {
error << _("Bad node sent to LuaProc::set_state") << endmsg;
return -1;
set_parameter (port_id, value);
}
-#endif
return Plugin::set_state (node, version);
}
return -1;
}
-#ifndef NO_PLUGIN_STATE
-
if (version < 3000) {
nodes = node.children("port");
} else {
if (_session.loading ()) {
latency_compute_run();
}
-#endif
return Plugin::set_state(node, version);
}
LV2PluginInfo::get_presets (bool /*user_only*/) const
{
std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
const LilvPlugin* lp = NULL;
try {
PluginPtr plugin;
lilv_node_free(rdfs_label);
lilv_node_free(pset_Preset);
lilv_node_free(lv2_appliesTo);
-#endif
+
return p;
}
LXVSTPluginInfo::get_presets (bool user_only) const
{
std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
if (!Config->get_use_lxvst()) {
return p;
}
}
}
}
- delete t;
-#endif
+ delete t;
return p;
}
MacVSTPluginInfo::get_presets (bool user_only) const
{
std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
if (!Config->get_use_macvst ()) {
return p;
}
}
}
delete t;
-#endif
-
return p;
}
namespace ARDOUR { class AudioEngine; }
-#ifdef NO_PLUGIN_STATE
-static bool seen_get_state_message = false;
-static bool seen_set_state_message = false;
-#endif
-
PBD::Signal2<void, std::string, Plugin*> Plugin::PresetsChanged;
bool
const Plugin::PresetRecord *
Plugin::preset_by_label (const string& label)
{
-#ifndef NO_PLUGIN_STATE
if (!_have_presets) {
find_presets ();
_have_presets = true;
}
-#endif
+
// FIXME: O(n)
for (map<string, PresetRecord>::const_iterator i = _presets.begin(); i != _presets.end(); ++i) {
if (i->second.label == label) {
const Plugin::PresetRecord *
Plugin::preset_by_uri (const string& uri)
{
-#ifndef NO_PLUGIN_STATE
if (!_have_presets) {
find_presets ();
_have_presets = true;
}
-#endif
+
map<string, PresetRecord>::const_iterator pr = _presets.find (uri);
if (pr != _presets.end()) {
return &pr->second;
{
vector<PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
if (!_have_presets) {
find_presets ();
_have_presets = true;
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;
- seen_set_state_message = true;
- }
-#endif
return p;
}
root->set_property (X_("last-preset-label"), _last_preset.label);
root->set_property (X_("parameter-changed-since-last-preset"), _parameter_changed_since_last_preset);
-#ifndef NO_PLUGIN_STATE
add_state (root);
-#else
- if (!seen_get_state_message) {
- info << string_compose (_("Saving plugin settings is not supported in this build of %1. Consider paying for the full version"),
- PROGRAM_NAME)
- << endmsg;
- seen_get_state_message = true;
- }
-#endif
return *root;
}
/* this may create the new controllable */
boost::shared_ptr<Evoral::Control> c = control (Evoral::Parameter (PluginAutomation, 0, p));
-#ifndef NO_PLUGIN_STATE
if (!c) {
continue;
}
if (ac) {
ac->set_state (**iter, version);
}
-#endif
}
}
{
LocaleGuard lg;
int ret = -1;
-
-#ifndef NO_PLUGIN_STATE
XMLNode* child;
if ((child = find_named_node (node, X_("chunk"))) != 0) {
ret = 0;
}
-#endif
Plugin::set_state (node, version);
return ret;
WindowsVSTPluginInfo::get_presets (bool user_only) const
{
std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
if (!Config->get_use_lxvst()) {
return p;
}
}
}
delete t;
-#endif
-
return p;
}