summaryrefslogtreecommitdiff
path: root/distrho/src/DistrhoPluginLV2.cpp
diff options
context:
space:
mode:
authorgrejppi <grejppi@users.noreply.github.com>2018-01-07 20:18:07 +0200
committerFilipe Coelho <falktx@falktx.com>2018-01-07 19:18:07 +0100
commit86bd8079cd3bd665d75edbb986d0c9dbecb1570d (patch)
treeac0a1844f8576cc9fd1032fc6c04f515d4165de2 /distrho/src/DistrhoPluginLV2.cpp
parentd6d1d3b55c2737a9a0c13f69ee76238917ad62e3 (diff)
Explicitly state supported LV2 options & use param:sampleRate (#29)
* Explicitly state supported options and use the correct sampleRate * Accept lv2:sampleRate too just in case * Typo * Style fix * Remove lv2:sampleRate * Remove unnecessary newlines * Missing semicolon
Diffstat (limited to 'distrho/src/DistrhoPluginLV2.cpp')
-rw-r--r--distrho/src/DistrhoPluginLV2.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/distrho/src/DistrhoPluginLV2.cpp b/distrho/src/DistrhoPluginLV2.cpp
index cd76bffe..35ede034 100644
--- a/distrho/src/DistrhoPluginLV2.cpp
+++ b/distrho/src/DistrhoPluginLV2.cpp
@@ -23,6 +23,7 @@
#include "lv2/instance-access.h"
#include "lv2/midi.h"
#include "lv2/options.h"
+#include "lv2/parameters.h"
#include "lv2/state.h"
#include "lv2/time.h"
#include "lv2/urid.h"
@@ -685,7 +686,7 @@ public:
{
if (options[i].type == fURIDs.atomInt)
{
- const int bufferSize(*(const int*)options[i].value);
+ const int32_t bufferSize(*(const int32_t*)options[i].value);
fPlugin.setBufferSize(bufferSize);
}
else
@@ -697,7 +698,7 @@ public:
{
if (options[i].type == fURIDs.atomInt)
{
- const int bufferSize(*(const int*)options[i].value);
+ const int32_t bufferSize(*(const int32_t*)options[i].value);
fPlugin.setBufferSize(bufferSize);
}
else
@@ -705,11 +706,11 @@ public:
d_stderr("Host changed maxBlockLength but with wrong value type");
}
}
- else if (options[i].key == fUridMap->map(fUridMap->handle, LV2_CORE__sampleRate))
+ else if (options[i].key == fUridMap->map(fUridMap->handle, LV2_PARAMETERS__sampleRate))
{
- if (options[i].type == fURIDs.atomDouble)
+ if (options[i].type == fURIDs.atomFloat)
{
- const double sampleRate(*(const double*)options[i].value);
+ const float sampleRate(*(const float*)options[i].value);
fSampleRate = sampleRate;
fPlugin.setSampleRate(sampleRate);
}