summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-26 15:29:27 +0800
committerrekado <rekado@elephly.net>2013-01-26 15:29:30 +0800
commit90b2b353382d3b2ea1235d2894052782f8e890d0 (patch)
treec02c387a02f816fb6ce28aec0119ec370fd34700
parent821e50aa0c2dba2fcfa46758c634585f6d70c509 (diff)
switch to LV2 Toolkit (lvtoolkit.org)
lv2-c++-tools is apparently no longer maintained. lvtk is a fork of lv2-c++-tools.
-rw-r--r--src/Makefile4
-rw-r--r--src/mdaPiano.cpp4
-rw-r--r--src/mdaPiano.h5
-rw-r--r--src/mdaPianoVoice.cpp6
-rw-r--r--src/mdaPianoVoice.h4
5 files changed, 12 insertions, 11 deletions
diff --git a/src/Makefile b/src/Makefile
index 3fea3ef..ece96d5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -11,10 +11,10 @@ $(BUNDLE): manifest.ttl mdaPiano.ttl mdaPiano.so presets data/*.raw
cp -r $^ $(BUNDLE)
mdaPiano.so: $(SOURCES) mdaPiano.peg
- $(CXX) $(FLAGS) -shared $(SOURCES) `pkg-config --cflags --libs lv2-plugin` -o $@
+ $(CXX) $(FLAGS) -shared $(SOURCES) `pkg-config --cflags --libs lvtk-plugin-1` -o $@
mdaPiano.peg: mdaPiano.ttl
- lv2peg $^ mdaPiano.peg
+ ttl2c $^ mdaPiano.peg
install: $(BUNDLE)
mkdir -p $(INSTALL_DIR)
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index 60224c0..a358988 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -20,7 +20,7 @@
#define STRING_BUF 2048
mdaPiano::mdaPiano(double rate)
- : LV2::Synth<mdaPianoVoice, mdaPiano>(p_n_ports, p_midi) {
+ : lvtk::Synth<mdaPianoVoice, mdaPiano>(p_n_ports, p_midi) {
sustain = 0;
@@ -61,7 +61,7 @@ unsigned mdaPiano::find_free_voice(unsigned char key, unsigned char velocity) {
// ... notes are sustained but not this new one
// ... notes are not sustained
for (unsigned i = 0; i < NVOICES; ++i) {
- if (voices[i]->get_key() == LV2::INVALID_KEY)
+ if (voices[i]->get_key() == lvtk::INVALID_KEY)
{
return i;
}
diff --git a/src/mdaPiano.h b/src/mdaPiano.h
index f848919..5c4475d 100644
--- a/src/mdaPiano.h
+++ b/src/mdaPiano.h
@@ -6,10 +6,11 @@
#include "mdaPiano.peg"
#pragma GCC system_header
-#include <lv2synth.hpp>
+#include <lvtk/synth.hpp>
+#include <stdio.h>
-class mdaPiano : public LV2::Synth<mdaPianoVoice, mdaPiano> {
+class mdaPiano : public lvtk::Synth<mdaPianoVoice, mdaPiano> {
public:
mdaPiano(double);
~mdaPiano() {
diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp
index ac05d01..116b5ba 100644
--- a/src/mdaPianoVoice.cpp
+++ b/src/mdaPianoVoice.cpp
@@ -96,7 +96,7 @@ void mdaPianoVoice::reset() {
volume = 0.2f;
sustain = 0;
cpos = 0;
- m_key = LV2::INVALID_KEY;
+ m_key = lvtk::INVALID_KEY;
}
@@ -121,7 +121,7 @@ void mdaPianoVoice::release(unsigned char velocity) {
void mdaPianoVoice::render(uint32_t from, uint32_t to) {
// abort if no key is pressed
// initially m_key is INVALID_KEY, so no sound will be rendered
- if (m_key == LV2::INVALID_KEY)
+ if (m_key == lvtk::INVALID_KEY)
return;
float x, l, r;
@@ -159,7 +159,7 @@ void mdaPianoVoice::render(uint32_t from, uint32_t to) {
// turn off further processing when the envelope has rendered the voice silent
if (env < SILENCE) {
- m_key = LV2::INVALID_KEY;
+ m_key = lvtk::INVALID_KEY;
}
}
diff --git a/src/mdaPianoVoice.h b/src/mdaPianoVoice.h
index efc2344..16cc738 100644
--- a/src/mdaPianoVoice.h
+++ b/src/mdaPianoVoice.h
@@ -5,14 +5,14 @@
#include "mdaPiano.peg"
#pragma GCC system_header
-#include <lv2synth.hpp>
+#include <lvtk/synth.hpp>
enum Param {
Default,
Current
};
-class mdaPianoVoice : public LV2::Voice {
+class mdaPianoVoice : public lvtk::Voice {
private:
float Fs, iFs;