summaryrefslogtreecommitdiffstats
path: root/src/synth_engine_v2.c
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2025-02-24 20:02:32 +0200
committergrm <grm@eyesin.space>2025-02-24 20:02:32 +0200
commitd5e9beaf5cc38c0e57bbc555a6e3054f3bf000d8 (patch)
tree1095f34468e3effb10a336f553e30cda45e017b5 /src/synth_engine_v2.c
parent35208c579c9e7d0078d786e61f4a323919e2dcdf (diff)
downloadsynth-project-d5e9beaf5cc38c0e57bbc555a6e3054f3bf000d8.tar.gz
synth-project-d5e9beaf5cc38c0e57bbc555a6e3054f3bf000d8.tar.bz2
synth-project-d5e9beaf5cc38c0e57bbc555a6e3054f3bf000d8.zip
Add audiomidisetup screen and improve audio device handling
Diffstat (limited to 'src/synth_engine_v2.c')
-rw-r--r--src/synth_engine_v2.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/synth_engine_v2.c b/src/synth_engine_v2.c
index ad1be72..d4b7509 100644
--- a/src/synth_engine_v2.c
+++ b/src/synth_engine_v2.c
@@ -349,11 +349,11 @@ get_frame(void *outputBuffer, synth_t *synth, int frame)
*out++ = sample;
*out++ = sample;
- if (sample > 1.0f || sample < -1.0f)
- printf("%f\n", sample);
- if (prev != 0.0f && fabs(prev - sample) > 0.5f) {
- printf("%.2f --> %.2f\n", prev, sample);
- }
+ /* if (sample > 1.0f || sample < -1.0f) */
+ /* printf("%f\n", sample); */
+ /* if (prev != 0.0f && fabs(prev - sample) > 0.5f) { */
+ /* printf("%.2f --> %.2f\n", prev, sample); */
+ /* } */
prev = sample;
// move time
@@ -564,16 +564,18 @@ init_synth(void)
synth->wvt_pos = 0;
-
synth->sound_active = 0;
- synth->soundcard_id = get_soundcard_id("default");
- init_sound(synth, sound_gen, synth->soundcard_id);
+ strcpy(synth->soundcard.name, "default");
+ init_sound(synth, sound_gen, synth->soundcard.name);
synth->midi = (midi_t *)malloc(sizeof(midi_t));
synth->midi_device_id = get_midi_device_id("Midi Through Port-0");
init_midi(synth->midi, synth);
+ synth->gui.screen = SCREEN_MAIN;
+ synth->gui.audiomidi_initialized = 0;
+
return synth;
}
@@ -604,8 +606,7 @@ void
change_soundcard(synth_t *synth)
{
destroy_sound(synth);
- synth->sound_active = 0;
- init_sound(synth, sound_gen, synth->soundcard_id);
+ init_sound(synth, sound_gen, synth->soundcard.name);
}
void