summaryrefslogtreecommitdiff
path: root/src/instrument.cc
diff options
context:
space:
mode:
authordeva <deva>2011-07-15 13:02:33 +0000
committerdeva <deva>2011-07-15 13:02:33 +0000
commitcd0e36773992e26985bdec1f7a5341f83fa3e521 (patch)
tree4710fb3f2465f4b464f5f6176261a67cfde2e46e /src/instrument.cc
parente190d38057892b69246391841b234a368bc2b4ad (diff)
New input/output plugin architecture. New LV2 plugin.
Diffstat (limited to 'src/instrument.cc')
-rw-r--r--src/instrument.cc17
1 files changed, 15 insertions, 2 deletions
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 <stdlib.h>
+#include <stdio.h>
-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<Sample*> 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)