remove all use of NO_PLUGIN_STATE #ifdef
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 29 Sep 2019 16:00:23 +0000 (10:00 -0600)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 3 Oct 2019 00:04:40 +0000 (18:04 -0600)
We determined several years that we should never ever do this,
and changed the basis for the free/demo copy because of that.

12 files changed:
gtk2_ardour/ardour_ui_startup.cc
gtk2_ardour/plugin_ui.cc
libs/ardour/audio_unit.cc
libs/ardour/ladspa_plugin.cc
libs/ardour/luaproc.cc
libs/ardour/lv2_plugin.cc
libs/ardour/lxvst_plugin.cc
libs/ardour/mac_vst_plugin.cc
libs/ardour/plugin.cc
libs/ardour/plugin_insert.cc
libs/ardour/vst_plugin.cc
libs/ardour/windows_vst_plugin.cc

index e9875e93387050e9c2d31b7822ea441f417f29f7..8e97cd5a98820218110305035f64efa2fd26aecd 100644 (file)
@@ -551,50 +551,6 @@ ARDOUR_UI::starting ()
                        }
                }
 
-#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));
index c60214c5a490c3d2e4cbf5c9a1b52c5269bce7ec..a5962c140f465791bcb6020e36873c480977ad01 100644 (file)
@@ -633,27 +633,9 @@ PlugUIBase::preset_selected (Plugin::PresetRecord preset)
        }
 }
 
-#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 ()) {
@@ -672,43 +654,23 @@ PlugUIBase::add_plugin_setting ()
                }
                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
index a1afd5ecee3b7f8b82126e54242d5f84986bb4f5..cf268a04033c80291f4c0d66495f5757d87573a0 100644 (file)
@@ -2061,7 +2061,6 @@ AUPlugin::set_state(const XMLNode& node, int version)
                return -1;
        }
 
-#ifndef NO_PLUGIN_STATE
        if (node.children().empty()) {
                return -1;
        }
@@ -2097,7 +2096,6 @@ AUPlugin::set_state(const XMLNode& node, int version)
                }
                CFRelease (propertyList);
        }
-#endif
 
        Plugin::set_state (node, version);
        return ret;
@@ -2593,7 +2591,7 @@ AUPluginInfo::get_presets (bool user_only) const
 {
        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()) {
@@ -2664,7 +2662,6 @@ AUPluginInfo::get_presets (bool user_only) const
        CFRelease (presets);
        unit->Uninitialize ();
 
-#endif // NO_PLUGIN_STATE
        return p;
 }
 
index bcd0937513f4460c49e824c696aa732264d09b04..e1f43b54a1292ecc4fa6c3af6f901362c0444a04 100644 (file)
@@ -375,19 +375,15 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
                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) {
@@ -409,7 +405,6 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
 
                set_parameter (port_id, value);
        }
-#endif
 
        latency_compute_run ();
 
@@ -419,7 +414,6 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
 int
 LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
 {
-#ifndef NO_PLUGIN_STATE
        XMLNodeList nodes;
        XMLProperty const * prop;
        XMLNodeConstIterator iter;
@@ -427,7 +421,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
        const char *port;
        const char *data;
        uint32_t port_id;
-#endif
        LocaleGuard lg;
 
        if (node.name() != state_node_name()) {
@@ -435,7 +428,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
                return -1;
        }
 
-#ifndef NO_PLUGIN_STATE
        nodes = node.children ("port");
 
        for(iter = nodes.begin(); iter != nodes.end(); ++iter){
@@ -460,7 +452,6 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
        }
 
        latency_compute_run ();
-#endif
 
        return 0;
 }
@@ -721,7 +712,7 @@ std::vector<Plugin::PresetRecord>
 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;
        }
index 59409e097ee10ed5185d26177f5772e7b500478c..64c7ca6c7cf5cb5b7352957bb0ace4506c3f78a1 100644 (file)
@@ -848,11 +848,9 @@ LuaProc::set_script_from_state (const XMLNode& node)
 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)) {
@@ -860,7 +858,6 @@ LuaProc::set_state (const XMLNode& node, int version)
                }
        }
 
-#ifndef NO_PLUGIN_STATE
        if (node.name() != state_node_name()) {
                error << _("Bad node sent to LuaProc::set_state") << endmsg;
                return -1;
@@ -885,7 +882,6 @@ LuaProc::set_state (const XMLNode& node, int version)
 
                set_parameter (port_id, value);
        }
-#endif
 
        return Plugin::set_state (node, version);
 }
index fca7bbcf13b2cb4bc0c6738d74204976280e045b..5da1895d6160f4c122f4416c85e450f112cb49a7 100644 (file)
@@ -2128,8 +2128,6 @@ LV2Plugin::set_state(const XMLNode& node, int version)
                return -1;
        }
 
