diff core/default_libpd_render.cpp @ 476:838a4a4a8580 prerelease

Removed warnings, now libpd_render can compile with Clang as well
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 20 Jun 2016 21:20:28 +0100
parents efc9a9f8e63d
children 4ff80956c27a
line wrap: on
line diff
--- a/core/default_libpd_render.cpp	Mon Jun 20 20:39:00 2016 +0100
+++ b/core/default_libpd_render.cpp	Mon Jun 20 21:20:28 2016 +0100
@@ -126,16 +126,19 @@
 static unsigned int gLibpdBlockSize;
 // 2 audio + (up to)8 analog + (up to) 16 digital + 4 scope outputs
 static const unsigned int gChannelsInUse = 30;
-static const unsigned int gFirstAudioChannel = 0;
+//static const unsigned int gFirstAudioChannel = 0;
 static const unsigned int gFirstAnalogChannel = 2;
 static const unsigned int gFirstDigitalChannel = 10;
 static const unsigned int gFirstScopeChannel = 26;
 
 Scope scope;
 unsigned int gScopeChannels = 4;
+float* gScopeOut;
+
 bool setup(BelaContext *context, void *userData)
 {
     scope.setup(gScopeChannels, context->audioSampleRate);
+    gScopeOut = new float[gScopeChannels];
 
 	// Check first of all if file exists. Will actually open it later.
 	char file[] = "_main.pd";
@@ -385,11 +388,10 @@
 		}
 		//scope
 		for (j = 0, p0 = gOutBuf; j < gLibpdBlockSize; ++j, ++p0) {
-			float scopeOut[gScopeChannels]={0};
 			for (k = 0, p1 = p0  + gLibpdBlockSize * gFirstScopeChannel; k < gScopeChannels; k++, p1 += gLibpdBlockSize) {
-				scopeOut[k] = *p1;
+				gScopeOut[k] = *p1;
 			}
-			scope.log(scopeOut[0], scopeOut[1], scopeOut[2], scopeOut[3]);
+			scope.log(gScopeOut[0], gScopeOut[1], gScopeOut[2], gScopeOut[3]);
 		}
 
 
@@ -425,4 +427,5 @@
 
 void cleanup(BelaContext *context, void *userData)
 {
+	delete [] gScopeOut;
 }