From 14baebdfc476f57cc36c2ccde12a9a0cc313b73e Mon Sep 17 00:00:00 2001 From: psperl Date: Sat, 25 Oct 2008 17:06:36 +0000 Subject: [PATCH] projectM-test random sound data git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1197 6778bc44-b910-0410-a7a0-be141de4315d --- src/projectM-test/projectM-test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/projectM-test/projectM-test.cpp b/src/projectM-test/projectM-test.cpp index 8f4823355..aa846f7b0 100644 --- a/src/projectM-test/projectM-test.cpp +++ b/src/projectM-test/projectM-test.cpp @@ -24,6 +24,7 @@ #include "sdltoprojectM.h" #include "ConfigFile.h" #include "getConfigFilename.h" +#include // FIXME: portable includes? // i just added what works for me -fatray @@ -86,6 +87,8 @@ int main(int argc, char **argv) { return 1; } +float fakePCM[512]; + void renderLoop() { while (1) { projectMEvent evt; @@ -139,6 +142,18 @@ void renderLoop() { break; } } + fakePCM[0]=0; + for (int x = 1; x< 512;x++) + { + fakePCM[x] = fakePCM[x-1] + (rand()%200 - 100) *.002; + } + + + globalPM->pcm()->addPCMfloat(fakePCM, 512); + + + + globalPM->renderFrame();