-#ifndef NO_PLUGIN_STATE
-
        if (version < 3000) {
                nodes = node.children("port");
        } else {
@@ -2210,7 +2208,6 @@ LV2Plugin::set_state(const XMLNode& node, int version)
        if (_session.loading ()) {
                latency_compute_run();
        }
-#endif
 
        return Plugin::set_state(node, version);
 }
@@ -3425,7 +3422,7 @@ std::vector<Plugin::PresetRecord>
 LV2PluginInfo::get_presets (bool /*user_only*/) const
 {
        std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
        const LilvPlugin* lp = NULL;
        try {
                PluginPtr plugin;
@@ -3468,7 +3465,7 @@ LV2PluginInfo::get_presets (bool /*user_only*/) const
        lilv_node_free(rdfs_label);
        lilv_node_free(pset_Preset);
        lilv_node_free(lv2_appliesTo);
-#endif
+
        return p;
 }
 
index 78afc55c234311cbb97ac43b4868169205db1140..432bff37c23c5d60ac9b448c8b7f82f806dc6530 100644 (file)
@@ -108,7 +108,7 @@ std::vector<Plugin::PresetRecord>
 LXVSTPluginInfo::get_presets (bool user_only) const
 {
        std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
        if (!Config->get_use_lxvst()) {
                return p;
        }
@@ -163,9 +163,8 @@ LXVSTPluginInfo::get_presets (bool user_only) const
                        }
                }
        }
-       delete t;
-#endif
 
+       delete t;
        return p;
 }
 
index c62b76af5aae9998607d941cb04a9883d822808d..9057f324b1a16cb40d6ad8b49900f880bde05afc 100644 (file)
@@ -113,7 +113,7 @@ std::vector<Plugin::PresetRecord>
 MacVSTPluginInfo::get_presets (bool user_only) const
 {
        std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
        if (!Config->get_use_macvst ()) {
                return p;
        }
@@ -169,8 +169,6 @@ MacVSTPluginInfo::get_presets (bool user_only) const
                }
        }
        delete t;
-#endif
-
        return p;
 }
 
index 970959cd850f5614dfeaa5abfaafc30fef5fd28e..4bb983ee8260693fa85beb4eb2a0f05528208202 100644 (file)
@@ -80,11 +80,6 @@ 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
-
 PBD::Signal2<void, std::string, Plugin*> Plugin::PresetsChanged;
 
 bool
@@ -321,12 +316,11 @@ Plugin::possible_output () const
 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) {
@@ -340,12 +334,11 @@ Plugin::preset_by_label (const string& 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;
@@ -425,7 +418,6 @@ Plugin::get_presets ()
 {
        vector<PresetRecord> p;
 
-#ifndef NO_PLUGIN_STATE
        if (!_have_presets) {
                find_presets ();
                _have_presets = true;
@@ -434,14 +426,6 @@ Plugin::get_presets ()
        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;
 }
@@ -511,16 +495,7 @@ Plugin::get_state ()
        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;
 }
index edb48e7813715add9e3a595150b618eb9bfb0197..5ced715cd4dc4f71997d353cd2fdca5f8de80970 100644 (file)
@@ -2507,7 +2507,6 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
                /* 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;
                }
@@ -2515,7 +2514,6 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
                if (ac) {
                        ac->set_state (**iter, version);
                }
-#endif
        }
 }
 
index f1f69ebc8f37547b902f0b75bfd9aea2d79b1dde..ebce493d4c7556b757b1431b768791238b1050a0 100644 (file)
@@ -314,8 +314,6 @@ VSTPlugin::set_state (const XMLNode& node, int version)
 {
        LocaleGuard lg;
        int ret = -1;
-
-#ifndef NO_PLUGIN_STATE
        XMLNode* child;
 
        if ((child = find_named_node (node, X_("chunk"))) != 0) {
@@ -353,7 +351,6 @@ VSTPlugin::set_state (const XMLNode& node, int version)
                ret = 0;
 
        }
-#endif
 
        Plugin::set_state (node, version);
        return ret;
index dfef082be7307992e13e3c5f7ba448fe254ed63d..3d1e06c72ee01d6ef8dbfb362be99a4e5f685285 100644 (file)
@@ -106,7 +106,7 @@ std::vector<Plugin::PresetRecord>
 WindowsVSTPluginInfo::get_presets (bool user_only) const
 {
        std::vector<Plugin::PresetRecord> p;
-#ifndef NO_PLUGIN_STATE
+
        if (!Config->get_use_lxvst()) {
                return p;
        }
@@ -130,8 +130,6 @@ WindowsVSTPluginInfo::get_presets (bool user_only) const
                }
        }
        delete t;
-#endif
-
        return p;
 }