Skip to content

Commit

Permalink
Do not hardcode default settings values in help text
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Oct 31, 2024
1 parent 9bbe7d5 commit ed5f7e6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/fluidsynth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ print_help(fluid_settings_t *settings)
{
char *audio_options;
char *midi_options;
double ddef;
int idef;

audio_options = fluid_settings_option_concat(settings, "audio.driver", NULL);
midi_options = fluid_settings_option_concat(settings, "midi.driver", NULL);
Expand Down Expand Up @@ -1274,8 +1276,9 @@ print_help(fluid_settings_t *settings)
" Load command configuration file (shell commands)\n");
printf(" -F, --fast-render=[file]\n"
" Render MIDI file to raw audio data and store in [file]\n");
fluid_settings_getnum_default(settings, "synth.gain", &ddef);
printf(" -g, --gain\n"
" Set the master gain [0 < gain < 10, default = 0.2]\n");
" Set the master gain [0 < gain < 10, default = def=%0.3g]\n", ddef);
printf(" -G, --audio-groups\n"
" Defines the number of LADSPA audio nodes\n");
printf(" -h, --help\n"
Expand All @@ -1284,10 +1287,14 @@ print_help(fluid_settings_t *settings)
" Don't read commands from the shell [default = yes]\n");
printf(" -j, --connect-jack-outputs\n"
" Attempt to connect the jack outputs to the physical ports\n");

fluid_settings_getint_default(settings, "synth.midi-channels", &idef);
printf(" -K, --midi-channels=[num]\n"
" The number of midi channels [default = 16]\n");
" The number of midi channels [default = %d]\n", idef);

fluid_settings_getint_default(settings, "synth.audio-channels", &idef);
printf(" -L, --audio-channels=[num]\n"
" The number of stereo audio channels [default = 1]\n");
" The number of stereo audio channels [default = %d]\n", idef);
printf(" -m, --midi-driver=[label]\n"
" The name of the midi driver to use.\n"
" Valid values: %s\n", midi_options ? midi_options : "ERROR");
Expand Down

0 comments on commit ed5f7e6

Please sign in to comment.