| version 1.2, 2004/08/05 16:47:27 | version 1.5, 2004/08/08 09:12:06 | 
| Line 1 | Line 1 | 
 | #include        "compiler.h" | #include        "compiler.h" | 
 |  | #include        <commctrl.h> | 
 | #include        "strres.h" | #include        "strres.h" | 
 | #include        "xmil.h" | #include        "xmil.h" | 
 | #include        "resource.h" | #include        "resource.h" | 
 | #include        "dosio.h" | #include        "dosio.h" | 
 | #include        "soundmng.h" | #include        "soundmng.h" | 
 | #include        "sysmng.h" | #include        "sysmng.h" | 
 |  | #include        "ini.h" | 
 | #include        "dialog.h" | #include        "dialog.h" | 
 | #include        "dialogs.h" | #include        "dialogs.h" | 
 |  |  | 
 | #include        "pccore.h" | #include        "pccore.h" | 
 | #include        "draw.h" |  | 
 | #include        "ini.h" |  | 
 | #include        "palettes.h" | #include        "palettes.h" | 
 |  | #include        "makescrn.h" | 
 |  |  | 
 |  |  | 
 | #define LIMITS(v, n, m)         (((v) > (m))?(m):(((v) < (n))?(n):(v))) | #define LIMITS(v, n, m)         (((v) > (m))?(m):(((v) < (n))?(n):(v))) | 
