Commit MetaInfo

Revisione74f7b36769e2f78d56e5e6df659e06f7111ccdf (tree)
Zeit2020-03-26 23:45:02
AutorStarg <starg@user...>
CommiterStarg

Log Message

Import UnkoTim231

Ändern Zusammenfassung

Diff

--- a/interface/w32g_c.c
+++ b/interface/w32g_c.c
@@ -1660,9 +1660,11 @@ static void ctl_event(CtlEvent *e)
16601660 else
16611661 sec = sec / play_mode->rate;
16621662 }
1663- ctl_current_time(sec, (int)e->v2);
1663+ if(!flg)
1664+ ctl_current_time(sec, (int)e->v2);
16641665 display_aq_ratio();
1665- MainWndScrollbarProgressUpdate(sec);
1666+ if(!flg)
1667+ MainWndScrollbarProgressUpdate(sec);
16661668 ctl_panel_refresh(flg);
16671669 }
16681670 break;
--- a/interface/w32g_i.c
+++ b/interface/w32g_i.c
@@ -877,6 +877,8 @@ extern void ShowPrefWnd ( void );
877877 extern void HidePrefWnd ( void );
878878 extern BOOL IsVisiblePrefWnd ( void );
879879
880+#define WM_UPDATE_SCROLLBAR_PROGRESS (WM_APP + 100) // (int)lParam: sec
881+
880882 LRESULT CALLBACK
881883 MainProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
882884 {
@@ -1289,6 +1291,24 @@ MainProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
12891291 break;
12901292 }
12911293 break;
1294+ case WM_UPDATE_SCROLLBAR_PROGRESS:
1295+ {
1296+ int sec = (int)lParam;
1297+
1298+ if (sec == -1)
1299+ {
1300+ EnableWindow(hMainWndScrollbarProgressWnd, FALSE);
1301+ progress_jump = -1;
1302+ }
1303+ else
1304+ {
1305+ EnableWindow(hMainWndScrollbarProgressWnd, TRUE);
1306+ if (progress_jump == -1)
1307+ SetScrollPos(hMainWndScrollbarProgressWnd, SB_CTL, sec, TRUE);
1308+ }
1309+ return TRUE;
1310+ }
1311+
12921312 default:
12931313 if (uMess == RegisterWindowMessage("TaskbarCreated")) {
12941314 ShowWindow(hMainWnd, SW_HIDE);
@@ -1836,7 +1856,7 @@ void DebugThreadInit(void)
18361856 if(!DebugThreadExit)
18371857 return;
18381858 hDebugThread = crt_beginthreadex(NULL,0,(LPTHREAD_START_ROUTINE)DebugThread,0,0,&dwThreadID);
1839- set_thread_description((ptr_size_t)hDebugThread, "W32G Debug Thread");
1859+ set_thread_description((ptr_size_t)hDebugThread, "W32G Debug Thread");
18401860 }
18411861 #endif
18421862
@@ -3125,7 +3145,7 @@ static void CanvasPaintDo(void)
31253145 void CanvasPaint(void)
31263146 {
31273147 Canvas.PaintDone = 0;
3128- UpdateWindow(hCanvasWnd);
3148+ //UpdateWindow(hCanvasWnd);
31293149 }
31303150 void CanvasPaintAll(void)
31313151 {
@@ -4291,7 +4311,7 @@ static void MPanelPaintDo(void)
42914311 // 描画
42924312 void MPanelPaint(void)
42934313 {
4294- UpdateWindow(hPanelWnd);
4314+ //UpdateWindow(hPanelWnd);
42954315 }
42964316
42974317 // 完全描画
@@ -4369,7 +4389,7 @@ void MPanelReadPanelInfo(int flag)
43694389 MPanel.Beat = Panel->beat;
43704390 MPanel.UpdateFlag |= MP_UPDATE_METRONOME;
43714391 }
4372- if (flag || MPanel.Keysig != Panel->keysig) {
4392+ if (flag || strcmp(MPanel.Keysig, Panel->keysig) != 0) {
43734393 strcpy(MPanel.Keysig, Panel->keysig);
43744394 MPanel.UpdateFlag |= MP_UPDATE_KEYSIG;
43754395 }
@@ -5773,27 +5793,12 @@ void w32g_ctle_play_start(int sec)
57735793
57745794 void MainWndScrollbarProgressUpdate(int sec)
57755795 {
5776- static int lastsec = -1, enabled = 0;
5796+ static int lastsec = -1;
57775797
57785798 if(sec == lastsec)
57795799 return;
57805800
5781- if(sec == -1)
5782- {
5783- EnableWindow(hMainWndScrollbarProgressWnd, FALSE);
5784- enabled = 0;
5785- progress_jump = -1;
5786- }
5787- else
5788- {
5789- if(!enabled)
5790- {
5791- EnableWindow(hMainWndScrollbarProgressWnd, TRUE);
5792- enabled = 1;
5793- }
5794- if(progress_jump == -1)
5795- SetScrollPos(hMainWndScrollbarProgressWnd, SB_CTL, sec, TRUE);
5796- }
5801+ PostMessage(hMainWnd, WM_UPDATE_SCROLLBAR_PROGRESS, 0, (LPARAM)sec);
57975802 lastsec = sec;
57985803 }
57995804
--- a/interface/w32g_pref.c
+++ b/interface/w32g_pref.c
@@ -7724,7 +7724,6 @@ int vorbis_ConfigDialogInfoSaveINI(void)
77247724 char *inifile = timidity_output_inifile;
77257725 char buffer[1024];
77267726 // int len;
7727-// int len;
77287727 #define NUMSAVE(name) \
77297728 sprintf(buffer,"%d",vorbis_ConfigDialogInfo.name ); \
77307729 WritePrivateProfileString(section, #name ,buffer,inifile);
--- a/interface/w32g_utl.h
+++ b/interface/w32g_utl.h
@@ -335,7 +335,7 @@ extern void ApplySettingTiMidity(SETTING_TIMIDITY *st);
335335 extern void SaveSettingTiMidity(SETTING_TIMIDITY *st);
336336 extern void SettingCtlFlag(SETTING_TIMIDITY *st, int opt_id, int onoff);
337337 extern int IniVersionCheck(void);
338-extern void BitBltRect(HDC dst, HDC src, RECT *rc);
338+extern void BitBltRect(HDC dst, HDC src, const RECT *rc);
339339 extern BOOL SafeGetOpenFileName(LPOPENFILENAMEA lpofn);
340340 extern BOOL SafeGetSaveFileName(LPOPENFILENAMEA lpofn);
341341 #if 0
--- a/timidity/effect.c
+++ b/timidity/effect.c
@@ -2506,23 +2506,9 @@ static void do_drive_mono(Drive *drv, DATA_T *inout)
25062506 int32 index;
25072507 FLOAT_T in, sign, v1, v2, fp;
25082508
2509- static FLOAT_T max = 0, avg = 0, sum = 0;
2510- static int32 tc = 0;
2511-
2512-
2513-
2514-
25152509 in = *inout;
25162510 sign = (in < 0) ? (-1.0) : (1.0);
25172511 in *= drv->cnv * sign;
2518-
2519- if(in > 1 && in > max)
2520- max = in;
2521- ++tc;
2522- sum += in;
2523- avg = sum / (FLOAT_T)tc;
2524-
2525-
25262512 fp = floor(in);
25272513 index = fp;
25282514 fp = in - fp;
--- a/timidity/effect.h
+++ b/timidity/effect.h
@@ -505,9 +505,9 @@ int32
505505 in: 0.0 ~ 8.0 (1.0: 1<<(DRIVE_INPUT_BIT) , DRIVE_SCALE_BIT+DRIVE_BASE_BIT+FRACTION_BITS < 30bit
506506 out: 0.0 ~ 8.0 * clip_level
507507 */
508-#define DRIVE_SCALE_BIT (3) // 1.0 * 2^MATH_SCALE_BIT
508+#define DRIVE_SCALE_BIT (2) // 1.0 * 2^MATH_SCALE_BIT
509509 #define DRIVE_SCALE_MAX (1 << DRIVE_SCALE_BIT) // table max 1.0 * MATH_SCALE_MAX
510-#define DRIVE_BASE_BIT (6) // 0.0~1.0 table size
510+#define DRIVE_BASE_BIT (8) // 0.0~1.0 table size
511511 #define DRIVE_BASE_LENGTH (1 << (DRIVE_BASE_BIT)) // 0.0~1.0:table size
512512 #define DRIVE_TABLE_LENGTH (1 << (DRIVE_BASE_BIT + DRIVE_SCALE_BIT)) // 0.0~1.0 * MATH_SCALE_MAX table size
513513 #define DRIVE_FRAC_BIT (14) // for int32
--- a/timidity/flac_a.c
+++ b/timidity/flac_a.c
@@ -571,20 +571,6 @@ static int flac_output_open(const char *fname, const char *comment)
571571 }
572572 #endif
573573
574- metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT);
575- if (metadata[num_metadata]) {
576- const char *vendor_string = "Encoded with Timidity++";
577- /* Location=output_name */
578- memset(&commentry, 0, sizeof(commentry));
579- FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&commentry, "LOCATION", comment);
580- FLAC__metadata_object_vorbiscomment_append_comment(metadata[num_metadata], commentry, false);
581- /* Comment=vendor_string */
582- memset(&vendentry, 0, sizeof(vendentry));
583- FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&vendentry, "COMMENT", vendor_string);
584- FLAC__metadata_object_vorbiscomment_append_comment(metadata[num_metadata], vendentry, false);
585- num_metadata++;
586- }
587-
588574 if (0 < flac_options.padding) {
589575 metadata[num_metadata] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING);
590576 if (metadata[num_metadata]) {
--- a/timidity/thread_effect.c
+++ b/timidity/thread_effect.c
@@ -1970,6 +1970,8 @@ void init_effect_buffer_thread(void)
19701970 memset(delay_effect_buffer_sub, 0, sizeof(delay_effect_buffer_sub));
19711971 memset(reverb_effect_buffer_sub, 0, sizeof(reverb_effect_buffer_sub));
19721972
1973+ memset(master_effect_buffer_thread, 0, sizeof(master_effect_buffer_thread));
1974+
19731975 reset_effect_thread_var();
19741976 }
19751977
--- a/timidity/timidity.c
+++ b/timidity/timidity.c
@@ -6075,7 +6075,6 @@ static int parse_opt_h(const char *arg)
60756075 " Embed loop information",
60766076 #endif /* SUPPORT_LOOPEVENT */
60776077 #endif /* AU_VORBIS */
6078-" --output-device-id=n",
60796078 #ifdef AU_W32
60806079 " --wmme-device-id=n (for Windows only)",
60816080 " Number of WMME device ID (-1: Default device, 0..19: other)",
@@ -6153,6 +6152,7 @@ static int parse_opt_h(const char *arg)
61536152 " -o file --output-file=file",
61546153 " Output to another file (or device/server) (Use \"-\" for stdout)",
61556154 #if defined(AU_PORTAUDIO) || defined(AU_WIN32)
6155+" --output-device-id=n",
61566156 " Set the output device no. (-1 shows available device no. list)",
61576157 #endif
61586158 " -P file --patch-file=file",
@@ -6217,12 +6217,16 @@ static int parse_opt_h(const char *arg)
62176217 #endif /* __W32__ */
62186218 " -x str --config-string=str",
62196219 " Read configuration str from command line argument",
6220+" -Y n --compute-buffer=n",
6221+" Set the size of the compute buffer",
62206222 " -Z file --freq-table=file",
62216223 " Load frequency table (Use \"pure\" for pure intonation)",
62226224 " pure<n>(m) --pure-intonation=n(m)",
62236225 " Initial keysig number <n> of sharp(+)/flat(-) (-7..7)",
62246226 " 'm' stands for minor mode",
62256227 ///r
6228+" --master-volume=n",
6229+" Amplify output volume by n percent",
62266230 " --module=n",
62276231 " Simulate behavior of specific synthesizer module by n",
62286232 " n=0 : TiMidity++ Default (default)",
@@ -6238,10 +6242,10 @@ static int parse_opt_h(const char *arg)
62386242 " 112-127 : TiMidity++ specification purposes",
62396243 " --max-channel-voices=n",
62406244 " Set the manimum number of voices per channel",
6241-" --mix-envelope=n",
6245+" --mix-envelope=n",
62426246 " --modulation-update=n",
6243-" --cut-short-time=msec",
6244-" --limiter=n (gain per)",
6247+" --cut-short-time=msec",
6248+" --limiter=n (gain per)",
62456249 #ifdef SUPPORT_LOOPEVENT
62466250 " --loop-repeat=n",
62476251 " Set number of unwind repeat count",
@@ -9192,19 +9196,6 @@ int main(int argc, char **argv)
91929196 if (CoInitialize(NULL) == S_OK)
91939197 CoInitializeOK = 1;
91949198 w32g_initialize();
9195-#ifdef IA_W32GUI
9196- /* Secondary TiMidity Execute */
9197- /* FirstLoadIniFile(); */
9198- if (w32gSecondTiMidity(SecondMode, argc, argv, nfiles, files) == FALSE) {
9199- w32gSecondTiMidityExit();
9200- if (CoInitializeOK)
9201- CoUninitialize();
9202- w32g_free_playlist();
9203- w32g_uninitialize();
9204- w32g_free_doc();
9205- return 0;
9206- }
9207-#endif
92089199 for (c = 1; c < argc; c++)
92099200 if (is_directory(argv[c])) {
92109201 char *p;
@@ -9276,6 +9267,21 @@ int main(int argc, char **argv)
92769267 return 1; /* problems with command line */
92779268 #endif
92789269 }
9270+ nfiles = argc - optind;
9271+ files = argv + optind;
9272+#ifdef IA_W32GUI
9273+ /* Secondary TiMidity Execute */
9274+ /* FirstLoadIniFile(); */
9275+ if (w32gSecondTiMidity(SecondMode, argc, argv, nfiles, files) == FALSE) {
9276+ w32gSecondTiMidityExit();
9277+ if (CoInitializeOK)
9278+ CoUninitialize();
9279+ w32g_free_playlist();
9280+ w32g_uninitialize();
9281+ w32g_free_doc();
9282+ return 0;
9283+ }
9284+#endif
92799285 timidity_init_player();
92809286 ///r
92819287 load_all_instrument();
@@ -9286,8 +9292,6 @@ int main(int argc, char **argv)
92869292 #endif
92879293 begin_compute_thread();
92889294 #endif
9289- nfiles = argc - optind;
9290- files = argv + optind;
92919295 if (nfiles > 0
92929296 && ctl->id_character != 'r' && ctl->id_character != 'A'
92939297 && ctl->id_character != 'W' && ctl->id_character != 'N'
--- a/timidity/vorbis_a.c
+++ b/timidity/vorbis_a.c
@@ -234,7 +234,6 @@ static int ogg_output_open(const char *fname, const char *comment)
234234 #if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
235235 int bitrate;
236236 #endif
237- int location_commented = 0;
238237 int title_commented = 0;
239238
240239 #ifdef AU_VORBIS_DLL
@@ -261,8 +260,6 @@ static int ogg_output_open(const char *fname, const char *comment)
261260
262261 if(strcmp(fname, "-") == 0) {
263262 fd = 1; /* data to stdout */
264- if(comment == NULL)
265- comment = "(stdout)";
266263 } else {
267264 /* Open the audio file */
268265 fd = open(fname, FILE_UPDATE_MODE);
@@ -271,8 +268,6 @@ static int ogg_output_open(const char *fname, const char *comment)
271268 fname, strerror(errno));
272269 return -1;
273270 }
274- if(comment == NULL)
275- comment = fname;
276271 }
277272
278273 has_loopinfo = 0;
@@ -307,8 +302,6 @@ static int ogg_output_open(const char *fname, const char *comment)
307302 VorbisCommentInfo *info = ogg_vorbis_comment_list;
308303
309304 while (info) {
310- if (strcmp(info->tag, "LOCATION") == 0)
311- location_commented = 1;
312305 if (strcmp(info->tag, "TITLE") == 0)
313306 title_commented = 1;
314307
@@ -317,36 +310,9 @@ static int ogg_output_open(const char *fname, const char *comment)
317310 }
318311 }
319312
320- if (!location_commented)
321- {
322- /* add a comment */
323- char *location_string;
324-
325- location_string =
326- (char *)safe_malloc(strlen(comment) + sizeof("LOCATION=") + 2);
327- strcpy(location_string, "LOCATION=");
328- strcat(location_string, comment);
329-#if defined(__W32__) && (defined(VORBIS_DLL_UNICODE) && (defined(_UNICODE) || defined(UNICODE)))
330- {
331- char* location_string_utf8 = w32_mbs_to_utf8 ( location_string );
332- if ( location_string_utf8 == NULL ) {
333- vorbis_comment_add(&vc, (char *)location_string);
334- } else {
335- vorbis_comment_add(&vc, (char *)location_string_utf8);
336- if ( location_string_utf8 != location_string )
337- free ( location_string_utf8 );
338- }
339- free(location_string);
340- }
341-#else
342- vorbis_comment_add(&vc, (char *)location_string);
343- free(location_string);
344-#endif
345- }
346-
347313 if (tag_title != NULL && !title_commented) {
348314 /* add default tag */
349-#if defined(__W32__) && (defined(VORBIS_DLL_UNICODE) && (defined(_UNICODE) || defined(UNICODE)))
315+#if defined(__W32__) && !(defined(_UNICODE) || defined(UNICODE))
350316 {
351317 char* tag_title_utf8 = w32_mbs_to_utf8 ( tag_title );
352318 if ( tag_title_utf8 == NULL ) {
Show on old repository browser