summaryrefslogtreecommitdiff
path: root/rotord/vampHost.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-05-23 16:00:24 +0100
committerTim Redfern <tim@eclectronics.org>2013-05-23 16:00:24 +0100
commitb643511ff513aadbd0485afc6b264702aac41021 (patch)
tree1aad48b38f8aa7c4eb0b7aacac69b23e794f4510 /rotord/vampHost.cpp
parent55513473ca37841b40662e1a0221d7dd260a59b7 (diff)
portability
Diffstat (limited to 'rotord/vampHost.cpp')
-rw-r--r--rotord/vampHost.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/rotord/vampHost.cpp b/rotord/vampHost.cpp
index 14a9b35..70a0c63 100644
--- a/rotord/vampHost.cpp
+++ b/rotord/vampHost.cpp
@@ -694,6 +694,12 @@ bool vampHost::Analyser::init(const string &soname,const string &id,const int &_
od = outputs[outputNo];
cerr << "Output number "<<outputNo<<": \"" << od.identifier << "\"" << endl;
+
+ for (auto i:params){
+ plugin->setParameter(i.first,i.second);
+ cerr << "Set plugin parameter: "<<i.first<<" : "<<i.second<<endl;
+ }
+
if (!plugin->initialise(channels, stepSize, blockSize)) {
cerr << "ERROR: Plugin initialise (channels = " << channels
<< ", stepSize = " << stepSize << ", blockSize = "
@@ -722,16 +728,17 @@ bool vampHost::Analyser::init(const string &soname,const string &id,const int &_
void vampHost::Analyser::process_frame(uint8_t *data,int samples_in_frame){
int sample=0;
+ uint16_t *_data=(uint16_t*)data;
//process the whole frame which may be f>1<f blocks
//when the frame is finished leave the partial block for the next frame
while(sample<samples_in_frame) {
while(sample<samples_in_frame&&in_block<blockSize) {
for (int i=0;i<channels;i++) {
- unsigned int this_val=0;
- for (int j=0;j<bytes;j++) {
- this_val+=data[(sample*stride)+(i*bytes)+j]<<(j*8);
- }
- plugbuf[i][in_block]=((float)((int16_t)this_val))*scale;
+ //unsigned int this_val=0;
+ // this_val+=data[(sample*stride)+(i*bytes)+j]<<((1-j)*8);
+ //}
+ //plugbuf[i][in_block]=((float)((int16_t)this_val))*scale;
+ plugbuf[i][in_block]=((float)_data[sample])*scale;
}
in_block++;
sample++;