| Summary: | timidity / music_timidity updates with new public functions | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | admin |
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
timidity updates patch
timidity updates patch |
||
(In reply to Ozkan Sezer from comment #0) > If the config file argument contains a parent directory, that will > be added to timidity search path, provided that it is not the root > directory. [...] That is_rootdir() stuff might prove problematic across different OSs so I think I'll be taking it out if the patch gets otherwise approved. Created attachment 4096 [details]
timidity updates patch
Patch without the is_rootdir checks.
Vitaly: You said that this works. Have you merged this? If yes, I will merge it here. Yes, I have merged this with MixerX fork yesterday, so, it should be fine: https://github.com/WohlSoft/SDL-Mixer-X/commit/27a32d4fbcf7af7cc4bca7ecd82a214475cf9715 I also did merge with AudioCodecs where I have replaced my crap with mainstream Mixer's copy: https://github.com/WohlSoft/AudioCodecs/commit/50a41484e183eff1d446504f50eeb1d7eb900a32 A bit later I'll make an issue and the patch that introduced a hot switch of config without restarting of a library. It is dependent on this patch. Patch merged: https://hg.libsdl.org/SDL_mixer/rev/89f446aae9b5 |
Created attachment 4095 [details] timidity updates patch Please review the attached timidity / music_timidity patch. It does the following: * Timidity_init(): Library doesn't care about common timidity.cfg system locations any more, callers are responsible for it. It now takes a config_path argument as the full path of timidity.cfg. If the config file argument contains a parent directory, that will be added to timidity search path, provided that it is not the root directory. The config file is supposed to contain any other dirs that needs to be added to the search path: therefore no need adding several predefined directory paths to the search paths either: they are now removed. * configury: New --with-timidity-cfg=FILE option to set the default config file of the library. * music.c, New public apis Mix_SetTimidityCfg and Mix_GetTimidityCfg Allows the mixer library user to set his own timidity config file. * music_timidity.c, TIMIDITY_Open(): Calls Timidity_Init() with a config file parameter now. The config file parameter priority is like the following: - TIMIDITY_CFG environment var: highest priority. Try nothing else. (Should I try the other options in case of failure, instead?) - Mix_GetTimidityCfg() result: second priority (set by user of the mixer library using Mix_SetTimidityCfg.) Nothing else is tried. (Should I try the other options in case of failure, instead?) - If the above two are absent, a few OS-specific predefined config file paths are tried. If that fails, NULL is sent to Timidity_init so that the library's default config file is tried. Comments? OK to apply?