#include <algorithm>
#include "ardour/buffer.h"
#include "ardour/buffer_set.h"
+#include "ardour/debug.h"
#include "ardour/midi_buffer.h"
#include "ardour/port.h"
#include "ardour/port_set.h"
for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
const Evoral::MIDIEvent<framepos_t> ev(*e, false);
uint32_t type = LV2Plugin::midi_event_type();
+#ifndef NDEBUG
+ DEBUG_TRACE (PBD::DEBUG::LV2, string_compose ("(FLUSH) MIDI event of size %1\n", ev.size()));
+ for (uint16_t x = 0; x < ev.size(); ++x) {
+ DEBUG_TRACE (PBD::DEBUG::LV2, string_compose ("\tByte[%1] = %2\n", x, (int) ev.buffer()[x]));
+ }
+#endif
ebuf->append(ev.time(), 0, type, ev.size(), ev.buffer());
}
}
uint16_t size;
uint8_t* data;
ebuf->get_event(&frames, &subframes, &type, &size, &data);
+#ifndef NDEBUG
+ DEBUG_TRACE (PBD::DEBUG::LV2, string_compose ("(FLUSH) MIDI event of size %1\n", size));
+ for (uint16_t x = 0; x < size; ++x) {
+ DEBUG_TRACE (PBD::DEBUG::LV2, string_compose ("\tByte[%1] = %2\n", x, (int) data[x]));
+ }
+#endif
mbuf.push_back(frames, size, data);
}
}
#include "ardour/ardour.h"
#include "ardour/audio_buffer.h"
#include "ardour/audioengine.h"
+#include "ardour/debug.h"
#include "ardour/lv2_event_buffer.h"
#include "ardour/lv2_plugin.h"
#include "ardour/session.h"
void
LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate)
{
+ DEBUG_TRACE (DEBUG::LV2, "LV2 plugin init\n");
+
_world = world;
_plugin = plugin;
_ui = NULL;
LV2Plugin::~LV2Plugin ()
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 destroy\n", name()));
+
deactivate ();
cleanup ();
void
LV2Plugin::set_parameter (uint32_t which, float val)
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 set parameter %2 to %3\n", name(), which, val));
+
if (which < slv2_plugin_get_num_ports(_plugin)) {
_shadow_data[which] = val;
} else {
SLV2Value def, min, max;
slv2_port_get_range(_plugin, port, &def, &min, &max);
- desc.integer_step = slv2_port_has_property(_plugin, port, _world.integer);
- desc.toggled = slv2_port_has_property(_plugin, port, _world.toggled);
- desc.logarithmic = slv2_port_has_property(_plugin, port, _world.logarithmic);
- desc.sr_dependent = slv2_port_has_property(_plugin, port, _world.srate);
- desc.label = slv2_value_as_string(slv2_port_get_name(_plugin, port));
- desc.lower = min ? slv2_value_as_float(min) : 0.0f;
- desc.upper = max ? slv2_value_as_float(max) : 1.0f;
- desc.min_unbound = false; // TODO: LV2 extension required
- desc.max_unbound = false; // TODO: LV2 extension required
-
+ desc.integer_step = slv2_port_has_property(_plugin, port, _world.integer);
+ desc.toggled = slv2_port_has_property(_plugin, port, _world.toggled);
+ desc.logarithmic = slv2_port_has_property(_plugin, port, _world.logarithmic);
+ desc.sr_dependent = slv2_port_has_property(_plugin, port, _world.srate);
+ desc.label = slv2_value_as_string(slv2_port_get_name(_plugin, port));
+ desc.lower = min ? slv2_value_as_float(min) : 0.0f;
+ desc.upper = max ? slv2_value_as_float(max) : 1.0f;
+ desc.min_unbound = false; // TODO: LV2 extension required
+ desc.max_unbound = false; // TODO: LV2 extension required
+
if (desc.integer_step) {
desc.step = 1.0;
desc.smallstep = 0.1;
void
LV2Plugin::activate ()
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 activate\n", name()));
+
if (!_was_activated) {
slv2_instance_activate (_instance);
_was_activated = true;
void
LV2Plugin::deactivate ()
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 deactivate\n", name()));
+
if (_was_activated) {
slv2_instance_deactivate (_instance);
_was_activated = false;
void
LV2Plugin::cleanup ()
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 cleanup\n", name()));
+
activate ();
deactivate ();
slv2_instance_free (_instance);
int
LV2Plugin::connect_and_run (BufferSet& bufs,
- ChanMapping in_map, ChanMapping out_map,
- pframes_t nframes, framecnt_t offset)
+ ChanMapping in_map, ChanMapping out_map,
+ pframes_t nframes, framecnt_t offset)
{
+ DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 run %2 offset %3\n", name(), nframes, offset));
+
Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset);
cycles_t then = get_cycles ();