📄 w32g_pref.c
字号:
break; case WM_MYSAVE: if ( initflag ) break; { int i; char *p; st_temp->voices = GetDlgItemInt(hwnd,IDC_EDIT_VOICES,NULL,FALSE); st_temp->amplification = GetDlgItemInt(hwnd,IDC_EDIT_AMPLIFICATION,NULL,FALSE); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_FREE_INST,st_temp->free_instruments_afterwards); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_ANTIALIAS,st_temp->antialiasing_allowed); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_LOADINST_PLAYING,st_temp->opt_realtime_playing); st_temp->allocate_cache_size = GetDlgItemInt(hwnd,IDC_EDIT_CACHE_SIZE,NULL,FALSE); if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_REDUCE_VOICE,BM_GETCHECK,0,0)) { st_temp->reduce_voice_threshold = -1; st_temp->auto_reduce_polyphony = 1; } else { st_temp->reduce_voice_threshold = 0; st_temp->auto_reduce_polyphony = 0; } st_temp->default_tonebank = GetDlgItemInt(hwnd,IDC_EDIT_DEFAULT_TONEBANK,NULL,FALSE); if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_SPECIAL_TONEBANK,BM_GETCHECK,0,0)){ st_temp->special_tonebank = GetDlgItemInt(hwnd,IDC_EDIT_SPECIAL_TONEBANK,NULL,TRUE); } else { st_temp->special_tonebank = -1; } if(SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_GS,BM_GETCHECK,0,0)){ st_temp->opt_default_mid = 0x41; } else if(SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_XG,BM_GETCHECK,0,0)){ st_temp->opt_default_mid = 0x43; } else st_temp->opt_default_mid = 0x7e; SettingCtlFlag(st_temp, 't', DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_CTL_TRACE_PLAYING,i)); /* remove 'v' and 'q' from st_temp->opt_ctl */ while(strchr(st_temp->opt_ctl + 1, 'v')) SettingCtlFlag(st_temp, 'v', 0); while(strchr(st_temp->opt_ctl + 1, 'q')) SettingCtlFlag(st_temp, 'q', 0); /* append 'v' or 'q' */ p = st_temp->opt_ctl + strlen(st_temp->opt_ctl); i = GetDlgItemInt(hwnd,IDC_EDIT_CTL_VEBOSITY,NULL,TRUE); while(i > 1) { *p++ = 'v'; i--; } while(i < 1) { *p++ = 'q'; i++; } st_temp->control_ratio = GetDlgItemInt(hwnd,IDC_EDIT_CONTROL_RATIO,NULL,FALSE); st_temp->opt_drum_power = GetDlgItemInt(hwnd,IDC_EDIT_DRUM_POWER,NULL,FALSE); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_AMP_COMPENSATION,st_temp->opt_amp_compensation); DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHECKBOX_PURE_INTONATION, st_temp->opt_pure_intonation); if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_PURE_INTONATION, BM_GETCHECK, 0, 0) && SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_KEYSIG, BM_GETCHECK, 0, 0)) st_temp->opt_init_keysig = SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0) + ((SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_GETCHECK, 0, 0)) ? 16 : 0) - 7; else st_temp->opt_init_keysig = 8; st_temp->key_adjust = GetDlgItemInt(hwnd, IDC_EDIT_KEY_ADJUST, NULL, TRUE); if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_FORCE_KEYSIG, BM_GETCHECK, 0, 0)) st_temp->opt_force_keysig = SendDlgItemMessage(hwnd, IDC_COMBO_FORCE_KEYSIG, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0) - 7; else st_temp->opt_force_keysig = 8; SetWindowLong(hwnd,DWL_MSGRESULT,FALSE); } break; case WM_SIZE: return FALSE; case WM_CLOSE: break; default: break; } return FALSE;}// IDC_COMBO_SAMPLE_RATE#define cb_num_IDC_COMBO_SAMPLE_RATE 10static char *cb_info_IDC_COMBO_SAMPLE_RATE[] = { "4000", "8000", "11025", "16000", "22050", "24000", "32000", "40000", "44100", "48000",};// IDC_COMBO_BANDWIDTH#define cb_num_IDC_COMBO_BANDWIDTH 3enum { BANDWIDTH_8BIT = 0, BANDWIDTH_16BIT = 1, BANDWIDTH_24BIT = 2,};static char *cb_info_IDC_COMBO_BANDWIDTH_en[] = { "8-bit", "16-bit", "24-bit",};static char *cb_info_IDC_COMBO_BANDWIDTH_jp[] = { "8價僢僩", "16價僢僩", "24價僢僩",};static char **cb_info_IDC_COMBO_BANDWIDTH;// IDC_COMBO_OUTPUT_MODEstatic char *cb_info_IDC_COMBO_OUTPUT_MODE_jp[]= { "埲壓偺僼傽僀儖偵弌椡",(char *)0,#if defined(__CYGWIN32__) || defined(__MINGW32__) "僼傽僀儖柤傪帺摦偱寛掕偟丄僜\乕僗偲摨偠僼僅儖僟偵弌椡",(char *)1,#else "僼傽僀儖柤傪帺摦偱寛掕偟丄僜乕僗偲摨偠僼僅儖僟偵弌椡",(char *)1,#endif "僼傽僀儖柤傪帺摦偱寛掕偟丄埲壓偺僼僅儖僟偵弌椡",(char *)2, "僼傽僀儖柤傪帺摦偱寛掕偟丄埲壓偺僼僅儖僟偵弌椡(僼僅儖僟柤晅偒)",(char *)3, NULL};static char *cb_info_IDC_COMBO_OUTPUT_MODE_en[]= { "next output file",(char *)0, "auto filename",(char *)1, "auto filename and output in next dir",(char *)2, "auto filename and output in next dir (with folder name)",(char *)3, NULL};static char **cb_info_IDC_COMBO_OUTPUT_MODE;static BOOL APIENTRYPrefTiMidity3DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam){ static int initflag = 1; switch (uMess){ case WM_INITDIALOG: { int i; SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT,CB_RESETCONTENT,(WPARAM)0,(LPARAM)0); for(i=0;play_mode_list[i]!=0;i++){ SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT,CB_INSERTSTRING,(WPARAM)-1,(LPARAM)play_mode_list[i]->id_name); } if (PlayerLanguage == LANGUAGE_JAPANESE) cb_info_IDC_COMBO_OUTPUT_MODE = cb_info_IDC_COMBO_OUTPUT_MODE_jp; else cb_info_IDC_COMBO_OUTPUT_MODE = cb_info_IDC_COMBO_OUTPUT_MODE_en; for(i=0;cb_info_IDC_COMBO_OUTPUT_MODE[i];i+=2){ SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT_MODE,CB_INSERTSTRING,(WPARAM)-1,(LPARAM)cb_info_IDC_COMBO_OUTPUT_MODE[i]); } { int cb_num; for(cb_num=0;(int)cb_info_IDC_COMBO_OUTPUT_MODE[cb_num];cb_num+=2){ SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT_MODE,CB_SETCURSEL,(WPARAM)0,(LPARAM)0); if(st_temp->auto_output_mode==(int)cb_info_IDC_COMBO_OUTPUT_MODE[cb_num+1]){ SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT_MODE,CB_SETCURSEL,(WPARAM)cb_num/2,(LPARAM)0); break; } } } } { char *opt; int num = 0; int i; for(i=0;play_mode_list[i]!=0;i++){ if(st_temp->opt_playmode[0]==play_mode_list[i]->id_character){ num = i; break; } } SendDlgItemMessage(hwnd,IDC_COMBO_OUTPUT,CB_SETCURSEL,(WPARAM)num,(LPARAM)0); if(st_temp->auto_output_mode==0){ if(st_temp->OutputName[0]=='\0') SetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,TEXT("output.wav")); else SetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,TEXT(st_temp->OutputName)); } else SetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,st_temp->OutputDirName); opt = st_temp->opt_playmode + 1; if(strchr(opt, 'U')){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,0,0); } else if(strchr(opt, 'A')){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } // BANDWIDTH if (PlayerLanguage == LANGUAGE_JAPANESE) cb_info_IDC_COMBO_BANDWIDTH = cb_info_IDC_COMBO_BANDWIDTH_jp; else cb_info_IDC_COMBO_BANDWIDTH = cb_info_IDC_COMBO_BANDWIDTH_en; for (i = 0; i < cb_num_IDC_COMBO_BANDWIDTH; i++) SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info_IDC_COMBO_BANDWIDTH[i]); if (strchr(opt, '2')) { // 24-bit SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_SETCURSEL, (WPARAM) BANDWIDTH_24BIT, (LPARAM) 0); } else if (strchr(opt, '1')) { // 16-bit SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_SETCURSEL, (WPARAM) BANDWIDTH_16BIT, (LPARAM) 0); } else { // 8-bit SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_SETCURSEL, (WPARAM) BANDWIDTH_8BIT, (LPARAM) 0); } if(strchr(opt, 's')){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,1,0); } if(strchr(opt, 'x')){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_BYTESWAP,BM_SETCHECK,1,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_BYTESWAP,BM_SETCHECK,0,0); } if(strchr(opt, 'M')){ SendDlgItemMessage(hwnd,IDC_RADIO_STEREO,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_RADIO_MONO,BM_SETCHECK,1,0); } else { SendDlgItemMessage(hwnd,IDC_RADIO_STEREO,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_RADIO_MONO,BM_SETCHECK,0,0); } // SAMPLE_RATE for (i = 0; i < cb_num_IDC_COMBO_SAMPLE_RATE; i++) SendDlgItemMessage(hwnd, IDC_COMBO_SAMPLE_RATE, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info_IDC_COMBO_SAMPLE_RATE[i]); SetDlgItemInt(hwnd, IDC_COMBO_SAMPLE_RATE, st_temp->output_rate, FALSE); } initflag = 0; break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCLOSE: break; case IDC_BUTTON_OUTPUT_FILE: { char filename[MAXPATH+1]; filename[0] = '\0'; SendDlgItemMessage(hwnd,IDC_EDIT_OUTPUT_FILE,WM_GETTEXT, (WPARAM)MAX_PATH,(LPARAM)TEXT(filename)); if(!DlgOpenOutputFile(filename,hwnd)) if(filename[0]!='\0') SetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,TEXT(filename)); } break; case IDC_BUTTON_OUTPUT_FILE_DEL: { char filename[MAXPATH+1]; DWORD res; if(st_temp->auto_output_mode>0){ break; } GetDlgItemText(hwnd,IDC_EDIT_OUTPUT_FILE,filename,(WPARAM)MAX_PATH); res = GetFileAttributes(filename); if(res!=0xFFFFFFFF && !(res & FILE_ATTRIBUTE_DIRECTORY)){ if(DeleteFile(filename)!=TRUE){ char buffer[MAXPATH + 1024]; sprintf(buffer,"Can't delete file %s !",filename); MessageBox(NULL,buffer,"Error!", MB_OK); } else { char buffer[MAXPATH + 1024]; sprintf(buffer,"Delete file %s !",filename); MessageBox(NULL,buffer,"Delete!", MB_OK); } } } break; case IDC_CHECKBOX_ULAW: if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_GETCHECK,0,0)){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_SETCURSEL, (WPARAM) BANDWIDTH_8BIT, (LPARAM) 0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_BYTESWAP,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } break; case IDC_CHECKBOX_ALAW: if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_GETCHECK,0,0)){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd, IDC_COMBO_BANDWIDTH, CB_SETCURSEL, (WPARAM) BANDWIDTH_8BIT, (LPARAM) 0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_BYTESWAP,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } break; case IDC_CHECKBOX_LINEAR: if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_GETCHECK,0,0)){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } break; case IDC_CHECKBOX_SIGNED: if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_GETCHECK,0,0)){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } break; case IDC_CHECKBOX_UNSIGNED: if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_GETCHECK,0,0)){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_SIGNED,BM_SETCHECK,1,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_UNSIGNED,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ULAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_ALAW,BM_SETCHECK,0,0); SendDlgItemMessage(hwnd,IDC_CHECKBOX_LINEAR,BM_SETCHECK,1,0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -