# HG changeset patch # User Giulio Moro # Date 1442262669 -3600 # Node ID 55c1e591cb2eb66d7d9807a3ea887adc4a236f9d # Parent dd24379336f1959dcc36e1f4c28db92230318da7 Added ifdefs for USE_JUCE compatibility diff -r dd24379336f1 -r 55c1e591cb2e core/ClockSync.cpp --- a/core/ClockSync.cpp Mon Sep 14 17:35:18 2015 +0100 +++ b/core/ClockSync.cpp Mon Sep 14 21:31:09 2015 +0100 @@ -261,8 +261,6 @@ } return 1; } -#include -extern I2c_Codec* gAudioCodec; void ClockSync::processOffset(double offset){ static int calls=0; // TODO: change the flow control below so that it can happen multiple times @@ -297,7 +295,9 @@ calls=11; //TODO: correct for offset float targetSamplingRate=offset>0 ? 44097 : 44103; +#ifndef USE_JUCE gAudioCodec->setAudioSamplingRate(targetSamplingRate); +#endif // pastOut[1]=pastOut[2]=pastIn[1]=pastIn[2]=offset; printf("------setAudioSmplingRate to %f\n", targetSamplingRate); } diff -r dd24379336f1 -r 55c1e591cb2e include/ClockSync.h --- a/include/ClockSync.h Mon Sep 14 17:35:18 2015 +0100 +++ b/include/ClockSync.h Mon Sep 14 21:31:09 2015 +0100 @@ -5,6 +5,11 @@ #include "UdpClient.h" #include "Clock.h" #include "VirtualClock.h" +#ifdef USE_JUCE +#else +#include +extern I2c_Codec* gAudioCodec; +#endif /* USE_JUCE */ enum ptpMessageConsts{ kSyncMessageLength=sizeof(myClock_t)+sizeof(int) diff -r dd24379336f1 -r 55c1e591cb2e projects/scope/render.cpp --- a/projects/scope/render.cpp Mon Sep 14 17:35:18 2015 +0100 +++ b/projects/scope/render.cpp Mon Sep 14 21:31:09 2015 +0100 @@ -77,15 +77,14 @@ clockSyncThread.startThread(); //make sure you uncomment .init in setup() } static float phase=0; - float phaseInc=200.0/44100.0*2*M_PI; + float phaseInc=gFrequency1/44100.0*2*M_PI; // rt_printf("phaseInc: %f, phase: %f\n",phaseInc,phase); for(unsigned int n=0; naudioFrames; n++){ - context->audioOut[n*2]=sinf(phaseInc);//context->audioIn[n*2]; - context->audioOut[n*2+1]=sinf(phaseInc);//context->audioIn[n*2]; + context->audioOut[n*2]=sinf(phase);//context->audioIn[n*2]; phase+=200.0/44100.0*2*M_PI; if(phase>=2*M_PI) phase-=2*M_PI; -// context->audioOut[n*2+1]=rand()/(float)RAND_MAX;context->audioIn[n*2]; + context->audioOut[n*2+1]=rand()/(float)RAND_MAX;context->audioIn[n*2]; } count++; /*