aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormick <mickgrierson@gmail.com>2012-06-14 10:17:17 +0100
committermick <mickgrierson@gmail.com>2012-06-14 10:17:17 +0100
commitafd1253433731e696c4bc1551961f9652de7af8e (patch)
tree791918993e6b4ee9cd963b5deba121e9e80a3850
parent62b43e8f32af364cbc8e46fffed2854c27533acc (diff)
HugoYu's github issue #4 "Example's Bug On Win32 Platform" fixed. Thanks HugoYu!
-rwxr-xr-xmain.cpp6
-rw-r--r--maximilian.cpp6
-rwxr-xr-xmaximilian.h5
-rw-r--r--maximilianTest.xcodeproj/project.xcworkspace/xcuserdata/mickgrierson.xcuserdatad/UserInterfaceState.xcuserstatebin39566 -> 39835 bytes
4 files changed, 9 insertions, 8 deletions
diff --git a/main.cpp b/main.cpp
index e1a782e..6448fce 100755
--- a/main.cpp
+++ b/main.cpp
@@ -6,7 +6,7 @@ void setup() {//some inits
// beats.loadOgg("/Users/mickgrierson/Documents/workspace/vorbis_test/ogg_test/thingy2.ogg");//load in your samples. Provide the full path to a wav file.
- beats.load("/Users/mickgrierson/Documents/workspace/vorbis_test/ogg_test/thingy.wav");//load in your samples. Provide the full path to a wav file.
+// beats.load("/Users/mickgrierson/Documents/workspace/vorbis_test/ogg_test/thingy.wav");//load in your samples. Provide the full path to a wav file.
printf("Summary:\n%s", beats.getSummary());//get info on samples if you like.
@@ -14,8 +14,8 @@ void setup() {//some inits
void play(double *output) {//this is where the magic happens. Very slow magic.
- output[0]=beats.play();//just play the file. Looping is default for all play functions.
-// output[0]=beats.play(1.0);//play the file with a speed setting. 1. is normal speed.
+// output[0]=beats.play();//just play the file. Looping is default for all play functions.
+ output[0]=beats.play(0.5);//play the file with a speed setting. 1. is normal speed.
// *output=beats.play(0.5,0,44100);//linear interpolationplay with a frequency input, start point and end point. Useful for syncing.
// *output=beats.play4(0.5,0,100000);//cubic interpolation play with a frequency input, start point and end point. Useful for syncing.
diff --git a/maximilian.cpp b/maximilian.cpp
index 62cf1a7..4407de2 100644
--- a/maximilian.cpp
+++ b/maximilian.cpp
@@ -39,7 +39,7 @@
* loadOgg() method.
* Uncomment the following to include Sean Barrett's Ogg Vorbis decoder.*/
-//#define VORBIS
+#define VORBIS
#ifdef VORBIS
#include "stb_vorbis.h"
@@ -466,8 +466,8 @@ bool maxiSample::read()
}
}
temp = (short*) malloc(myDataSize * sizeof(char));
-
- temp=(short*)myData;
+// temp=(short*)myData;
+ memcpy(temp, myData, myDataSize * sizeof(char));
}else {
// cout << "ERROR: Could not load sample: " <<myPath << endl; //This line seems to be hated by windows
diff --git a/maximilian.h b/maximilian.h
index 50f91fc..fd64b80 100755
--- a/maximilian.h
+++ b/maximilian.h
@@ -190,8 +190,9 @@ public:
~maxiSample()
{
- if (myData) delete[] myData;
- if (temp) delete[] temp;
+ if (myData) free(myData);
+ if (temp) free(temp);
+ printf("freeing SampleData");
}
diff --git a/maximilianTest.xcodeproj/project.xcworkspace/xcuserdata/mickgrierson.xcuserdatad/UserInterfaceState.xcuserstate b/maximilianTest.xcodeproj/project.xcworkspace/xcuserdata/mickgrierson.xcuserdatad/UserInterfaceState.xcuserstate
index 5e61903..7a16b49 100644
--- a/maximilianTest.xcodeproj/project.xcworkspace/xcuserdata/mickgrierson.xcuserdatad/UserInterfaceState.xcuserstate
+++ b/maximilianTest.xcodeproj/project.xcworkspace/xcuserdata/mickgrierson.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