From cd0e36773992e26985bdec1f7a5341f83fa3e521 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 15 Jul 2011 13:02:33 +0000 Subject: New input/output plugin architecture. New LV2 plugin. --- src/instrument.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/instrument.cc') diff --git a/src/instrument.cc b/src/instrument.cc index b710757..1b3c31a 100644 --- a/src/instrument.cc +++ b/src/instrument.cc @@ -27,14 +27,17 @@ #include "instrument.h" #include +#include -Instrument::Instrument(std::string name) +#include "sample.h" + +Instrument::Instrument() { - this->name = name; } Sample *Instrument::sample(level_t level) { + // printf("Find level %f\n", level); std::vector s = samples.get(level); if(s.size() == 0) return NULL; size_t idx = rand()%(s.size()); @@ -46,6 +49,16 @@ void Instrument::addSample(level_t a, level_t b, Sample *s) samples.insert(a, b, s); } +std::string Instrument::name() +{ + return _name; +} + +std::string Instrument::description() +{ + return _description; +} + #ifdef TEST_INSTRUMENT //deps: channel.cc sample.cc audiofile.cc //cflags: $(SNDFILE_CFLAGS) -- cgit v1.2.3