MCPcopy Create free account
hub / github.com/csound/csound / setOpenSlCallbacks

Method setOpenSlCallbacks

Android/CsoundAndroid/jni/AndroidCsound.cpp:19–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18#include <pthread.h>
19void AndroidCsound::setOpenSlCallbacks() {
20
21 __android_log_print(ANDROID_LOG_INFO,"AndroidCsound","setOpenSlCallbacks");
22
23 if(csoundQueryGlobalVariable(csound,"::async::") == NULL)
24 if (this->CreateGlobalVariable("::async::", sizeof(int)) == 0) {
25 int *p = ((int *)csoundQueryGlobalVariable(csound,"::async::"));
26 *p = asyncProcess;
27 __android_log_print(ANDROID_LOG_INFO,"AndroidCsound","==set callbacks");
28 csoundSetPlayopenCallback(csound, androidplayopen_);
29 csoundSetRecopenCallback(csound, androidrecopen_);
30 csoundSetRtplayCallback(csound, androidrtplay_);
31 csoundSetRtrecordCallback(csound, androidrtrecord_);
32 csoundSetRtcloseCallback(csound, androidrtclose_);
33 csoundSetMessageCallback(csound, androidMessageCallback);
34 __android_log_print(ANDROID_LOG_INFO,"AndroidCsound","==callbacks set");
35 }
36
37 if(csoundQueryGlobalVariable(csound,"::paused::") == NULL) {
38 if (this->CreateGlobalVariable("::paused::", sizeof(int)) == 0) {
39 int *p = ((int *)csoundQueryGlobalVariable(csound,"::paused::"));
40 *p = 0;
41 }
42 }
43
44
45};
46
47int AndroidCsound::SetGlobalEnv(const char* name, const char* variable) {
48 return csoundSetGlobalEnv(name, variable);

Callers 2

runCsoundOpenSLMethod · 0.80
runCsoundOpenSLMethod · 0.80

Calls 7

csoundSetRecopenCallbackFunction · 0.85
csoundSetRtplayCallbackFunction · 0.85
csoundSetRtcloseCallbackFunction · 0.85
csoundSetMessageCallbackFunction · 0.85

Tested by

no test coverage detected