mirror of
https://github.com/Relintai/sfw.git
synced 2025-04-07 17:01:48 +02:00
Removed ui_audio().
This commit is contained in:
parent
bb030eb32e
commit
bcd07c0511
@ -579,37 +579,3 @@ int audio_queue( const void *samples, int num_samples, int flags ) {
|
||||
|
||||
return audio_queue_voice;
|
||||
}
|
||||
|
||||
int ui_audio() {
|
||||
int changed = 0;
|
||||
|
||||
float sfx = sqrt(volume_clip), bgm = sqrt(volume_stream), master = sqrt(volume_master);
|
||||
if( ui_slider2("BGM volume", &bgm, va("%.2f", bgm))) changed = 1, audio_volume_stream(bgm);
|
||||
if( ui_slider2("SFX volume", &sfx, va("%.2f", sfx))) changed = 1, audio_volume_clip(sfx);
|
||||
if( ui_slider2("Master volume", &master, va("%.2f", master))) changed = 1, audio_volume_master(master);
|
||||
|
||||
ui_separator();
|
||||
|
||||
int num_voices = sts_mixer_get_active_voices(&mixer);
|
||||
ui_label2("Format", mixer.audio_format == 0 ? "None" : mixer.audio_format == 1 ? "8-bit" : mixer.audio_format == 2 ? "16-bit" : mixer.audio_format == 3 ? "32-bit integer" : "32-bit float");
|
||||
ui_label2("Frequency", va("%4.1f KHz", mixer.frequency / 1000.0));
|
||||
ui_label2("Voices", va("%d/%d", num_voices, STS_MIXER_VOICES));
|
||||
ui_separator();
|
||||
|
||||
for( int i = 0; i < STS_MIXER_VOICES; ++i ) {
|
||||
if( mixer.voices[i].state != STS_MIXER_VOICE_STOPPED ) { // PLAYING || STREAMING
|
||||
ui_label(va("Voice %d", i+1));
|
||||
|
||||
// float mul = mixer.voices[i].state == STS_MIXER_VOICE_STREAMING ? 2 : 1;
|
||||
// float div = mixer.voices[i].state == STS_MIXER_VOICE_STREAMING ? mixer.voices[i].stream->sample.length : mixer.voices[i].sample->length;
|
||||
// float pct = mixer.voices[i].position * mul / div;
|
||||
// if(ui_slider2("Position", &pct, va("%5.2f", pct))) changed = 1;
|
||||
if(ui_slider2("Gain", &mixer.voices[i].gain, va("%5.2f", mixer.voices[i].gain))) changed = 1;
|
||||
if(ui_slider2("Pitch", &mixer.voices[i].pitch, va("%5.2f", mixer.voices[i].pitch))) changed = 1;
|
||||
if(ui_slider2("Pan", &mixer.voices[i].pan, va("%5.2f", mixer.voices[i].pan))) changed = 1;
|
||||
ui_separator();
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ int audio_play_gain_pitch_pan( audio_t a, int flags, float gain, float pitch
|
||||
int audio_stop( audio_t a );
|
||||
void audio_loop( audio_t a, bool loop );
|
||||
bool audio_playing( audio_t a );
|
||||
|
||||
|
||||
float audio_volume_clip(float gain); // set fx volume if gain is in [0..1] range. returns current fx volume in any case
|
||||
float audio_volume_stream(float gain); // set bgm volume if gain is in [0..1] range. returns current bgm volume in any case
|
||||
float audio_volume_master(float gain); // set master volume if gain is in [0..1] range. returns current master volume in any case
|
||||
@ -33,8 +33,6 @@ float audio_volume_master(float gain); // set master volume if gain is in [0..
|
||||
int audio_mute(int mute);
|
||||
int audio_muted();
|
||||
|
||||
int ui_audio();
|
||||
|
||||
enum AUDIO_FLAGS {
|
||||
AUDIO_1CH = 0, // default
|
||||
AUDIO_2CH = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user