📄 w32g_pref.c
字号:
CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info[i]); SendDlgItemMessage(hwnd, IDC_COMBO_DELAY, CB_SETCURSEL, (WPARAM) st_temp->opt_delay_control, (LPARAM) 0); // DEFAULT MODULE for (i = 0; i < cb_num_IDC_COMBO_MODULE; i++) SendDlgItemMessage(hwnd, IDC_COMBO_MODULE, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info_IDC_COMBO_MODULE[i].name); SendDlgItemMessage(hwnd, IDC_COMBO_MODULE, CB_SETCURSEL, (WPARAM) find_combo_module_item(st_temp->opt_default_module), (LPARAM) 0); // LPF if (PlayerLanguage == LANGUAGE_JAPANESE) cb_info = cb_info_IDC_COMBO_LPF_jp; else cb_info = cb_info_IDC_COMBO_LPF_en; for (i = 0; i < cb_num_IDC_COMBO_LPF; i++) SendDlgItemMessage(hwnd, IDC_COMBO_LPF, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info[i]); SendDlgItemMessage(hwnd, IDC_COMBO_LPF, CB_SETCURSEL, (WPARAM) st_temp->opt_lpf_def, (LPARAM) 0); // L&R DELAY SetDlgItemInt(hwnd,IDC_EDIT_DELAY,st_temp->effect_lr_delay_msec,TRUE); if(st_temp->effect_lr_mode<0){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_DELAY,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_DELAY,BM_SETCHECK,1,0); switch(st_temp->effect_lr_mode){ case 0: CheckRadioButton(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,IDC_RADIOBUTTON_DELAY_CENTER, IDC_RADIOBUTTON_DELAY_LEFT); break; case 1: CheckRadioButton(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,IDC_RADIOBUTTON_DELAY_CENTER, IDC_RADIOBUTTON_DELAY_RIGHT); break; case 2: default: CheckRadioButton(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,IDC_RADIOBUTTON_DELAY_CENTER, IDC_RADIOBUTTON_DELAY_CENTER); break; } } SendMessage(hwnd,WM_COMMAND,IDC_CHECKBOX_DELAY,0); // NOISESHARPING SetDlgItemInt(hwnd,IDC_EDIT_NOISESHARPING,st_temp->noise_sharp_type,TRUE); // Misc DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_MODWHEEL,st_temp->opt_modulation_wheel); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_PORTAMENTO,st_temp->opt_portamento); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_NRPNVIB,st_temp->opt_nrpn_vibrato); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CHPRESS,st_temp->opt_channel_pressure); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_OVOICE,st_temp->opt_overlap_voice_allow); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TRACETEXT,st_temp->opt_trace_text_meta_event); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TVAA,st_temp->opt_tva_attack); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TVAD,st_temp->opt_tva_decay); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_TVAR,st_temp->opt_tva_release); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_DRUM_EFFECT,st_temp->opt_drum_effect); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_MOD_ENV,st_temp->opt_modulation_envelope); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_PAN_DELAY,st_temp->opt_pan_delay); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_EQ,st_temp->opt_eq_control); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_IEFFECT,st_temp->opt_insertion_effect); SetDlgItemInt(hwnd,IDC_EDIT_MODIFY_RELEASE,st_temp->modify_release,TRUE); initflag = 0; break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCLOSE: break; case IDC_CHECKBOX_CHORUS_LEVEL: if(SendDlgItemMessage(hwnd, IDC_CHECKBOX_CHORUS_LEVEL, BM_GETCHECK, 0, 0)){ EnableWindow(GetDlgItem(hwnd, IDC_EDIT_CHORUS), TRUE); } else { EnableWindow(GetDlgItem(hwnd, IDC_EDIT_CHORUS), FALSE); } break; case IDC_CHECKBOX_REVERB_LEVEL: if(SendDlgItemMessage(hwnd, IDC_CHECKBOX_REVERB_LEVEL, BM_GETCHECK, 0, 0)){ EnableWindow(GetDlgItem(hwnd, IDC_EDIT_REVERB), TRUE); } else { EnableWindow(GetDlgItem(hwnd, IDC_EDIT_REVERB), FALSE); } break; case IDC_CHECKBOX_DELAY: case IDC_RADIOBUTTON_DELAY_LEFT: case IDC_RADIOBUTTON_DELAY_RIGHT: case IDC_RADIOBUTTON_DELAY_CENTER: if(!SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,BM_GETCHECK,0,0)) if(!SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_DELAY_RIGHT,BM_GETCHECK,0,0)) if(!SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_DELAY_CENTER,BM_GETCHECK,0,0)) CheckRadioButton(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,IDC_RADIOBUTTON_DELAY_CENTER,IDC_RADIOBUTTON_DELAY_CENTER); if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_DELAY,BM_GETCHECK,0,0)){ EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_LEFT),TRUE); EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_RIGHT),TRUE); EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_CENTER),TRUE); EnableWindow(GetDlgItem(hwnd,IDC_EDIT_DELAY),TRUE); } else { EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_LEFT),FALSE); EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_RIGHT),FALSE); EnableWindow(GetDlgItem(hwnd,IDC_RADIOBUTTON_DELAY_CENTER),FALSE); EnableWindow(GetDlgItem(hwnd,IDC_EDIT_DELAY),FALSE); } break; default: PrefWndSetOK = 1; return FALSE; break; } PrefWndSetOK = 1; break; case WM_MYSAVE: { if ( initflag ) break; // CHORUS st_temp->opt_chorus_control = (int)SendDlgItemMessage(hwnd, IDC_COMBO_CHORUS, CB_GETCURSEL, 0, 0); if (st_temp->opt_chorus_control && SendDlgItemMessage(hwnd, IDC_CHECKBOX_CHORUS_LEVEL, BM_GETCHECK, 0, 0)) { st_temp->opt_chorus_control = -(int)GetDlgItemInt(hwnd, IDC_EDIT_CHORUS, NULL, TRUE); } if (st_temp->opt_chorus_control == 2) { st_temp->opt_chorus_control = 1; st_temp->opt_surround_chorus = 1; } else { st_temp->opt_surround_chorus = 0; } // REVERB st_temp->opt_reverb_control = (int)SendDlgItemMessage(hwnd, IDC_COMBO_REVERB, CB_GETCURSEL, 0, 0); if(st_temp->opt_reverb_control && SendDlgItemMessage(hwnd, IDC_CHECKBOX_REVERB_LEVEL, BM_GETCHECK, 0, 0)) { st_temp->opt_reverb_control = -(int)GetDlgItemInt(hwnd, IDC_EDIT_REVERB, NULL, TRUE) - (st_temp->opt_reverb_control - 1) * 128; } // DELAY st_temp->opt_delay_control = (int)SendDlgItemMessage(hwnd, IDC_COMBO_DELAY, CB_GETCURSEL, 0, 0); // DEFAULT MODULE st_temp->opt_default_module = cb_info_IDC_COMBO_MODULE[(int)SendDlgItemMessage(hwnd, IDC_COMBO_MODULE, CB_GETCURSEL, 0, 0)].num; // LPF st_temp->opt_lpf_def = (int)SendDlgItemMessage(hwnd, IDC_COMBO_LPF, CB_GETCURSEL, 0, 0); // L&R DELAY st_temp->effect_lr_delay_msec = GetDlgItemInt(hwnd,IDC_EDIT_DELAY,NULL,FALSE); if(SendDlgItemMessage(hwnd,IDC_CHECKBOX_DELAY,BM_GETCHECK,0,0)){ if(SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_DELAY_LEFT,BM_GETCHECK,0,0)){ st_temp->effect_lr_mode = 0; } else if(SendDlgItemMessage(hwnd,IDC_RADIOBUTTON_DELAY_RIGHT,BM_GETCHECK,0,0)){ st_temp->effect_lr_mode = 1; } else { st_temp->effect_lr_mode = 2; } } else { st_temp->effect_lr_mode = -1; } // NOISESHARPING st_temp->noise_sharp_type = GetDlgItemInt(hwnd,IDC_EDIT_NOISESHARPING,NULL,FALSE); // Misc DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_MODWHEEL,st_temp->opt_modulation_wheel); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_PORTAMENTO,st_temp->opt_portamento); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_NRPNVIB,st_temp->opt_nrpn_vibrato); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_CHPRESS,st_temp->opt_channel_pressure); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_OVOICE,st_temp->opt_overlap_voice_allow); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_TRACETEXT,st_temp->opt_trace_text_meta_event); st_temp->modify_release = GetDlgItemInt(hwnd,IDC_EDIT_MODIFY_RELEASE,NULL,FALSE); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_TVAA,st_temp->opt_tva_attack); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_TVAD,st_temp->opt_tva_decay); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_TVAR,st_temp->opt_tva_release); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_DRUM_EFFECT,st_temp->opt_drum_effect); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_MOD_ENV,st_temp->opt_modulation_envelope); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_PAN_DELAY,st_temp->opt_pan_delay); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_EQ,st_temp->opt_eq_control); DLG_CHECKBUTTON_TO_FLAG(hwnd,IDC_CHECKBOX_IEFFECT,st_temp->opt_insertion_effect); SetWindowLong(hwnd,DWL_MSGRESULT,FALSE); } break; case WM_SIZE: return FALSE; case WM_CLOSE: break; default: break; } return FALSE;}static int char_count(char *s, int c){ int n = 0; while(*s) n += (*s++ == c); return n;}// IDC_COMBO_(INIT|FORCE)_KEYSIGstatic char *cb_info_IDC_COMBO_KEYSIG[] = { "Cb Maj / Ab Min (b7)", "Gb Maj / Eb Min (b6)", "Db Maj / Bb Min (b5)", "Ab Maj / F Min (b4)", "Eb Maj / C Min (b3)", "Bb Maj / G Min (b2)", "F Maj / D Min (b1)", "C Maj / A Min (0)", "G Maj / E Min (#1)", "D Maj / B Min (#2)", "A Maj / F# Min (#3)", "E Maj / C# Min (#4)", "B Maj / G# Min (#5)", "F# Maj / D# Min (#6)", "C# Maj / A# Min (#7)"};static BOOL APIENTRYPrefTiMidity2DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam){ int i; static int initflag = 1; switch (uMess){ case WM_INITDIALOG: SetDlgItemInt(hwnd,IDC_EDIT_VOICES,st_temp->voices,FALSE); SetDlgItemInt(hwnd,IDC_EDIT_AMPLIFICATION,st_temp->amplification,FALSE); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_FREE_INST,st_temp->free_instruments_afterwards); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_ANTIALIAS,st_temp->antialiasing_allowed); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_LOADINST_PLAYING,st_temp->opt_realtime_playing); SetDlgItemInt(hwnd,IDC_EDIT_CACHE_SIZE,st_temp->allocate_cache_size,FALSE); SetDlgItemInt(hwnd,IDC_EDIT_REDUCE_VOICE,st_temp->reduce_voice_threshold,TRUE); SendDlgItemMessage(hwnd,IDC_CHECKBOX_REDUCE_VOICE,BM_SETCHECK,st_temp->reduce_voice_threshold,0); SetDlgItemInt(hwnd,IDC_EDIT_DEFAULT_TONEBANK,st_temp->default_tonebank,FALSE); SetDlgItemInt(hwnd,IDC_EDIT_SPECIAL_TONEBANK,st_temp->special_tonebank,TRUE); if(st_temp->special_tonebank<0){ SendDlgItemMessage(hwnd,IDC_CHECKBOX_SPECIAL_TONEBANK,BM_SETCHECK,0,0); } else { SendDlgItemMessage(hwnd,IDC_CHECKBOX_SPECIAL_TONEBANK,BM_SETCHECK,1,0); } SendMessage(hwnd,WM_COMMAND,IDC_CHECKBOX_SPECIAL_TONEBANK,0); switch(st_temp->opt_default_mid){ case 0x41: CheckRadioButton(hwnd,IDC_RADIOBUTTON_GM,IDC_RADIOBUTTON_XG,IDC_RADIOBUTTON_GS); break; case 0x43: CheckRadioButton(hwnd,IDC_RADIOBUTTON_GM,IDC_RADIOBUTTON_XG,IDC_RADIOBUTTON_XG); break; default: case 0x7e: CheckRadioButton(hwnd,IDC_RADIOBUTTON_GM,IDC_RADIOBUTTON_XG,IDC_RADIOBUTTON_GM); break; } DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_CTL_TRACE_PLAYING, strchr(st_temp->opt_ctl + 1, 't')); SetDlgItemInt(hwnd,IDC_EDIT_CTL_VEBOSITY, char_count(st_temp->opt_ctl + 1, 'v') - char_count(st_temp->opt_ctl + 1, 'q') + 1, TRUE); SetDlgItemInt(hwnd,IDC_EDIT_CONTROL_RATIO,st_temp->control_ratio,FALSE); SetDlgItemInt(hwnd,IDC_EDIT_DRUM_POWER,st_temp->opt_drum_power,FALSE); DLG_FLAG_TO_CHECKBUTTON(hwnd,IDC_CHECKBOX_AMP_COMPENSATION,st_temp->opt_amp_compensation); DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHECKBOX_PURE_INTONATION, st_temp->opt_pure_intonation); SendMessage(hwnd, WM_COMMAND, IDC_CHECKBOX_PURE_INTONATION, 0); DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHECKBOX_INIT_KEYSIG, (st_temp->opt_init_keysig != 8)); SendMessage(hwnd, WM_COMMAND, IDC_CHECKBOX_PURE_INTONATION, 0); for (i = 0; i < 15; i++) SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info_IDC_COMBO_KEYSIG[i]); if (st_temp->opt_init_keysig == 8) { SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL, (WPARAM) 7, (LPARAM) 0); SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK, 0, 0); } else { SendDlgItemMessage(hwnd, IDC_COMBO_INIT_KEYSIG, CB_SETCURSEL, (WPARAM) st_temp->opt_init_keysig + 7 & 0x0f, (LPARAM) 0); SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_MI, BM_SETCHECK, (st_temp->opt_init_keysig + 7 & 0x10) ? 1 : 0, 0); } SetDlgItemInt(hwnd, IDC_EDIT_KEY_ADJUST, st_temp->key_adjust, TRUE); DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHECKBOX_FORCE_KEYSIG, (st_temp->opt_force_keysig != 8)); SendMessage(hwnd, WM_COMMAND, IDC_CHECKBOX_FORCE_KEYSIG, 0); for (i = 0; i < 15; i++) SendDlgItemMessage(hwnd, IDC_COMBO_FORCE_KEYSIG, CB_INSERTSTRING, (WPARAM) -1, (LPARAM) cb_info_IDC_COMBO_KEYSIG[i]); if (st_temp->opt_force_keysig == 8) SendDlgItemMessage(hwnd, IDC_COMBO_FORCE_KEYSIG, CB_SETCURSEL, (WPARAM) 7, (LPARAM) 0); else SendDlgItemMessage(hwnd, IDC_COMBO_FORCE_KEYSIG, CB_SETCURSEL, (WPARAM) st_temp->opt_force_keysig + 7, (LPARAM) 0); initflag = 0; break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDCLOSE: break; case IDC_CHECKBOX_SPECIAL_TONEBANK: if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_SPECIAL_TONEBANK, BM_GETCHECK, 0, 0)) EnableWindow(GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK), TRUE); else EnableWindow(GetDlgItem(hwnd, IDC_EDIT_SPECIAL_TONEBANK), FALSE); break; case IDC_CHECKBOX_PURE_INTONATION: if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_PURE_INTONATION, BM_GETCHECK, 0, 0)) { EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_KEYSIG), TRUE); if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_KEYSIG, BM_GETCHECK, 0, 0)) { EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), TRUE); } else { EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE); } } else { EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_KEYSIG), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE); } break; case IDC_CHECKBOX_INIT_KEYSIG: if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_INIT_KEYSIG, BM_GETCHECK, 0, 0)) { EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), TRUE); } else { EnableWindow(GetDlgItem(hwnd, IDC_COMBO_INIT_KEYSIG), FALSE); EnableWindow(GetDlgItem(hwnd, IDC_CHECKBOX_INIT_MI), FALSE); } break; case IDC_COMBO_INIT_KEYSIG: case IDC_CHECKBOX_INIT_MI: 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; break; case IDC_CHECKBOX_FORCE_KEYSIG: if (SendDlgItemMessage(hwnd, IDC_CHECKBOX_FORCE_KEYSIG, BM_GETCHECK, 0, 0)) EnableWindow(GetDlgItem(hwnd, IDC_COMBO_FORCE_KEYSIG), TRUE); else EnableWindow(GetDlgItem(hwnd, IDC_COMBO_FORCE_KEYSIG), FALSE); break; case IDC_COMBO_FORCE_KEYSIG: st_temp->opt_force_keysig = SendDlgItemMessage(hwnd, IDC_COMBO_FORCE_KEYSIG, CB_GETCURSEL, (WPARAM) 0, (LPARAM) 0) - 7; break; default: break; } PrefWndSetOK = 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -