From 29611bc7ead4d3d5fc9df63c04dd9e2577805557 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 15 Feb 2009 22:34:41 +0000 Subject: SCI: Run astyle to make the code be more compliant with our Code Formatting Guidelines: sfx dir svn-id: r38322 --- engines/sci/sfx/softseq/fluidsynth.cpp | 53 ++++++++++++---------------------- 1 file changed, 19 insertions(+), 34 deletions(-) (limited to 'engines/sci/sfx/softseq/fluidsynth.cpp') diff --git a/engines/sci/sfx/softseq/fluidsynth.cpp b/engines/sci/sfx/softseq/fluidsynth.cpp index 750891d60c..c0b64d24ec 100644 --- a/engines/sci/sfx/softseq/fluidsynth.cpp +++ b/engines/sci/sfx/softseq/fluidsynth.cpp @@ -50,20 +50,17 @@ static int rpn[16]; /* MIDI writer */ static int -fluidsynth_midi_init(struct _midi_writer *self) -{ +fluidsynth_midi_init(struct _midi_writer *self) { return SFX_OK; } static int -fluidsynth_midi_set_option(struct _midi_writer *self, char *name, char *value) -{ +fluidsynth_midi_set_option(struct _midi_writer *self, char *name, char *value) { return SFX_ERROR; } static int -fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) -{ +fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) { if (buf[0] == 0xf0) sciprintf("FluidSynth: Skipping sysex message.\n"); else if (len == 2) { @@ -72,21 +69,20 @@ fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) command = buf[0] & 0xf0; channel = buf[0] & 0x0f; - switch(command) { + switch (command) { case 0xc0: fluid_synth_program_change(synth, channel, buf[1]); break; default: printf("FluidSynth: MIDI command [%02x %02x] not supported\n", buf[0], buf[1]); } - } - else if (len == 3) { + } else if (len == 3) { guint8 command, channel; command = buf[0] & 0xf0; channel = buf[0] & 0x0f; - switch(command) { + switch (command) { case 0x80: fluid_synth_noteoff(synth, channel, buf[1]); break; @@ -121,26 +117,22 @@ fluidsynth_midi_write(struct _midi_writer *self, unsigned char *buf, int len) default: sciprintf("FluidSynth: MIDI command [%02x %02x %02x] not supported\n", buf[0], buf[1], buf[2]); } - } - else + } else sciprintf("FluidSynth: Skipping invalid message of %i bytes.\n", len); return SFX_OK; } static void -fluidsynth_midi_delay(struct _midi_writer *self, int ticks) -{ +fluidsynth_midi_delay(struct _midi_writer *self, int ticks) { } static void -fluidsynth_midi_reset_timer(struct _midi_writer *self) -{ +fluidsynth_midi_reset_timer(struct _midi_writer *self) { } static void -fluidsynth_midi_close(struct _midi_writer *self) -{ +fluidsynth_midi_close(struct _midi_writer *self) { } static midi_writer_t midi_writer_fluidsynth = { @@ -157,15 +149,13 @@ static midi_writer_t midi_writer_fluidsynth = { /* Software sequencer */ static void -fluidsynth_poll(sfx_softseq_t *self, byte *dest, int count) -{ +fluidsynth_poll(sfx_softseq_t *self, byte *dest, int count) { fluid_synth_write_s16(synth, count, dest, 0, 2, dest + 2, 0, 2); } static int fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, - byte *data2_ptr, int data2_length) -{ + byte *data2_ptr, int data2_length) { int sfont_id; double min, max; @@ -185,7 +175,7 @@ fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, fluid_settings_getnum_range(settings, "synth.sample-rate", &min, &max); if (SAMPLE_RATE < min || SAMPLE_RATE > max) { sciprintf("FluidSynth ERROR: Sample rate '%i' not supported. Valid " - "range is (%i-%i).\n", SAMPLE_RATE, (int) min, (int) max); + "range is (%i-%i).\n", SAMPLE_RATE, (int) min, (int) max); delete_fluid_settings(settings); return SFX_ERROR; } @@ -202,41 +192,36 @@ fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length, } gmseq->open(data_length, data_ptr, data2_length, data2_ptr, - &midi_writer_fluidsynth); + &midi_writer_fluidsynth); return SFX_OK; } static void -fluidsynth_exit(sfx_softseq_t *self) -{ +fluidsynth_exit(sfx_softseq_t *self) { delete_fluid_synth(synth); delete_fluid_settings(settings); } static void -fluidsynth_allstop(sfx_softseq_t *self) -{ +fluidsynth_allstop(sfx_softseq_t *self) { if (gmseq->allstop) gmseq->allstop(); } static void -fluidsynth_volume(sfx_softseq_t *self, int volume) -{ +fluidsynth_volume(sfx_softseq_t *self, int volume) { if (gmseq->volume) gmseq->volume(volume); } static int -fluidsynth_set_option(sfx_softseq_t *self, const char *name, const char *value) -{ +fluidsynth_set_option(sfx_softseq_t *self, const char *name, const char *value) { return SFX_ERROR; } static void -fluidsynth_event(sfx_softseq_t *self, byte cmd, int argc, byte *argv) -{ +fluidsynth_event(sfx_softseq_t *self, byte cmd, int argc, byte *argv) { gmseq->event(cmd, argc, argv); } -- cgit v1.2.3