mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-27 22:43:36 +00:00
Implement fluid_get_userconf() on windows (#425)
This commit is contained in:
parent
64687c3a05
commit
e4b8e2b44c
2 changed files with 14 additions and 8 deletions
|
@ -81,6 +81,7 @@ FluidSynths major version was bumped. The API was reworked, deprecated functions
|
|||
- rename chorus getters to match naming conventions: fluid_synth_get_chorus_speed() and fluid_synth_get_chorus_depth()
|
||||
- fluid_synth_remove_sfont() returns FLUID_OK or FLUID_FAILED
|
||||
- introduce a separate data type for sequencer client IDs: #fluid_seq_id_t
|
||||
- fluid_get_userconf() has been implemented for Windows
|
||||
|
||||
<strong>New Features and API additions:</strong>
|
||||
|
||||
|
|
|
@ -623,22 +623,27 @@ fluid_source(fluid_cmd_handler_t *handler, const char *filename)
|
|||
char *
|
||||
fluid_get_userconf(char *buf, int len)
|
||||
{
|
||||
#if defined(WIN32) || defined(MACOS9)
|
||||
return NULL;
|
||||
#else
|
||||
char *home = getenv("HOME");
|
||||
|
||||
const char *home = NULL;
|
||||
const char *config_file;
|
||||
#if defined(WIN32)
|
||||
home = getenv("USERPROFILE");
|
||||
config_file = "\\fluidsynth.cfg";
|
||||
|
||||
#elif !defined(MACOS9)
|
||||
home = getenv("HOME");
|
||||
config_file = "/.fluidsynth";
|
||||
|
||||
#endif
|
||||
|
||||
if(home == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
FLUID_SNPRINTF(buf, len, "%s/.fluidsynth", home);
|
||||
FLUID_SNPRINTF(buf, len, "%s%s", home, config_file);
|
||||
return buf;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue