From ac5aa418aeacdafd71cf0416c7b3959ce5485f4e Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Sat, 2 Dec 2017 12:19:13 +0100 Subject: [PATCH] Use float instead of fluid_real_t for overflow parameters and calculations --- src/synth/fluid_synth.c | 4 ++-- src/synth/fluid_voice.c | 4 ++-- src/synth/fluid_voice.h | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index e0c16e29..55b23e45 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -3168,8 +3168,8 @@ static fluid_voice_t* fluid_synth_free_voice_by_kill_LOCAL(fluid_synth_t* synth) { int i; - fluid_real_t best_prio = OVERFLOW_PRIO_CANNOT_KILL-1; - fluid_real_t this_voice_prio; + float best_prio = OVERFLOW_PRIO_CANNOT_KILL-1; + float this_voice_prio; fluid_voice_t* voice; int best_voice_index=-1; unsigned int ticks = fluid_synth_get_ticks(synth); diff --git a/src/synth/fluid_voice.c b/src/synth/fluid_voice.c index 214d006c..ce966434 100644 --- a/src/synth/fluid_voice.c +++ b/src/synth/fluid_voice.c @@ -1681,12 +1681,12 @@ fluid_voice_optimize_sample(fluid_sample_t* s) return FLUID_OK; } -fluid_real_t +float fluid_voice_get_overflow_prio(fluid_voice_t* voice, fluid_overflow_prio_t* score, unsigned int cur_time) { - fluid_real_t this_voice_prio = 0; + float this_voice_prio = 0; /* Are we already overflowing? */ if (!voice->can_access_overflow_rvoice) { diff --git a/src/synth/fluid_voice.h b/src/synth/fluid_voice.h index 4103f08d..0bfea234 100644 --- a/src/synth/fluid_voice.h +++ b/src/synth/fluid_voice.h @@ -37,11 +37,11 @@ typedef struct _fluid_overflow_prio_t fluid_overflow_prio_t; struct _fluid_overflow_prio_t { - fluid_real_t percussion; /**< Is this voice on the drum channel? Then add this score */ - fluid_real_t released; /**< Is this voice in release stage? Then add this score (usually negative) */ - fluid_real_t sustained; /**< Is this voice sustained? Then add this score (usually negative) */ - fluid_real_t volume; /**< Multiply current (or future) volume (a value between 0 and 1) */ - fluid_real_t age; /**< This score will be divided by the number of seconds the voice has lasted */ + float percussion; /**< Is this voice on the drum channel? Then add this score */ + float released; /**< Is this voice in release stage? Then add this score (usually negative) */ + float sustained; /**< Is this voice sustained? Then add this score (usually negative) */ + float volume; /**< Multiply current (or future) volume (a value between 0 and 1) */ + float age; /**< This score will be divided by the number of seconds the voice has lasted */ }; enum fluid_voice_status @@ -148,7 +148,7 @@ void fluid_voice_stop(fluid_voice_t* voice); void fluid_voice_overflow_rvoice_finished(fluid_voice_t* voice); int fluid_voice_kill_excl(fluid_voice_t* voice); -fluid_real_t fluid_voice_get_overflow_prio(fluid_voice_t* voice, +float fluid_voice_get_overflow_prio(fluid_voice_t* voice, fluid_overflow_prio_t* score, unsigned int cur_time);