changeset 166:e6558ce09884

- Cleaned up default heavy render.cpp file
author chnrx <chris.heinrichs@gmail.com>
date Thu, 03 Dec 2015 17:15:10 +0000
parents 30dade7bc2bc
children 28d1473742bc
files scripts/hvresources/render.cpp
diffstat 1 files changed, 1 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/hvresources/render.cpp	Thu Dec 03 16:24:02 2015 +0000
+++ b/scripts/hvresources/render.cpp	Thu Dec 03 17:15:10 2015 +0000
@@ -16,23 +16,6 @@
 #include "../include/Utilities.h"
 #include "Heavy_bbb.h"
 
-// #include "I2c_TouchKey.h"
-
-// #include "../include/UdpServer.h"
-// #include "../include/UdpClient.h"
-// #include <iostream>
-// #include <fstream>
-// #include "../include/ReceiveAudioThread.h"
-
-// #include "../include/render.h"
-// #include <arm_neon.h>
-// #include <time.h>
-// #include <sndfile.h>
-
-// #include "../include/RTAudio.h"
-// #include <rtdk.h>
-
-
 /*
  *	HEAVY CONTEXT & BUFFERS
  */
@@ -64,16 +47,9 @@
 }
 
 /*
- * RENDER INITIALISATION, LOOP & CLEANUP
+ * SETUP, RENDER LOOP & CLEANUP
  */
 
-
-// bool initialise_render(int numMatrixChannels, int numAudioChannels,
-// 					   int numMatrixFramesPerPeriod,
-// 					   int numAudioFramesPerPeriod,
-// 					   float matrixSampleRate, float audioSampleRate,
-// 					   void *userData)
-// {
 bool setup(BeagleRTContext *context, void *userData)	{
 
 	/* HEAVY */
@@ -83,14 +59,11 @@
 	gHvInputChannels = hv_getNumInputChannels(gHeavyContext);
 	gHvOutputChannels = hv_getNumOutputChannels(gHeavyContext);
 
-	// srand ( time(NULL) );  	
-
 	rt_printf("Starting Heavy context with %d input channels and %d output channels\n",
 			  gHvInputChannels, gHvOutputChannels);
 
 	if(gHvInputChannels != 0) {
 		gHvInputBuffers = (float *)calloc(gHvInputChannels * context->audioFrames,sizeof(float));
-		//memset(gHvInputBuffers,0,gHvInputChannels * numAudioFramesPerPeriod * sizeof(float));
 	}
 	if(gHvOutputChannels != 0) {
 		gHvOutputBuffers = (float *)calloc(gHvOutputChannels * context->audioFrames,sizeof(float));
@@ -107,16 +80,8 @@
 }
 
 
-// void render(int numMatrixFrames, int numAudioFrames, float *audioIn, float *audioOut,
-// 			uint16_t *matrixIn, uint16_t *matrixOut)
-// {	
 void render(BeagleRTContext *context, void *userData)
 {
-	// use this for thread management
-	// if(gCount == 0) {
-	// } else {
-	// }
-	// gCount++;
 
 	// De-interleave the data
 	if(gHvInputBuffers != NULL) {
@@ -157,8 +122,6 @@
 				} else {
 					if(ch >= context->audioChannels)	{
 						int m = n/2;
-						// float mOut = (float)gHvOutputBuffers[ch*numAudioFrames + n];
-						// mOut = constrain(mOut,0.0,1.0);
 						context->analogOut[m * context->analogFrames + (ch-context->audioChannels)] = constrain(gHvOutputBuffers[ch*context->audioFrames + n],0.0,1.0);
 					} else {
 						context->audioOut[n * context->audioChannels + ch] = gHvOutputBuffers[ch * context->audioFrames + n];