Mercurial > hg > beaglert
comparison core/default_libpd_render.cpp @ 513:485913c58a61 prerelease
removed old readFileTask from libpd
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Wed, 22 Jun 2016 04:58:17 +0100 |
parents | b6eb94378ca9 |
children | bfcbeb437869 |
comparison
equal
deleted
inserted
replaced
512:8e48dd7c8c23 | 513:485913c58a61 |
---|---|
30 } | 30 } |
31 | 31 |
32 void Bela_printHook(const char *recv){ | 32 void Bela_printHook(const char *recv){ |
33 rt_printf("%s", recv); | 33 rt_printf("%s", recv); |
34 } | 34 } |
35 | |
36 //TODO: remove this function | |
37 void libpdReadFilesLoop(){ | |
38 return; | |
39 while(!gShouldStop){ | |
40 // check for modified sockets/file descriptors | |
41 // (libpd would normally do this every block WITHIN the audio thread) | |
42 // not sure if this is thread-safe at the moment | |
43 libpd_sys_microsleep(0); | |
44 usleep(1000); | |
45 } | |
46 } | |
47 | |
48 #define PARSE_MIDI | 35 #define PARSE_MIDI |
49 static AuxiliaryTask libpdReadFilesTask; | |
50 static Midi midi; | 36 static Midi midi; |
51 static DigitalChannelManager dcm; | 37 static DigitalChannelManager dcm; |
52 //UdpServer udpServer; | |
53 | 38 |
54 void sendDigitalMessage(bool state, unsigned int delay, void* receiverName){ | 39 void sendDigitalMessage(bool state, unsigned int delay, void* receiverName){ |
55 libpd_float((char*)receiverName, (float)state); | 40 libpd_float((char*)receiverName, (float)state); |
56 // rt_printf("%s: %d\n", (char*)receiverName, state); | 41 // rt_printf("%s: %d\n", (char*)receiverName, state); |
57 } | 42 } |
221 void* patch = libpd_openfile(file, folder); | 206 void* patch = libpd_openfile(file, folder); |
222 if(patch == NULL){ | 207 if(patch == NULL){ |
223 printf("Error: file %s/%s is corrupted.\n", folder, file); | 208 printf("Error: file %s/%s is corrupted.\n", folder, file); |
224 return false; | 209 return false; |
225 } | 210 } |
226 libpdReadFilesTask = Bela_createAuxiliaryTask(libpdReadFilesLoop, 60, "libpdReadFiles"); | |
227 Bela_scheduleAuxiliaryTask(libpdReadFilesTask); | |
228 | |
229 | |
230 return true; | 211 return true; |
231 } | 212 } |
232 | 213 |
233 // render() is called regularly at the highest priority by the audio engine. | 214 // render() is called regularly at the highest priority by the audio engine. |
234 // Input and output are given from the audio hardware and the other | 215 // Input and output are given from the audio hardware and the other |