From b27c582f11f29680b5ac6033d69e50c9263e1320 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sat, 12 Mar 2022 17:22:37 -0500 Subject: Add methods to set drone, chamber synth gain --- include/xas/drone.h | 4 ++++ src/drone.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/xas/drone.h b/include/xas/drone.h index b508e6d..d15b13b 100644 --- a/include/xas/drone.h +++ b/include/xas/drone.h @@ -66,6 +66,10 @@ void xas_drone_chamber_insert_drone(xas_drone_chamber *chamber, xas_drone *drone, size_t index); +void xas_drone_chamber_set_drone_gain(xas_drone_chamber *chamber, float gain); + +void xas_drone_chamber_set_synth_gain(xas_drone_chamber *chamber, float gain); + void xas_drone_chamber_bass_start(xas_drone_chamber *chamber); void xas_drone_chamber_bass_stop(xas_drone_chamber *chamber); diff --git a/src/drone.c b/src/drone.c index 2655758..d374e3b 100644 --- a/src/drone.c +++ b/src/drone.c @@ -181,6 +181,22 @@ void xas_drone_chamber_insert_drone(xas_drone_chamber *chamber, chamber->drones[index] = drone; } +void xas_drone_chamber_set_drone_gain(xas_drone_chamber *chamber, float gain) { + size_t i; + + for (i=0; idrone_count; i++) { + xas_drone *drone = chamber->drones[i]; + + xas_object_set_gain(drone->obj->ctx, gain); + } +} + +void xas_drone_chamber_set_synth_gain(xas_drone_chamber *chamber, float gain) { + xas_object_set_gain(chamber->synth_bass->ctx, gain); + xas_object_set_gain(chamber->synth_l->ctx, gain); + xas_object_set_gain(chamber->synth_r->ctx, gain); +} + void xas_drone_chamber_bass_start(xas_drone_chamber *chamber) { xas_synth_start(chamber->synth_bass->ctx); } -- cgit v1.2.3