SetDlgItemInt(hwnd, IDC_EDIT_REVERB, -st_temp->opt_reverb_control, TRUE); 
SetDlgItemInt(hwnd, IDC_EDIT_REVERB, (-st_temp->opt_reverb_control) % 128, TRUE); 
PrefTiMidity1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam){	static int initflag = 1; 	int i;	char **cb_info;	switch (uMess){	case WM_INITDIALOG:		// CHORUS		if (PlayerLanguage == LANGUAGE_JAPANESE)			cb_info = cb_info_IDC_COMBO_CHORUS_jp;		else 			cb_info = cb_info_IDC_COMBO_CHORUS_en;		for (i = 0; i < cb_num_IDC_COMBO_CHORUS; i++)			SendDlgItemMessage(hwnd, IDC_COMBO_CHORUS,					CB_INSERTSTRING, (WPARAM) -1,					(LPARAM) cb_info[i]);		if(GetDlgItemInt(hwnd, IDC_EDIT_CHORUS, NULL, FALSE)==0)			SetDlgItemInt(hwnd, IDC_EDIT_CHORUS, 1, TRUE);		if (st_temp->opt_surround_chorus)			i = 2;		else			i = st_temp->opt_chorus_control;		if (i >= 0) {			SendDlgItemMessage(hwnd, IDC_COMBO_CHORUS, CB_SETCURSEL,					(WPARAM) i, (LPARAM) 0);			SendDlgItemMessage(hwnd, IDC_CHECKBOX_CHORUS_LEVEL, BM_SETCHECK, 0, 0);		} else {			SendDlgItemMessage(hwnd, IDC_COMBO_CHORUS, CB_SETCURSEL,					(WPARAM) ((-i) / 128 + 1), (LPARAM) 0);			SendDlgItemMessage(hwnd, IDC_CHECKBOX_CHORUS_LEVEL, BM_SETCHECK, 1, 0);			SetDlgItemInt(hwnd, IDC_EDIT_CHORUS, -i, TRUE);		}		SendMessage(hwnd, WM_COMMAND, IDC_CHECKBOX_CHORUS_LEVEL, 0);		// REVERB		if (PlayerLanguage == LANGUAGE_JAPANESE)			cb_info = cb_info_IDC_COMBO_REVERB_jp;		else 			cb_info = cb_info_IDC_COMBO_REVERB_en;		for (i = 0; i < cb_num_IDC_COMBO_REVERB; i++)			SendDlgItemMessage(hwnd, IDC_COMBO_REVERB,					CB_INSERTSTRING, (WPARAM) -1,					(LPARAM) cb_info[i]);		if(GetDlgItemInt(hwnd, IDC_EDIT_REVERB, NULL, FALSE)==0)			SetDlgItemInt(hwnd, IDC_EDIT_REVERB, 1, TRUE);		if (st_temp->opt_reverb_control >= 0) {			SendDlgItemMessage(hwnd, IDC_COMBO_REVERB, CB_SETCURSEL,					(WPARAM) st_temp->opt_reverb_control, (LPARAM) 0);			SendDlgItemMessage(hwnd, IDC_CHECKBOX_REVERB_LEVEL, BM_SETCHECK, 0, 0);		} else {			SendDlgItemMessage(hwnd, IDC_COMBO_REVERB, CB_SETCURSEL,					(WPARAM) ((-st_temp->opt_reverb_control) / 128 + 1), (LPARAM) 0);			SendDlgItemMessage(hwnd, IDC_CHECKBOX_REVERB_LEVEL, BM_SETCHECK, 1, 0);			SetDlgItemInt(hwnd, IDC_EDIT_REVERB, -st_temp->opt_reverb_control, TRUE);		}		SendMessage(hwnd, WM_COMMAND, IDC_CHECKBOX_REVERB_LEVEL, 0);		// DELAY		if (PlayerLanguage == LANGUAGE_JAPANESE)			cb_info = cb_info_IDC_COMBO_DELAY_jp;		else 			cb_info = cb_info_IDC_COMBO_DELAY_en;		for (i = 0; i < cb_num_IDC_COMBO_DELAY; i++)			SendDlgItemMessage(hwnd, IDC_COMBO_DELAY,					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;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/0ae2119c3ae9c5d4a3cff9a24203f7e7bedd79c0/w32g_pref.c/buggy/interface/w32g_pref.c