X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fplugin.cc;h=11d859ed8c81fe3558d5effcd200dfb5781b0e1f;hb=456fb789d3adcdb52de3abd863c1bf64c973effa;hp=8cdbf98b899258502dc616042f7b51993ff9d328;hpb=1df227424a651f3835f2e13b0cee7baa69d470ee;p=ardour.git diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index 8cdbf98b89..11d859ed8c 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -27,12 +27,16 @@ #include #include // so libraptor doesn't complain #include +#ifndef COMPILER_MSVC #include +#endif #include #include #include +#ifdef HAVE_LRDF #include +#endif #include "pbd/compose.h" #include "pbd/error.h" @@ -68,6 +72,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 { @@ -256,9 +265,8 @@ Plugin::connect_and_run (BufferSet& bufs, /* Track notes that we are sending to the plugin */ MidiBuffer& b = bufs.get_midi (0); - bool looped; - _tracker.track (b.begin(), b.end(), looped); + _tracker.track (b.begin(), b.end()); if (_have_pending_stop_events) { /* Transmit note-offs that are pending from the last transport stop */ @@ -300,18 +308,28 @@ Plugin::resolve_midi () _have_pending_stop_events = true; } + vector Plugin::get_presets () { + vector p; + +#ifndef NO_PLUGIN_STATE if (!_have_presets) { find_presets (); _have_presets = true; } - vector p; for (map::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; } @@ -339,11 +357,11 @@ Plugin::clear_preset () /** @param val `plugin' value */ void -Plugin::set_parameter (uint32_t which, float val) +Plugin::set_parameter (uint32_t which, float) { _parameter_changed_since_last_preset = true; _session.set_dirty (); - ParameterChanged (which, val); /* EMIT SIGNAL */ + ParameterChanged (which, get_parameter (which)); /* EMIT SIGNAL */ } int @@ -377,7 +395,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 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; }