| Line 21  static const UINT32 ratehz[] = {48000, 4 | Line 21  static const UINT32 ratehz[] = {48000, 4 | 
 |  |  | 
 | static void cfgcreate(HWND hWnd) { | static void cfgcreate(HWND hWnd) { | 
 |  |  | 
| OEMCHAR         work[32]; | OEMCHAR work[32]; | 
| WORD            res; |  | 
 |  |  | 
 | dlgs_setlistuint32(hWnd, IDC_SAMPLERATE, ratehz, NELEMENTS(ratehz)); | dlgs_setlistuint32(hWnd, IDC_SAMPLERATE, ratehz, NELEMENTS(ratehz)); | 
 |  |  | 
| Line 32  static void cfgcreate(HWND hWnd) { | Line 31  static void cfgcreate(HWND hWnd) { | 
 | SetDlgItemText(hWnd, IDC_SNDBUFFER, work); | SetDlgItemText(hWnd, IDC_SNDBUFFER, work); | 
 | SPRINTF(work, str_u, xmilcfg.MOTORVOL); | SPRINTF(work, str_u, xmilcfg.MOTORVOL); | 
 | SetDlgItemText(hWnd, IDC_SEEKVOL, work); | SetDlgItemText(hWnd, IDC_SEEKVOL, work); | 
 | if (xmilcfg.TEXTMODE) { |  | 
 | res = IDC_TXTENHANCED; |  | 
 | } |  | 
 | else { |  | 
 | res = IDC_TXTREAL; |  | 
 | } |  | 
 | SetDlgItemCheck(hWnd, res, TRUE); |  | 
 | switch(xmilcfg.TEXT400L) { |  | 
 | case 0: |  | 
 | res = IDC_TXTEXTEND; |  | 
 | break; |  | 
 |  |  | 
| case 1: | SetDlgItemCheck(hWnd, IDC_SKIPLINE, xmilcfg.skipline); | 
| res = IDC_TXT400; | SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETRANGE, TRUE, | 
| break; | MAKELONG(0, 256)); | 
|  | SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_SETPOS, TRUE, | 
|  | xmilcfg.skiplight); | 
|  | SPRINTF(work, str_d, xmilcfg.skiplight); | 
|  | SetDlgItemText(hWnd, IDC_LIGHTSTR, work); | 
|  | } | 
 |  |  | 
| default: | static void lightstr(HWND hWnd) { | 
| res = IDC_TXTCSTM; |  | 
| break; |  | 
| } |  | 
| SetDlgItemCheck(hWnd, res, TRUE); |  | 
| EnableWindow(GetDlgItem(hWnd, IDC_TXTVALUE), (res == IDC_TXTCSTM)); |  | 
 |  |  | 
| SPRINTF(work, str_u, xmilcfg.LINETEXT); | UINT    val; | 
| SetDlgItemText(hWnd, IDC_TXTVALUE, work); | OEMCHAR work[32]; | 
| SPRINTF(work, str_u, xmilcfg.BLKLIGHT); |  | 
| SetDlgItemText(hWnd, IDC_BLKLIGHT, work); | val = (UINT)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0); | 
| SPRINTF(work, str_u, xmilcfg.LINEDEPTH); | SPRINTF(work, str_d, val); | 
| SetDlgItemText(hWnd, IDC_LINEDEPTH, work); | SetDlgItemText(hWnd, IDC_LIGHTSTR, work); | 
 | } | } | 
 |  |  | 
 | static void cfgupdate(HWND hWnd) { | static void cfgupdate(HWND hWnd) { | 
| Line 78  static void cfgupdate(HWND hWnd) { | Line 66  static void cfgupdate(HWND hWnd) { | 
 | if (xmilcfg.samplingrate != wval) { | if (xmilcfg.samplingrate != wval) { | 
 | xmilcfg.samplingrate = wval; | xmilcfg.samplingrate = wval; | 
 | updateflag |= SYS_UPDATECFG; | updateflag |= SYS_UPDATECFG; | 
| soundrenewal = TRUE; | corestat.soundrenewal = TRUE; | 
 | } | } | 
 |  |  | 
 | GetDlgItemText(hWnd, IDC_SNDBUFFER, work, NELEMENTS(work)); | GetDlgItemText(hWnd, IDC_SNDBUFFER, work, NELEMENTS(work)); | 
| Line 86  static void cfgupdate(HWND hWnd) { | Line 74  static void cfgupdate(HWND hWnd) { | 
 | if (xmilcfg.delayms != wval) { | if (xmilcfg.delayms != wval) { | 
 | xmilcfg.delayms = wval; | xmilcfg.delayms = wval; | 
 | updateflag |= SYS_UPDATECFG; | updateflag |= SYS_UPDATECFG; | 
| soundrenewal = TRUE; | corestat.soundrenewal = TRUE; | 
 | } | } | 
 |  |  | 
 | GetDlgItemText(hWnd, IDC_SEEKVOL, work, NELEMENTS(work)); | GetDlgItemText(hWnd, IDC_SEEKVOL, work, NELEMENTS(work)); | 
| Line 98  static void cfgupdate(HWND hWnd) { | Line 86  static void cfgupdate(HWND hWnd) { | 
 | updateflag |= SYS_UPDATEOSCFG; | updateflag |= SYS_UPDATEOSCFG; | 
 | } | } | 
 |  |  | 
 | bval = (UINT8)GetDlgItemCheck(hWnd, IDC_TXTENHANCED); |  | 
 | if (xmilcfg.TEXTMODE != bval) { |  | 
 | xmilcfg.TEXTMODE = bval; |  | 
 | textdrawproc_renewal(); |  | 
 | updateflag |= SYS_UPDATECFG; |  | 
 | } |  | 
 |  |  | 
 | renewalflg = FALSE; | renewalflg = FALSE; | 
| if (GetDlgItemCheck(hWnd, IDC_TXTEXTEND)) { | bval = GetDlgItemCheck(hWnd, IDC_SKIPLINE); | 
| bval = 0; | if (xmilcfg.skipline != bval) { | 
| } | xmilcfg.skipline = bval; | 
| else if (GetDlgItemCheck(hWnd, IDC_TXT400)) { |  | 
| bval = 1; |  | 
| } |  | 
| else { |  | 
| bval = 2; |  | 
| } |  | 
| if (xmilcfg.TEXT400L != bval) { |  | 
| xmilcfg.TEXT400L = bval; |  | 
 | renewalflg = TRUE; | renewalflg = TRUE; | 
 | } | } | 
| GetDlgItemText(hWnd, IDC_TXTVALUE, work, NELEMENTS(work)); | wval = (UINT16)SendDlgItemMessage(hWnd, IDC_SKIPLIGHT, TBM_GETPOS, 0, 0); | 
| bval = (UINT8)LIMITS(milstr_solveINT(work), 0, 255); | if (wval > 256) { | 
| if (xmilcfg.LINETEXT != bval) { | wval = 256; | 
| xmilcfg.LINETEXT = bval; | } | 
| renewalflg = TRUE; | if (xmilcfg.skiplight != wval) { | 
| } | xmilcfg.skiplight = wval; | 
| GetDlgItemText(hWnd, IDC_BLKLIGHT, work, NELEMENTS(work)); | renewalflg = 1; | 
| bval = (UINT8)LIMITS(milstr_solveINT(work), 0, 255); |  | 
| if (xmilcfg.BLKLIGHT != bval) { |  | 
| xmilcfg.BLKLIGHT = bval; |  | 
| renewalflg = TRUE; |  | 
| } |  | 
| GetDlgItemText(hWnd, IDC_LINEDEPTH, work, NELEMENTS(work)); |  | 
| bval = (UINT8)LIMITS(milstr_solveINT(work), 0, 255); |  | 
| if (xmilcfg.LINEDEPTH != bval) { |  | 
| xmilcfg.LINEDEPTH = bval; |  | 
| renewalflg = TRUE; |  | 
 | } | } | 
 | if (renewalflg) { | if (renewalflg) { | 
| reflesh_palette(); | pal_reset(); | 
| palandply = 1; |  | 
 | updateflag |= SYS_UPDATECFG; | updateflag |= SYS_UPDATECFG; | 
 | } | } | 
 | sysmng_update(updateflag); | sysmng_update(updateflag); | 
| Line 150  LRESULT CALLBACK CfgDialogProc(HWND hWnd | Line 112  LRESULT CALLBACK CfgDialogProc(HWND hWnd | 
 | switch (msg) { | switch (msg) { | 
 | case WM_INITDIALOG: | case WM_INITDIALOG: | 
 | cfgcreate(hWnd); | cfgcreate(hWnd); | 
| return(FALSE); | break; | 
 |  |  | 
 | case WM_COMMAND: | case WM_COMMAND: | 
 | switch (LOWORD(wp)) { | switch (LOWORD(wp)) { | 
 | case IDOK: | case IDOK: | 
 | cfgupdate(hWnd); | cfgupdate(hWnd); | 
 | EndDialog(hWnd, IDOK); | EndDialog(hWnd, IDOK); | 
| break; | return(TRUE); | 
 |  |  | 
 | case IDCANCEL: | case IDCANCEL: | 
 | EndDialog(hWnd, IDCANCEL); | EndDialog(hWnd, IDCANCEL); | 
| break; | return(TRUE); | 
|  | } | 
| case IDC_TXTEXTEND: | break; | 
| case IDC_TXT400: |  | 
| case IDC_TXTCSTM: |  | 
| EnableWindow(GetDlgItem(hWnd, IDC_TXTVALUE), |  | 
| GetDlgItemCheck(hWnd, IDC_TXTCSTM)); |  | 
| return(FALSE); |  | 
 |  |  | 
| default: | case WM_HSCROLL: | 
| return(FALSE); | switch(GetDlgCtrlID((HWND)lp)) { | 
|  | case IDC_SKIPLIGHT: | 
|  | lightstr(hWnd); | 
|  | return(TRUE); | 
 | } | } | 
 | break; | break; | 
 |  |  | 
 | case WM_CLOSE: | case WM_CLOSE: | 
 | PostMessage(hWnd, WM_COMMAND, IDCANCEL, 0); | PostMessage(hWnd, WM_COMMAND, IDCANCEL, 0); | 
| break; | return(TRUE); | 
|  |  | 
| default: |  | 
| return(FALSE); |  | 
 | } | } | 
| return(TRUE); | return(FALSE); | 
 | } | } | 
 |  |  |