Fix building without LV2.

git-svn-id: svn://localhost/ardour2/branches/3.0@5041 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-05-04 20:11:02 +00:00
parent da8cf83b72
commit 3a6fa245c2
5 changed files with 19 additions and 8 deletions

View File

@ -176,7 +176,7 @@ version.cc
arch_specific_objects = [ ]
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
lv2_files = [ 'lv2_plugin.cc' ]
lv2_files = [ 'lv2_plugin.cc', 'lv2_event_buffer.cc', 'uri_map.cc' ]
audiounit_files = [ 'audio_unit.cc' ]
coreaudio_files = [ 'coreaudiosource.cc', 'caimportable.cc' ]
extra_sources = [ ]

View File

@ -31,7 +31,9 @@ class Buffer;
class AudioBuffer;
class MidiBuffer;
class PortSet;
#ifdef HAVE_SLV2
class LV2EventBuffer;
#endif
/** A set of buffers of various types.
*
@ -78,6 +80,7 @@ public:
return (MidiBuffer&)get(DataType::MIDI, i);
}
#ifdef HAVE_SLV2
/** Get a MIDI buffer translated into an LV2 MIDI buffer for use with plugins.
* The index here corresponds directly to MIDI buffer numbers (i.e. the index
* passed to get_midi), translation back and forth will happen as needed */
@ -85,6 +88,7 @@ public:
/** Flush modified LV2 event output buffers back to Ardour buffers */
void flush_lv2_midi(bool input, size_t i);
#endif
void read_from(BufferSet& in, nframes_t nframes);
@ -143,10 +147,11 @@ private:
/// Vector of vectors, indexed by DataType
std::vector<BufferVec> _buffers;
#ifdef HAVE_SLV2
/// LV2 MIDI buffers (for conversion to/from MIDI buffers)
//
typedef std::vector< std::pair<bool, LV2EventBuffer*> > LV2Buffers;
LV2Buffers _lv2_buffers;
#endif
/// Use counts (there may be more actual buffers than this)
ChanCount _count;

View File

@ -20,12 +20,14 @@
#include <algorithm>
#include "ardour/buffer.h"
#include "ardour/buffer_set.h"
#include "ardour/lv2_event_buffer.h"
#include "ardour/lv2_plugin.h"
#include "ardour/midi_buffer.h"
#include "ardour/port.h"
#include "ardour/port_set.h"
#include "ardour/audioengine.h"
#ifdef HAVE_SLV2
#include "ardour/lv2_plugin.h"
#include "ardour/lv2_event_buffer.h"
#endif
namespace ARDOUR {
@ -127,6 +129,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
_available.set(type, num_buffers);
}
#ifdef HAVE_SLV2
// Ensure enough low level MIDI format buffers are available for conversion
// in both directions (input & output, out-of-place)
if (type == DataType::MIDI && _lv2_buffers.size() < _buffers[type].size() * 2) {
@ -134,6 +137,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
_lv2_buffers.push_back(std::make_pair(false, new LV2EventBuffer(buffer_capacity)));
}
}
#endif
// Post-conditions
assert(bufs[0]->type() == type);
@ -160,6 +164,8 @@ BufferSet::get(DataType type, size_t i)
return *_buffers[type][i];
}
#ifdef HAVE_SLV2
LV2EventBuffer&
BufferSet::get_lv2_midi(bool input, size_t i)
{
@ -197,6 +203,8 @@ BufferSet::flush_lv2_midi(bool input, size_t i)
}
}
#endif
// FIXME: make 'in' const
void
BufferSet::read_from (BufferSet& in, nframes_t nframes)

View File

@ -20,9 +20,9 @@
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#include <iostream>
#include "ardour/lv2_event_buffer.h"
#include "lv2ext/lv2_event.h"
#include "lv2ext/lv2_event_helpers.h"
#include "ardour/lv2_event_buffer.h"
using namespace std;

View File

@ -139,7 +139,6 @@ def build(bld):
ladspa_plugin.cc
location.cc
location_importer.cc
lv2_event_buffer.cc
meter.cc
midi_buffer.cc
midi_clock_slave.cc
@ -210,7 +209,6 @@ def build(bld):
transient_detector.cc
user_bundle.cc
utils.cc
uri_map.cc
version.cc
'''
obj.export_incdirs = ['.']
@ -234,7 +232,7 @@ def build(bld):
#obj.source += ' st_stretch.cc st_pitch.cc '
#obj.uselib += ' SOUNDTOUCH '
if bld.env['HAVE_SLV2']:
obj.source += ' lv2_plugin.cc'
obj.source += ' lv2_plugin.cc lv2_event_buffer.cc uri_map.cc '
obj.uselib += ' LRDF SLV2'
obj.cxxflags += ['-DHAVE_SLV2']