Save LV2 presets with relative URIs to their own bundle, in the same style as Jalv.
[ardour.git] / libs / ardour / plugin.cc
index cbcf9f7f7cad1675a93e7de1b54b89084c73163a..57198475d72f9ad81d355924e91a19da7acd4ea5 100644 (file)
 #include "pbd/error.h"
 #include "pbd/xml++.h"
 
-#include "ardour/ardour.h"
-#include "ardour/session.h"
-#include "ardour/audioengine.h"
+#include "ardour/buffer_set.h"
+#include "ardour/chan_count.h"
+#include "ardour/chan_mapping.h"
+#include "ardour/data_type.h"
+#include "ardour/midi_buffer.h"
+#include "ardour/midi_state_tracker.h"
 #include "ardour/plugin.h"
-#include "ardour/ladspa_plugin.h"
 #include "ardour/plugin_manager.h"
+#include "ardour/session.h"
+#include "ardour/types.h"
 
 #ifdef AUDIOUNIT_SUPPORT
 #include "ardour/audio_unit.h"
@@ -62,6 +66,8 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
+namespace ARDOUR { class AudioEngine; }
+
 bool
 PluginInfo::is_instrument () const
 {
@@ -250,9 +256,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 */
@@ -321,13 +326,23 @@ Plugin::load_preset (PresetRecord r)
        return true;
 }
 
+void
+Plugin::clear_preset ()
+{
+       _last_preset.uri = "";
+       _last_preset.label = "";
+       _parameter_changed_since_last_preset = false;
+
+       PresetLoaded (); /* EMIT SIGNAL */
+}
+
 /** @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