Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 35702 Details for
Bug 57440
openttd-0.3.3: a few changes
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch which allows other midi player to be specified in the configuration file
0.3.3-r1-config_ext_midiplayer.diff (text/plain), 3.15 KB, created by
Robert Schuster
on 2004-07-18 11:12:53 UTC
(
hide
)
Description:
patch which allows other midi player to be specified in the configuration file
Filename:
MIME Type:
Creator:
Robert Schuster
Created:
2004-07-18 11:12:53 UTC
Size:
3.15 KB
patch
obsolete
>--- openttd-0.3.3/extmidi.c.orig 2004-07-14 17:46:12.000000000 +0200 >+++ openttd-0.3.3/extmidi.c 2004-07-18 18:39:40.234919504 +0200 >@@ -11,8 +11,16 @@ > #include <sys/stat.h> > #include <errno.h> > >+// EXTERNAL_PLAYER can be defined in Makefile.conf > #ifndef EXTERNAL_PLAYER >-#define EXTERNAL_PLAYER "/usr/bin/timidity" >+ #define EXTERNAL_PLAYER "/usr/bin/timidity" >+#endif >+ >+// MIDI_ARG can be defined in Makefile.conf >+#ifdef MIDI_ARG >+ #define EXTERNAL_PLAYER_ARG MIDI_ARG >+#else >+ #define EXTERNAL_PLAYER_ARG "" > #endif > > static pid_t _pid; >@@ -28,6 +36,18 @@ > static char *extmidi_start(char **parm) { > _pid = 0; > >+ // if the user defined no midi player the default one >+ // is used (timidity) >+ if(strlen(_ini_ext_midiplayer) == 0) { >+ fprintf(stdout, "extmidi: using default midi player: %s %s\n", EXTERNAL_PLAYER, EXTERNAL_PLAYER_ARG); >+ >+ strncpy(_ini_ext_midiplayer, EXTERNAL_PLAYER, lengthof(_ini_ext_midiplayer)); >+ >+ strncpy(_ini_ext_midiplayer_arg, EXTERNAL_PLAYER_ARG, lengthof(_ini_ext_midiplayer_arg)); >+ } else { >+ fprintf(stdout, "extmidi: using user defined player: %s %s\n", _ini_ext_midiplayer, _ini_ext_midiplayer_arg); >+ } >+ > return NULL; > } > >@@ -46,19 +66,14 @@ > } > > if(_pid == 0) { >- #if defined(MIDI_ARG) >- execl(EXTERNAL_PLAYER, "extmidi", MIDI_ARG, filename, NULL); >- #else >- execl(EXTERNAL_PLAYER, "extmidi", filename, NULL); >- #endif >+ // call external midi application >+ execl(_ini_ext_midiplayer, "extmidi", _ini_ext_midiplayer_arg, filename, NULL); > > fprintf(stderr, "extmidi: couldn't execl: %s\n", strerror(errno)); > > exit(0); > } > >- >- > usleep(500); > > >--- openttd-0.3.3/settings.c.orig 2004-07-14 17:46:12.000000000 +0200 >+++ openttd-0.3.3/settings.c 2004-07-18 18:27:41.904122384 +0200 >@@ -725,6 +725,10 @@ > //*************************** > > static const SettingDesc music_settings[] = { >+ // specifies the midi application for extmidi >+ {"external_midiplayer", SDT_STRINGBUF | lengthof(_ini_ext_midiplayer)<<16 | SDT_NOSAVE, NULL, _ini_ext_midiplayer }, >+ // specifies the arguments for the midi application >+ {"external_midiplayer_arg", SDT_STRINGBUF | lengthof(_ini_ext_midiplayer_arg)<<16 | SDT_NOSAVE, NULL, _ini_ext_midiplayer_arg }, > {"playlist", SDT_UINT8, (void*)0, (void*)offsetof(MusicFileSettings, playlist) }, > {"music_vol", SDT_UINT8, (void*)128, (void*)offsetof(MusicFileSettings, music_vol) }, > {"effect_vol", SDT_UINT8, (void*)128, (void*)offsetof(MusicFileSettings, effect_vol) }, >@@ -908,6 +912,7 @@ > void LoadFromConfig() > { > IniFile *ini = ini_load(_config_file); >+ > HandleSettingDescs(ini, load_setting_desc); > LoadGrfSettings(ini); > ini_free(ini); >--- openttd-0.3.3/variables.h.orig 2004-07-14 17:46:04.000000000 +0200 >+++ openttd-0.3.3/variables.h 2004-07-18 18:27:04.294839864 +0200 >@@ -282,6 +282,18 @@ > > VARDEF char _ini_videodriver[16], _ini_musicdriver[16], _ini_sounddriver[16]; > >+ >+/** path to an application which plays midi files >+ * (used for extmidi) >+ */ >+VARDEF char _ini_ext_midiplayer[128]; >+ >+/** arguments for the midi application >+ * (used for extmidi) >+ */ >+VARDEF char _ini_ext_midiplayer_arg[32]; >+ >+ > VARDEF bool _cache_sprites; > > // debug features
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 57440
:
35665
|
35666
| 35702 |
35703