diff options
| author | Chris Kiefer <chrisk13fer@gmail.com> | 2012-01-18 15:11:24 +0000 |
|---|---|---|
| committer | Chris Kiefer <chrisk13fer@gmail.com> | 2012-01-18 15:11:24 +0000 |
| commit | 9f88ea80f331783c3776e9f8391e51d64ddbbef3 (patch) | |
| tree | 55103e9d6f93208956c7651ab937a289ccc57f8e | |
| parent | 044dd2e4569fc844eb9af8b6d1c1f4edc6c3af75 (diff) | |
Fixing linux compilation issues
| -rw-r--r-- | ofxMaxim/ofxMaxim/libs/maximilian.cpp | 5 | ||||
| -rwxr-xr-x | ofxMaxim/ofxMaxim/libs/maximilian.h | 11 |
2 files changed, 3 insertions, 13 deletions
diff --git a/ofxMaxim/ofxMaxim/libs/maximilian.cpp b/ofxMaxim/ofxMaxim/libs/maximilian.cpp index f19303a..dd72f4f 100644 --- a/ofxMaxim/ofxMaxim/libs/maximilian.cpp +++ b/ofxMaxim/ofxMaxim/libs/maximilian.cpp @@ -445,10 +445,9 @@ double maxiSample::play() { double maxiSample::playOnce() { // long length=myDataSize*(0.5/myChannels); - double remainder; short* buffer = (short *)myData; position=(position+1); - remainder = position - (long) position; + double remainder = position - (long) position; if ((long) position<length) output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation else @@ -458,11 +457,11 @@ double maxiSample::playOnce() { } double maxiSample::playOnce(double speed) { - double remainder; //long a,b; // long length=myDataSize*0.5; short* buffer = (short *)myData; position=position+((speed*chandiv*myChannels)/(maxiSettings::sampleRate/mySampleRate)); + double remainder = position - (long) position; if ((long) position<length) output = (double) ((1-remainder) * buffer[1+ (long) position] + remainder * buffer[2+(long) position])/32767;//linear interpolation else diff --git a/ofxMaxim/ofxMaxim/libs/maximilian.h b/ofxMaxim/ofxMaxim/libs/maximilian.h index 0a3b95a..06470b6 100755 --- a/ofxMaxim/ofxMaxim/libs/maximilian.h +++ b/ofxMaxim/ofxMaxim/libs/maximilian.h @@ -42,7 +42,7 @@ #include <iostream> #include <fstream> -#include <string> +#include <string.h> #include <cstdlib> #include "math.h" @@ -197,15 +197,6 @@ public: ~maxiSample() { if (myData) delete[] myData; - myChunkSize = NULL; - mySubChunk1Size = NULL; - myFormat = NULL; - myChannels = NULL; - mySampleRate = NULL; - myByteRate = NULL; - myBlockAlign = NULL; - myBitsPerSample = NULL; - myDataSize = NULL; } maxiSample():myData(NULL),position(0){}; |
