mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-05-30 17:00:39 +00:00
enforce coding style guide
using astyle
This commit is contained in:
parent
90c2d76709
commit
9382edabd5
129 changed files with 33394 additions and 27137 deletions
|
@ -6,19 +6,19 @@
|
|||
#include "rvoice/fluid_rvoice.h"
|
||||
#include "utils/fluidsynth_priv.h"
|
||||
|
||||
static void verify_sample_rate(fluid_synth_t* synth, int expected_srate)
|
||||
static void verify_sample_rate(fluid_synth_t *synth, int expected_srate)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
TEST_ASSERT(synth->sample_rate == expected_srate);
|
||||
|
||||
for (i=0; i < synth->polyphony; i++)
|
||||
|
||||
for(i = 0; i < synth->polyphony; i++)
|
||||
{
|
||||
TEST_ASSERT(synth->voice[i]->output_rate == expected_srate);
|
||||
TEST_ASSERT(synth->voice[i]->rvoice->dsp.output_rate == expected_srate);
|
||||
TEST_ASSERT(synth->voice[i]->overflow_rvoice->dsp.output_rate == expected_srate);
|
||||
}
|
||||
|
||||
|
||||
// TODO check fx, rvoice_mixer et. al.?
|
||||
}
|
||||
|
||||
|
@ -27,40 +27,40 @@ int main(void)
|
|||
{
|
||||
int polyphony;
|
||||
double sample_rate;
|
||||
|
||||
|
||||
fluid_settings_t *settings = new_fluid_settings();
|
||||
fluid_synth_t *synth = new_fluid_synth(settings);
|
||||
|
||||
|
||||
TEST_ASSERT(settings != NULL);
|
||||
TEST_ASSERT(synth != NULL);
|
||||
|
||||
|
||||
TEST_SUCCESS(fluid_settings_getint(settings, "synth.polyphony", &polyphony));
|
||||
TEST_ASSERT(polyphony == synth->polyphony);
|
||||
|
||||
|
||||
TEST_SUCCESS(fluid_settings_getnum(settings, "synth.sample-rate", &sample_rate));
|
||||
|
||||
|
||||
verify_sample_rate(synth, sample_rate);
|
||||
|
||||
|
||||
TEST_SUCCESS(fluid_synth_sfload(synth, TEST_SOUNDFONT, 1));
|
||||
|
||||
|
||||
TEST_SUCCESS(fluid_synth_sfload(synth, TEST_SOUNDFONT, 1));
|
||||
// play some notes to start some voices
|
||||
TEST_SUCCESS(fluid_synth_noteon(synth, 0, 60, 127));
|
||||
TEST_SUCCESS(fluid_synth_noteon(synth, 2, 71, 127));
|
||||
TEST_SUCCESS(fluid_synth_noteon(synth, 3, 82, 127));
|
||||
|
||||
|
||||
verify_sample_rate(synth, sample_rate);
|
||||
|
||||
|
||||
// set srate to minimum allowed
|
||||
sample_rate = 8000;
|
||||
fluid_synth_set_sample_rate(synth, sample_rate);
|
||||
|
||||
|
||||
// manually dispatch rvoice events to get samples rates updated (this simulates the render thread)
|
||||
fluid_synth_process_event_queue(synth);
|
||||
|
||||
|
||||
verify_sample_rate(synth, sample_rate);
|
||||
|
||||
|
||||
delete_fluid_synth(synth);
|
||||
delete_fluid_settings(settings);
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue