#include <jack/types.h>
#include <ardour/ladspa.h>
+#include <ardour/plugin_state.h>
#include <ardour/plugin.h>
#include <ardour/ladspa_plugin.h>
const char * maker() const { return descriptor->Maker; }
uint32_t parameter_count() const { return descriptor->PortCount; }
float default_value (uint32_t port);
- nframes_t latency() const;
+ nframes_t signal_latency() const;
void set_parameter (uint32_t port, float val);
float get_parameter (uint32_t port) const;
int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const;
- std::set<uint32_t> automatable() const;
+ std::set<Parameter> automatable() const;
uint32_t nth_parameter (uint32_t port, bool& ok) const;
void activate () {
+ if (was_activated)
+ return;
+
if (descriptor->activate) {
descriptor->activate (handle);
}
+
was_activated = true;
}
void deactivate () {
- if (descriptor->deactivate)
+ if (!was_activated)
+ return;
+
+ if (descriptor->deactivate) {
descriptor->deactivate (handle);
+ }
+
+ was_activated = false;
}
void cleanup () {
- if (was_activated && descriptor->cleanup) {
+ activate();
+ deactivate();
+
+ if (descriptor->cleanup) {
descriptor->cleanup (handle);
}
}
void set_block_size (nframes_t nframes) {}
- int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
- string describe_parameter (uint32_t);
+ int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset);
+ void store_state (ARDOUR::PluginState&);
+ void restore_state (ARDOUR::PluginState&);
+ string describe_parameter (Parameter);
string state_node_name() const { return "ladspa"; }
void print_parameter (uint32_t, char*, uint32_t len) const;
bool was_activated;
void init (void *mod, uint32_t index, nframes_t rate);
- void run (nframes_t nsamples);
+ void run_in_place (nframes_t nsamples);
void latency_compute_run ();
};