Skip to content

Commit

Permalink
Merge pull request #1877 from csound/feature/baremetal_fixes
Browse files Browse the repository at this point in the history
fixes to baremetal build
  • Loading branch information
vlazzarini committed Apr 29, 2024
2 parents 2f03caf + ab0a759 commit cecdd59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Top/csmodule.c
Expand Up @@ -1226,7 +1226,9 @@ extern int32_t newgabopc_ModuleInit(CSOUND *csound);
extern int32_t csoundModuleInit_ampmidid(CSOUND *csound);
extern int32_t csoundModuleInit_mixer(CSOUND *csound);
extern int32_t csoundModuleInit_doppler(CSOUND *csound);
#ifndef BARE_METAL
extern int32_t csoundModuleInit_ftsamplebank(CSOUND *csound);
#endif
extern int32_t csoundModuleInit_signalflowgraph(CSOUND *csound);
extern int32_t arrayops_init_modules(CSOUND *csound);
extern int32_t lfsr_init_modules(CSOUND *csound);
Expand Down Expand Up @@ -1317,7 +1319,9 @@ CS_NOINLINE int csoundInitStaticModules(CSOUND *csound)
csoundModuleInit_ampmidid,
csoundModuleInit_mixer,
csoundModuleInit_doppler,
#ifndef BARE_METAL
csoundModuleInit_ftsamplebank,
#endif
csoundModuleInit_signalflowgraph,
arrayops_init_modules,
lfsr_init_modules,
Expand Down
11 changes: 7 additions & 4 deletions Top/csound.c
Expand Up @@ -3644,11 +3644,13 @@ PUBLIC void csoundReset(CSOUND *csound)
csoundAddStandardTypes(csound, csound->typePool);
/* csoundLoadExternals(csound); */
}
int max_len = 21;
char *s;

#ifndef BARE_METAL
/* allow selecting real time audio module */
int max_len = 21;
csoundCreateGlobalVariable(csound, "_RTAUDIO", (size_t) max_len);
char *s = csoundQueryGlobalVariable(csound, "_RTAUDIO");
s = csoundQueryGlobalVariable(csound, "_RTAUDIO");
#ifndef LINUX
#ifdef __HAIKU__
strcpy(s, "haiku");
Expand All @@ -3662,11 +3664,11 @@ PUBLIC void csoundReset(CSOUND *csound)
0, NULL, &max_len,
Str("Real time audio module name"), NULL);
#endif

/* initialise real time MIDI */
csound->midiGlobals = (MGLOBAL*) csound->Calloc(csound, sizeof(MGLOBAL));
csound->midiGlobals->bufp = &(csound->midiGlobals->mbuf[0]);
csound->midiGlobals->endatp = csound->midiGlobals->bufp;
#ifndef BARE_METAL
csoundCreateGlobalVariable(csound, "_RTMIDI", (size_t) max_len);
csound->SetMIDIDeviceListCallback(csound, midi_dev_list_dummy);
csound->SetExternalMidiInOpenCallback(csound, DummyMidiInOpen);
Expand Down Expand Up @@ -3703,7 +3705,8 @@ PUBLIC void csoundReset(CSOUND *csound)
CSOUNDCFG_BOOLEAN, 0, NULL, NULL,
Str("Do not handle special MIDI controllers"
" (sustain pedal etc.)"), NULL);

#ifndef BARE_METAL

/* sound file tag options */
max_len = 201;
i = (max_len + 7) & (~7);
Expand Down

0 comments on commit cecdd59

Please sign in to comment.