some LV2 debug tracing

git-svn-id: svn://localhost/ardour2/branches/3.0@9078 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-03-05 23:14:39 +00:00
parent f649d775bc
commit c9e78d432f
3 changed files with 41 additions and 12 deletions

View file

@ -49,6 +49,7 @@ namespace PBD {
extern uint64_t Solo; extern uint64_t Solo;
extern uint64_t AudioPlayback; extern uint64_t AudioPlayback;
extern uint64_t Panning; extern uint64_t Panning;
extern uint64_t LV2;
} }
} }

View file

@ -25,6 +25,7 @@
#include <algorithm> #include <algorithm>
#include "ardour/buffer.h" #include "ardour/buffer.h"
#include "ardour/buffer_set.h" #include "ardour/buffer_set.h"
#include "ardour/debug.h"
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
#include "ardour/port.h" #include "ardour/port.h"
#include "ardour/port_set.h" #include "ardour/port_set.h"
@ -254,6 +255,12 @@ BufferSet::get_lv2_midi(bool input, size_t i)
for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) { for (MidiBuffer::iterator e = mbuf.begin(); e != mbuf.end(); ++e) {
const Evoral::MIDIEvent<framepos_t> ev(*e, false); const Evoral::MIDIEvent<framepos_t> ev(*e, false);
uint32_t type = LV2Plugin::midi_event_type(); 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()); ebuf->append(ev.time(), 0, type, ev.size(), ev.buffer());
} }
} }
@ -275,6 +282,12 @@ BufferSet::flush_lv2_midi(bool input, size_t i)
uint16_t size; uint16_t size;
uint8_t* data; uint8_t* data;
ebuf->get_event(&frames, &subframes, &type, &size, &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); mbuf.push_back(frames, size, data);
} }
} }

View file

@ -35,6 +35,7 @@
#include "ardour/ardour.h" #include "ardour/ardour.h"
#include "ardour/audio_buffer.h" #include "ardour/audio_buffer.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/debug.h"
#include "ardour/lv2_event_buffer.h" #include "ardour/lv2_event_buffer.h"
#include "ardour/lv2_plugin.h" #include "ardour/lv2_plugin.h"
#include "ardour/session.h" #include "ardour/session.h"
@ -89,6 +90,8 @@ LV2Plugin::LV2Plugin (const LV2Plugin &other)
void void
LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate) LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate)
{ {
DEBUG_TRACE (DEBUG::LV2, "LV2 plugin init\n");
_world = world; _world = world;
_plugin = plugin; _plugin = plugin;
_ui = NULL; _ui = NULL;
@ -200,6 +203,8 @@ LV2Plugin::init (LV2World& world, SLV2Plugin plugin, framecnt_t rate)
LV2Plugin::~LV2Plugin () LV2Plugin::~LV2Plugin ()
{ {
DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 destroy\n", name()));
deactivate (); deactivate ();
cleanup (); cleanup ();
@ -246,6 +251,8 @@ LV2Plugin::port_symbol (uint32_t index) const
void void
LV2Plugin::set_parameter (uint32_t which, float val) 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)) { if (which < slv2_plugin_get_num_ports(_plugin)) {
_shadow_data[which] = val; _shadow_data[which] = val;
} else { } else {
@ -612,6 +619,8 @@ LV2Plugin::automatable () const
void void
LV2Plugin::activate () LV2Plugin::activate ()
{ {
DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 activate\n", name()));
if (!_was_activated) { if (!_was_activated) {
slv2_instance_activate (_instance); slv2_instance_activate (_instance);
_was_activated = true; _was_activated = true;
@ -621,6 +630,8 @@ LV2Plugin::activate ()
void void
LV2Plugin::deactivate () LV2Plugin::deactivate ()
{ {
DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 deactivate\n", name()));
if (_was_activated) { if (_was_activated) {
slv2_instance_deactivate (_instance); slv2_instance_deactivate (_instance);
_was_activated = false; _was_activated = false;
@ -630,6 +641,8 @@ LV2Plugin::deactivate ()
void void
LV2Plugin::cleanup () LV2Plugin::cleanup ()
{ {
DEBUG_TRACE (DEBUG::LV2, string_compose ("%1 cleanup\n", name()));
activate (); activate ();
deactivate (); deactivate ();
slv2_instance_free (_instance); slv2_instance_free (_instance);
@ -641,6 +654,8 @@ LV2Plugin::connect_and_run (BufferSet& bufs,
ChanMapping in_map, ChanMapping out_map, ChanMapping in_map, ChanMapping out_map,
pframes_t nframes, framecnt_t offset) 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); Plugin::connect_and_run (bufs, in_map, out_map, nframes, offset);
cycles_t then = get_cycles (); cycles_t then = get_cycles ();