• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンf6976f6393b4a45201961da873fcb70f76a258ad (tree)
日時2019-04-09 04:03:10
作者Starg <starg@user...>
コミッターStarg

ログメッセージ

Merge dev41

変更サマリ

差分

--- a/interface/w32g_i.c
+++ b/interface/w32g_i.c
@@ -273,7 +273,7 @@ int32 SetValue(int32 value, int32 min, int32 max)
273273 return v;
274274 }
275275
276-int w32gSecondTiMidity(int opt, int argc, char **argv);
276+int w32gSecondTiMidity(int opt, int argc, char **argv, int nfiles, char **files);
277277 int w32gSecondTiMidityExit(void);
278278 int SecondMode = 1;
279279
--- a/interface/w32g_playlist.c
+++ b/interface/w32g_playlist.c
@@ -526,6 +526,7 @@ static int w32g_shuffle_playlist_delete(int n)
526526 for ( i = 0; i < playlist_shuffle.max; i++ ) {
527527 if ( playlist_shuffle.list[i] == n ) {
528528 delete_flag = 1;
529+ i++;
529530 break;
530531 }
531532 }
--- a/interface/w32g_ut2.c
+++ b/interface/w32g_ut2.c
@@ -949,7 +949,7 @@ int PauseOldTiMidity(void)
949949 // opt==5 : 2重に起動する
950950 // 自分が終了するべきときは FALSE を返す
951951 // 自分が終了するべきでないときは TRUE を返す
952-int w32gSecondTiMidity(int opt, int argc, char **argv)
952+int w32gSecondTiMidity(int opt, int argc, char **argv, int nfiles, char **files)
953953 {
954954 int i;
955955 switch (opt) {
@@ -961,7 +961,7 @@ int w32gSecondTiMidity(int opt, int argc, char **argv)
961961 return FALSE;
962962 if (opt==0)
963963 ClearPlaylistOldTiMidity();
964- SendFilesToOldTiMidity(argc > 0 ? argc-1 : 0, argv+1);
964+ SendFilesToOldTiMidity(nfiles, files);
965965 return FALSE;
966966 } else {
967967 if (TryUniqTiMidity(20)==TRUE) {
--- a/timidity/controls.c
+++ b/timidity/controls.c
@@ -206,9 +206,6 @@ ControlMode *ctl_list[]={
206206 #ifdef IA_W32GUI
207207 &w32gui_control_mode,
208208 #endif /* IA_W32GUI */
209-#ifdef IA_W32G_SYN
210- &winsyn_control_mode,
211-#endif /* IA_W32GUI */
212209 #if !defined(__MACOS__) && !defined(IA_W32GUI) && !defined(IA_W32G_SYN) && !defined(IA_WINSYN) && !(defined(__W32__) && defined(CFG_FOR_SF))
213210 &dumb_control_mode,
214211 #endif
--- a/timidity/sndfontini.c
+++ b/timidity/sndfontini.c
@@ -119,8 +119,6 @@ void OverrideSFSettingLoad()
119119 memcpy(sfini_path, fn, FILEPATH_MAX);
120120
121121 #include "loadsndfontini.h"
122-
123- printf("\n**********************************\nsoundfont.ini load ... ok\n");
124122 }
125123
126124 #endif
--- a/timidity/timidity.c
+++ b/timidity/timidity.c
@@ -6259,64 +6259,64 @@ static int parse_opt_h(const char *arg)
62596259 fprintf(fp, "%s", h);
62606260 } else
62616261 fputs(h, fp);
6262- fputs(NLS, fp);
6263- }
6264- fputs(NLS, fp);
6265- fputs("Effect options (-EF, --ext=F option):" NLS
6266-" -EFdelay=d Disable delay effect (default)" NLS
6267-" -EFdelay=D Enable delay effect" NLS
6268-" -EFchorus=d Disable MIDI chorus effect control" NLS
6269-" -EFchorus=n Enable Normal MIDI chorus effect control" NLS
6270-" [,level] `level' is optional to specify chorus level [0..127]" NLS
6271-" (default)" NLS
6272-" -EFchorus=s Surround sound, chorus detuned to a lesser degree" NLS
6273-" [,level] `level' is optional to specify chorus level [0..127]" NLS
6274-" -EFreverb=d Disable MIDI reverb effect control" NLS
6262+ fputs("\n", fp);
6263+ }
6264+ fputs("\n", fp);
6265+ fputs("Effect options (-EF, --ext=F option):" "\n"
6266+" -EFdelay=d Disable delay effect (default)" "\n"
6267+" -EFdelay=D Enable delay effect" "\n"
6268+" -EFchorus=d Disable MIDI chorus effect control" "\n"
6269+" -EFchorus=n Enable Normal MIDI chorus effect control" "\n"
6270+" [,level] `level' is optional to specify chorus level [0..127]" "\n"
6271+" (default)" "\n"
6272+" -EFchorus=s Surround sound, chorus detuned to a lesser degree" "\n"
6273+" [,level] `level' is optional to specify chorus level [0..127]" "\n"
6274+" -EFreverb=d Disable MIDI reverb effect control" "\n"
62756275 #if !defined(REVERB_CONTROL_ALLOW) && !defined(FREEVERB_CONTROL_ALLOW)
6276-" (default)" NLS
6276+" (default)" "\n"
62776277 #endif
6278-" -EFreverb=n Enable Normal MIDI reverb effect control" NLS
6279-" [,level] `level' is optional to specify reverb level [1..127]" NLS
6278+" -EFreverb=n Enable Normal MIDI reverb effect control" "\n"
6279+" [,level] `level' is optional to specify reverb level [1..127]" "\n"
62806280 #if defined(REVERB_CONTROL_ALLOW)
6281-" (default)" NLS
6281+" (default)" "\n"
62826282 #endif
6283-" -EFreverb=g Global reverb effect" NLS
6284-" [,level] `level' is optional to specify reverb level [1..127]" NLS
6285-" -EFreverb=f Enable Freeverb MIDI reverb effect control" NLS
6286-" [,level] `level' is optional to specify reverb level [1..127]" NLS
6283+" -EFreverb=g Global reverb effect" "\n"
6284+" [,level] `level' is optional to specify reverb level [1..127]" "\n"
6285+" -EFreverb=f Enable Freeverb MIDI reverb effect control" "\n"
6286+" [,level] `level' is optional to specify reverb level [1..127]" "\n"
62876287 #if !defined(REVERB_CONTROL_ALLOW) && defined(FREEVERB_CONTROL_ALLOW)
6288-" (default)" NLS
6288+" (default)" "\n"
62896289 #endif
6290-" -EFreverb=G Global Freeverb effect" NLS
6291-" [,level] `level' is optional to specify reverb level [1..127]" NLS
6292-" -EFvlpf=d Disable voice LPF" NLS
6290+" -EFreverb=G Global Freeverb effect" "\n"
6291+" [,level] `level' is optional to specify reverb level [1..127]" "\n"
6292+" -EFvlpf=d Disable voice LPF" "\n"
62936293 #if !defined(VOICE_MOOG_LPF_ALLOW) && !defined(VOICE_CHAMBERLIN_LPF_ALLOW)
6294-" (default)" NLS
6294+" (default)" "\n"
62956295 #endif
6296-" -EFvlpf=c Enable Chamberlin resonant LPF (12dB/oct)" NLS
6296+" -EFvlpf=c Enable Chamberlin resonant LPF (12dB/oct)" "\n"
62976297 #if defined(VOICE_CHAMBERLIN_LPF_ALLOW)
6298-" (default)" NLS
6298+" (default)" "\n"
62996299 #endif
6300-" -EFvlpf=m Enable Moog resonant lowpass VCF (24dB/oct)" NLS
6300+" -EFvlpf=m Enable Moog resonant lowpass VCF (24dB/oct)" "\n"
63016301 #if defined(VOICE_MOOG_LPF_ALLOW) && !defined(VOICE_CHAMBERLIN_LPF_ALLOW)
6302-" (default)" NLS
6303-#endif
6304-" -EFvlpf=b Enable ButterworthFilter resonant lowpass (butterworth)" NLS
6305-" -EFvlpf=i Enable Resonant IIR lowpass VCF (12dB/oct)-2" NLS
6306-" -EFvlpf=a Enable amSynth resonant lowpass VCF (24dB/oct)-2" NLS
6307-" -EFvlpf=o Enable 1 pole 6db/oct resonant lowpass VCF (6dB/oct)" NLS
6308-" -EFvlpf=e Enable resonant 3 pole lowpass VCF (18dB/oct)" NLS
6309-" -EFvlpf=t Enable two first order lowpass VCF " NLS
6310-" -EFvlpf=h Enable HPF ButterworthFilter VCF (butterworth)" NLS
6311-" -EFvlpf=B Enable BPF ButterworthFilter VCF (butterworth)" NLS
6312-" -EFns=n Enable the n'th degree (type) noise shaping filter" NLS
6313-" n:[0..4] (for 8-bit linear encoding, default is 4)" NLS
6314-" n:[0..4] (for 16-bit linear encoding, default is 4)" NLS
6315-" n:[0] (for 24-bit linear encoding, default is 0)" NLS
6316-" n:[0] (for 32-bit linear encoding, default is 0)" NLS
6317-" n:[0] (for 64-bit linear encoding, default is 0)" NLS
6318-" n:[0] (for float 32-bit linear encoding, default is 0)" NLS
6319-" n:[0] (for float 64-bit linear encoding, default is 0)" NLS, fp);
6302+" (default)" "\n"
6303+#endif
6304+" -EFvlpf=b Enable ButterworthFilter resonant lowpass (butterworth)" "\n"
6305+" -EFvlpf=i Enable Resonant IIR lowpass VCF (12dB/oct)-2" "\n"
6306+" -EFvlpf=a Enable amSynth resonant lowpass VCF (24dB/oct)-2" "\n"
6307+" -EFvlpf=o Enable 1 pole 6db/oct resonant lowpass VCF (6dB/oct)" "\n"
6308+" -EFvlpf=e Enable resonant 3 pole lowpass VCF (18dB/oct)" "\n"
6309+" -EFvlpf=t Enable two first order lowpass VCF " "\n"
6310+" -EFvlpf=h Enable HPF ButterworthFilter VCF (butterworth)" "\n"
6311+" -EFvlpf=B Enable BPF ButterworthFilter VCF (butterworth)" "\n"
6312+" -EFns=n Enable the n'th degree (type) noise shaping filter" "\n"
6313+" n:[0..4] (for 8-bit linear encoding, default is 4)" "\n"
6314+" n:[0..4] (for 16-bit linear encoding, default is 4)" "\n"
6315+" n:[0] (for 24-bit linear encoding, default is 0)" "\n"
6316+" n:[0] (for 32-bit linear encoding, default is 0)" "\n"
6317+" n:[0] (for 64-bit linear encoding, default is 0)" "\n"
6318+" n:[0] (for float 32-bit linear encoding, default is 0)" "\n"
6319+" n:[0] (for float 64-bit linear encoding, default is 0)" "\n", fp);
63206320 #ifndef FIXED_RESAMPLATION
63216321 #ifdef HAVE_STRINGIZE
63226322 #define tim_str_internal(x) #x
@@ -6327,147 +6327,147 @@ static int parse_opt_h(const char *arg)
63276327 fputs(" -EFresamp=d Disable resamplation", fp);
63286328 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_none"))
63296329 fputs(" (default)", fp);
6330- fputs(NLS, fp);
6330+ fputs("\n", fp);
63316331 fputs(" -EFresamp=l Enable Linear resample algorithm", fp);
63326332 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_linear"))
63336333 fputs(" (default)", fp);
6334- fputs(NLS, fp);
6334+ fputs("\n", fp);
63356335 fputs(" -EFresamp=c Enable C-spline resample algorithm", fp);
63366336 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_cspline"))
63376337 fputs(" (default)", fp);
6338- fputs(NLS, fp);
6338+ fputs("\n", fp);
63396339 fputs(" -EFresamp=L Enable Lagrange resample algorithm", fp);
63406340 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_lagrange"))
63416341 fputs(" (default)", fp);
6342- fputs(NLS, fp);
6342+ fputs("\n", fp);
63436343 fputs(" -EFresamp=n Enable Newton resample algorithm", fp);
63446344 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_newton"))
63456345 fputs(" (default)", fp);
6346- fputs(NLS, fp);
6346+ fputs("\n", fp);
63476347 fputs(" -EFresamp=g Enable Gauss-like resample algorithm", fp);
63486348 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_gauss"))
63496349 fputs(" (default)", fp);
63506350 ///r
6351- fputs(NLS, fp);
6351+ fputs("\n", fp);
63526352 fputs(" -EFresamp=s Enable Sharp resample algorithm", fp);
63536353 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_sharp"))
63546354 fputs(" (default)", fp);
6355- fputs(NLS, fp);
6355+ fputs("\n", fp);
63566356 fputs(" -EFresamp=p Enable LinearP resample algorithm", fp);
63576357 if (! strcmp(tim_str(DEFAULT_RESAMPLATION), "resample_linear_p"))
63586358 fputs(" (default)", fp);
6359- fputs(NLS
6360-" -EFresamp affects the behavior of -N option" NLS, fp);
6361-#endif
6362- fputs(NLS, fp);
6363- fputs("Alternative TiMidity sequencer extensional mode long options:" NLS
6364-" --[no-]mod-wheel" NLS
6365-" --[no-]portamento" NLS
6366-" --[no-]vibrato" NLS
6367-" --[no-]ch-pressure" NLS
6368-" --[no-]mod-envelope" NLS
6369-" --[no-]trace-text-meta" NLS
6370-" --[no-]overlap-voice" NLS
6359+ fputs("\n"
6360+" -EFresamp affects the behavior of -N option" "\n", fp);
6361+#endif
6362+ fputs("\n", fp);
6363+ fputs("Alternative TiMidity sequencer extensional mode long options:" "\n"
6364+" --[no-]mod-wheel" "\n"
6365+" --[no-]portamento" "\n"
6366+" --[no-]vibrato" "\n"
6367+" --[no-]ch-pressure" "\n"
6368+" --[no-]mod-envelope" "\n"
6369+" --[no-]trace-text-meta" "\n"
6370+" --[no-]overlap-voice" "\n"
63716371 ///r
6372-" --overlap-voice-count=n" NLS
6373-" --[no-]temper-control" NLS
6374-" --default-mid=<HH>" NLS
6375-" --system-mid=<HH>" NLS
6376-" --default-bank=n" NLS
6377-" --force-bank=n" NLS
6378-" --default-program=n/m" NLS
6379-" --force-program=n/m" NLS
6380-" --delay=(d|D)" NLS
6381-" --chorus=(d|n|s|w|W|b|B|t|T|h|H|e|E)[,level]" NLS
6382-" --reverb=(d|n|g|f|G)[,level]" NLS
6383-" --reverb=(f|G)[,level[,scaleroom[,offsetroom[,predelay]]]]" NLS
6384-" --voice-lpf=(d|c|m|b|i|a|o|e|t|h|B)" NLS
6385-" --noise-shaping=n" NLS, fp);
6372+" --overlap-voice-count=n" "\n"
6373+" --[no-]temper-control" "\n"
6374+" --default-mid=<HH>" "\n"
6375+" --system-mid=<HH>" "\n"
6376+" --default-bank=n" "\n"
6377+" --force-bank=n" "\n"
6378+" --default-program=n/m" "\n"
6379+" --force-program=n/m" "\n"
6380+" --delay=(d|D)" "\n"
6381+" --chorus=(d|n|s|w|W|b|B|t|T|h|H|e|E)[,level]" "\n"
6382+" --reverb=(d|n|g|f|G)[,level]" "\n"
6383+" --reverb=(f|G)[,level[,scaleroom[,offsetroom[,predelay]]]]" "\n"
6384+" --voice-lpf=(d|c|m|b|i|a|o|e|t|h|B)" "\n"
6385+" --noise-shaping=n" "\n", fp);
63866386 #ifndef FIXED_RESAMPLATION
6387- fputs(" --resample=(d|l|c|L|n|g|s|p)" NLS, fp);
6387+ fputs(" --resample=(d|l|c|L|n|g|s|p)" "\n", fp);
63886388 #endif
6389- fputs(NLS, fp);
6390- fputs("Available interfaces (-i, --interface option):" NLS, fp);
6389+ fputs("\n", fp);
6390+ fputs("Available interfaces (-i, --interface option):" "\n", fp);
63916391 for (cmpp = ctl_list; (cmp = *cmpp) != NULL; cmpp++)
6392- fprintf(fp, " -i%c %s" NLS,
6392+ fprintf(fp, " -i%c %s" "\n",
63936393 cmp->id_character, cmp->id_name);
63946394 #ifdef IA_DYNAMIC
6395- fprintf(fp, "Supported dynamic load interfaces (%s):" NLS,
6395+ fprintf(fp, "Supported dynamic load interfaces (%s):" "\n",
63966396 dynamic_lib_root);
63976397 memset(mark, 0, sizeof(mark));
63986398 for (cmpp = ctl_list; (cmp = *cmpp) != NULL; cmpp++)
63996399 mark[(int) cmp->id_character] = 1;
64006400 list_dyna_interface(fp, dynamic_lib_root, mark);
64016401 #endif /* IA_DYNAMIC */
6402- fputs(NLS, fp);
6403- fputs("Interface options (append to -i? option):" NLS
6404-" `v' more verbose (cumulative)" NLS
6405-" `q' quieter (cumulative)" NLS
6406-" `t' trace playing" NLS
6407-" `l' loop playing (some interface ignore this option)" NLS
6408-" `r' randomize file list arguments before playing" NLS
6409-" `s' sorting file list arguments before playing" NLS, fp);
6402+ fputs("\n", fp);
6403+ fputs("Interface options (append to -i? option):" "\n"
6404+" `v' more verbose (cumulative)" "\n"
6405+" `q' quieter (cumulative)" "\n"
6406+" `t' trace playing" "\n"
6407+" `l' loop playing (some interface ignore this option)" "\n"
6408+" `r' randomize file list arguments before playing" "\n"
6409+" `s' sorting file list arguments before playing" "\n", fp);
64106410 #ifdef IA_ALSASEQ
64116411 fputs(" `D' daemonize TiMidity++ in background "
6412- "(for alsaseq only)" NLS, fp);
6413-#endif
6414- fputs(NLS, fp);
6415- fputs("Alternative interface long options:" NLS
6416-" --verbose=n" NLS
6417-" --quiet=n" NLS
6418-" --[no-]trace" NLS
6419-" --[no-]loop" NLS
6420-" --[no-]random" NLS
6421-" --[no-]sort" NLS, fp);
6412+ "(for alsaseq only)" "\n", fp);
6413+#endif
6414+ fputs("\n", fp);
6415+ fputs("Alternative interface long options:" "\n"
6416+" --verbose=n" "\n"
6417+" --quiet=n" "\n"
6418+" --[no-]trace" "\n"
6419+" --[no-]loop" "\n"
6420+" --[no-]random" "\n"
6421+" --[no-]sort" "\n", fp);
64226422 #ifdef IA_ALSASEQ
6423- fputs(" --[no-]background" NLS, fp);
6423+ fputs(" --[no-]background" "\n", fp);
64246424 #endif
6425- fputs(NLS, fp);
6426- fputs("Available output modes (-O, --output-mode option):" NLS, fp);
6425+ fputs("\n", fp);
6426+ fputs("Available output modes (-O, --output-mode option):" "\n", fp);
64276427 for (pmpp = play_mode_list; (pmp = *pmpp) != NULL; pmpp++)
6428- fprintf(fp, " -O%c %s" NLS,
6428+ fprintf(fp, " -O%c %s" "\n",
64296429 pmp->id_character, pmp->id_name);
6430- fputs(NLS, fp);
6431- fputs("Output format options (append to -O? option):" NLS
6432-" `S' stereo" NLS
6433-" `M' monophonic" NLS
6434-" `s' signed output" NLS
6435-" `u' unsigned output" NLS
6436-" `1' 16-bit sample width" NLS
6437-" `2' 24-bit sample width" NLS
6438-" `3' 32-bit sample width" NLS
6439-" `6' 64-bit sample width" NLS
6440-" `8' 8-bit sample width" NLS
6441-" `f' float 32-bit sample width" NLS
6442-" `D' float 64-bit sample width" NLS
6443-" `l' linear encoding" NLS
6444-" `U' U-Law encoding" NLS
6445-" `A' A-Law encoding" NLS
6446-" `x' byte-swapped output" NLS, fp);
6447- fputs(NLS, fp);
6448- fputs("Alternative output format long options:" NLS
6449-" --output-stereo" NLS
6450-" --output-mono" NLS
6451-" --output-signed" NLS
6452-" --output-unsigned" NLS
6453-" --output-16bit" NLS
6454-" --output-24bit" NLS
6455-" --output-32bit" NLS
6456-" --output-64bit" NLS
6457-" --output-8bit" NLS
6458-" --output-f32bit" NLS
6459-" --output-float32bit" NLS
6460-" --output-f64bit" NLS
6461-" --output-float64bit" NLS
6462-" --output-linear" NLS
6463-" --output-ulaw" NLS
6464-" --output-alaw" NLS
6465-" --[no-]output-swab" NLS, fp);
6466- fputs(NLS, fp);
6467- fputs("Available WRD interfaces (-W, --wrd option):" NLS, fp);
6430+ fputs("\n", fp);
6431+ fputs("Output format options (append to -O? option):" "\n"
6432+" `S' stereo" "\n"
6433+" `M' monophonic" "\n"
6434+" `s' signed output" "\n"
6435+" `u' unsigned output" "\n"
6436+" `1' 16-bit sample width" "\n"
6437+" `2' 24-bit sample width" "\n"
6438+" `3' 32-bit sample width" "\n"
6439+" `6' 64-bit sample width" "\n"
6440+" `8' 8-bit sample width" "\n"
6441+" `f' float 32-bit sample width" "\n"
6442+" `D' float 64-bit sample width" "\n"
6443+" `l' linear encoding" "\n"
6444+" `U' U-Law encoding" "\n"
6445+" `A' A-Law encoding" "\n"
6446+" `x' byte-swapped output" "\n", fp);
6447+ fputs("\n", fp);
6448+ fputs("Alternative output format long options:" "\n"
6449+" --output-stereo" "\n"
6450+" --output-mono" "\n"
6451+" --output-signed" "\n"
6452+" --output-unsigned" "\n"
6453+" --output-16bit" "\n"
6454+" --output-24bit" "\n"
6455+" --output-32bit" "\n"
6456+" --output-64bit" "\n"
6457+" --output-8bit" "\n"
6458+" --output-f32bit" "\n"
6459+" --output-float32bit" "\n"
6460+" --output-f64bit" "\n"
6461+" --output-float64bit" "\n"
6462+" --output-linear" "\n"
6463+" --output-ulaw" "\n"
6464+" --output-alaw" "\n"
6465+" --[no-]output-swab" "\n", fp);
6466+ fputs("\n", fp);
6467+ fputs("Available WRD interfaces (-W, --wrd option):" "\n", fp);
64686468 for (wlpp = wrdt_list; (wlp = *wlpp) != NULL; wlpp++)
6469- fprintf(fp, " -W%c %s" NLS, wlp->id, wlp->name);
6470- fputs(NLS, fp);
6469+ fprintf(fp, " -W%c %s" "\n", wlp->id, wlp->name);
6470+ fputs("\n", fp);
64716471 close_pager(fp);
64726472 exit(EXIT_SUCCESS);
64736473 return 0; // dummy call
@@ -8363,8 +8363,9 @@ MAIN_INTERFACE int timidity_pre_load_configuration(void)
83638363 #ifdef __W32__
83648364 /* Windows */
83658365 char *strp;
8366- struct timidity_file *check;
8367- char local[1024];
8366+ struct timidity_file *tf;
8367+ char local[FILEPATH_MAX] = { 0 };
8368+ const char cfgname[] = CONFIG_FILE_NAME_P;
83688369
83698370 #if defined(IA_W32GUI) || defined(IA_W32G_SYN)
83708371 extern char *ConfigFile;
@@ -8376,14 +8377,14 @@ MAIN_INTERFACE int timidity_pre_load_configuration(void)
83768377 safe_free(s);
83778378 strcat(ConfigFile, "\\TIMIDITY.CFG");
83788379 }
8379- strncpy(local, ConfigFile, sizeof(local) - 1);
8380- if((check = open_file(local, 0, OF_NORMAL)))
8380+ strlcpy(local, ConfigFile, sizeof(local) - 1);
8381+ if ((tf = open_file(local, 1, OF_NORMAL)))
83818382 {
8382- close_file(check);
8383- if(!read_config_file(local, 0, 0)) {
8384- got_a_configuration = 1;
8385- return 0;
8386- }
8383+ close_file(tf);
8384+ if (!read_config_file(local, 0, 0)) {
8385+ got_a_configuration = 1;
8386+ return 0;
8387+ }
83878388 }
83888389 #endif
83898390
@@ -8402,9 +8403,9 @@ MAIN_INTERFACE int timidity_pre_load_configuration(void)
84028403 {
84038404 *(++strp)='\0';
84048405 strncat(local,"TIMIDITY.CFG",sizeof(local)-strlen(local)-1);
8405- if((check = open_file(local, 0, OF_NORMAL)))
8406+ if((tf = open_file(local, 1, OF_NORMAL)))
84068407 {
8407- close_file(check);
8408+ close_file(tf);
84088409 if(!read_config_file(local, 0, 0)) {
84098410 got_a_configuration = 1;
84108411 return 0;
@@ -8417,9 +8418,9 @@ MAIN_INTERFACE int timidity_pre_load_configuration(void)
84178418 */
84188419 GetWindowsDirectory(local, 1023 - 13);
84198420 strcat(local, "\\TIMIDITY.CFG");
8420- if((check = open(local, 0)) >= 0)
8421+ if((tf = open_file(local, 1, OF_NORMAL)))
84218422 {
8422- close(check);
8423+ close_file(tf);
84238424 if(!read_config_file(local, 0, 0)) {
84248425 got_a_configuration = 1;
84258426 return 0;
@@ -8918,7 +8919,7 @@ MAIN_INTERFACE int timidity_play_main(int nfiles, char **files)
89188919 }
89198920
89208921 #ifdef IA_W32GUI
8921-int w32gSecondTiMidity(int opt, int argc, char **argv);
8922+int w32gSecondTiMidity(int opt, int argc, char **argv, int nfiles, char **files);
89228923 int w32gSecondTiMidityExit(void);
89238924 int w32gLoadDefaultPlaylist(void);
89248925 int w32gSaveDefaultPlaylist(void);
@@ -9087,19 +9088,6 @@ int main(int argc, char **argv)
90879088 if (CoInitialize(NULL) == S_OK)
90889089 CoInitializeOK = 1;
90899090 w32g_initialize();
9090-#ifdef IA_W32GUI
9091- /* Secondary TiMidity Execute */
9092- /* FirstLoadIniFile(); */
9093- if (w32gSecondTiMidity(SecondMode, argc, argv) == FALSE) {
9094- w32gSecondTiMidityExit();
9095- if (CoInitializeOK)
9096- CoUninitialize();
9097- w32g_free_playlist();
9098- w32g_uninitialize();
9099- w32g_free_doc();
9100- return 0;
9101- }
9102-#endif
91039091 for (c = 1; c < argc; c++)
91049092 if (is_directory(argv[c])) {
91059093 char *p;
@@ -9175,6 +9163,21 @@ int main(int argc, char **argv)
91759163 return 1; /* problems with command line */
91769164 #endif
91779165 }
9166+ nfiles = argc - optind;
9167+ files = argv + optind;
9168+#ifdef IA_W32GUI
9169+ /* Secondary TiMidity Execute */
9170+ /* FirstLoadIniFile(); */
9171+ if (w32gSecondTiMidity(SecondMode, argc, argv, nfiles, files) == FALSE) {
9172+ w32gSecondTiMidityExit();
9173+ if (CoInitializeOK)
9174+ CoUninitialize();
9175+ w32g_free_playlist();
9176+ w32g_uninitialize();
9177+ w32g_free_doc();
9178+ return 0;
9179+ }
9180+#endif
91789181 timidity_init_player();
91799182 ///r
91809183 load_all_instrument();
@@ -9185,8 +9188,6 @@ int main(int argc, char **argv)
91859188 #endif
91869189 begin_compute_thread();
91879190 #endif
9188- nfiles = argc - optind;
9189- files = argv + optind;
91909191 if (nfiles > 0
91919192 && ctl->id_character != 'r' && ctl->id_character != 'A'
91929193 && ctl->id_character != 'W' && ctl->id_character != 'N'