INNER CODE UNIT · C
_a_get_layered_gain
tek256/astera · src/audio.c:283
static float _a_get_layered_gain(a_ctx* ctx, uint32_t id, uint8_t is_sfx) {
for (uint16_t i = 0; i < ctx->layer_capacity; ++i) {
a_layer* layer = &ctx->layers[i];
if (layer->id) {
if (is_sfx && layer->sfx_count > 0) {
for (uint32_t j = 0; j < layer->sfx_count; ++j) {
if (layer->sfx[j] == id) {
return layer->gain;
}
}
} else if (!is_sfx && layer->song_capacity > 0) {
for (uint32_t j = 0; j < layer->song_count; ++j) {
if (layer->songs[j] == id) {
return layer->gain;
}
}
} else {