Diff for /np2/macos9/dialog/d_config.cpp between versions 1.1 and 1.3

version 1.1, 2003/10/23 15:58:00 version 1.3, 2004/01/27 07:24:26
Line 12  static const char str_clockfmt[] = "%2u. Line 12  static const char str_clockfmt[] = "%2u.
   
 static void setbase(ControlHandle *btn, UINT base) {  static void setbase(ControlHandle *btn, UINT base) {
   
         SetControlValue(btn[0], (base == PCBASECLOCK20));          SetControlValue(btn[0], (base == PCBASECLOCK20)?1:0);
         SetControlValue(btn[1], (base == PCBASECLOCK25));          SetControlValue(btn[1], (base == PCBASECLOCK25)?1:0);
 }  }
   
 static void setclock(Handle hdl, UINT base, UINT multiple) {  static void setclock(Handle hdl, UINT base, UINT multiple) {
Line 29  static void setclock(Handle hdl, UINT ba Line 29  static void setclock(Handle hdl, UINT ba
         SetDialogItemText(hdl, clockstr);          SetDialogItemText(hdl, clockstr);
 }  }
   
   static void setmodel(ControlHandle *btn, UINT model) {
   
           SetControlValue(btn[0], (model == 0)?1:0);
           SetControlValue(btn[1], (model == 1)?1:0);
           SetControlValue(btn[2], (model == 2)?1:0);
   }
   
 static void setrate(ControlHandle *btn, UINT rate) {  static void setrate(ControlHandle *btn, UINT rate) {
   
         SetControlValue(btn[0], (rate == 11025));          SetControlValue(btn[0], (rate == 11025)?1:0);
         SetControlValue(btn[1], (rate == 22050));          SetControlValue(btn[1], (rate == 22050)?1:0);
         SetControlValue(btn[2], (rate == 44100));          SetControlValue(btn[2], (rate == 44100)?1:0);
 }  }
   
   
Line 41  void ConfigDialogProc(void) { Line 48  void ConfigDialogProc(void) {
   
         DialogPtr               hDlg;          DialogPtr               hDlg;
         ControlHandle   basebtn[2];          ControlHandle   basebtn[2];
           ControlHandle   modelbtn[3];
         ControlHandle   ratebtn[3];          ControlHandle   ratebtn[3];
         ControlHandle   resumebtn;          ControlHandle   resumebtn;
         char                    work[32];          char                    work[32];
         Str255                  workstr;          Str255                  workstr;
         UINT                    base;          UINT                    base;
         UINT                    multiple;          UINT                    multiple;
           UINT                    model;
         UINT                    rate;          UINT                    rate;
         UINT                    ms;          UINT                    ms;
         UINT                    resume;          UINT                    resume;
         int                             done;          int                             done;
         short                   item;          short                   item;
         UINT                    update;          UINT                    update;
   const char                      *str;
   
         hDlg = GetNewDialog(IDD_CONFIGURE, NULL, (WindowPtr)-1);          hDlg = GetNewDialog(IDD_CONFIGURE, NULL, (WindowPtr)-1);
         if (!hDlg) {          if (!hDlg) {
Line 60  void ConfigDialogProc(void) { Line 70  void ConfigDialogProc(void) {
         }          }
         basebtn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_BASECLOCK20);          basebtn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_BASECLOCK20);
         basebtn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_BASECLOCK25);          basebtn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_BASECLOCK25);
           modelbtn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_MODELVM);
           modelbtn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_MODELVX);
           modelbtn[2] = (ControlHandle)GetDlgItem(hDlg, IDC_MODELEPSON);
         ratebtn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE11);          ratebtn[0] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE11);
         ratebtn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE22);          ratebtn[1] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE22);
         ratebtn[2] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE44);          ratebtn[2] = (ControlHandle)GetDlgItem(hDlg, IDC_RATE44);
Line 84  void ConfigDialogProc(void) { Line 97  void ConfigDialogProc(void) {
         SetDialogItemText(GetDlgItem(hDlg, IDC_MULTIPLE), workstr);          SetDialogItemText(GetDlgItem(hDlg, IDC_MULTIPLE), workstr);
         setclock(GetDlgItem(hDlg, IDC_CLOCKMSG), base, multiple);          setclock(GetDlgItem(hDlg, IDC_CLOCKMSG), base, multiple);
   
           if (!milstr_cmp(np2cfg.model, str_VM)) {
                   model = 0;
           }
           else if (!milstr_cmp(np2cfg.model, str_EPSON)) {
                   model = 2;
           }
           else {
                   model = 1;
           }
           setmodel(modelbtn, model);
   
         rate = np2cfg.samplingrate;          rate = np2cfg.samplingrate;
         if ((rate != 0) && (rate != 11025) && (rate != 44100)) {          if ((rate != 0) && (rate != 11025) && (rate != 44100)) {
                 rate = 22050;                  rate = 22050;
Line 120  void ConfigDialogProc(void) { Line 144  void ConfigDialogProc(void) {
                                         np2cfg.multiple = multiple;                                          np2cfg.multiple = multiple;
                                         update |= SYS_UPDATECFG | SYS_UPDATECLOCK;                                          update |= SYS_UPDATECFG | SYS_UPDATECLOCK;
                                 }                                  }
                                   if (model == 0) {
                                           str = str_VM;
                                   }
                                   else if (model == 2) {
                                           str = str_EPSON;
                                   }
                                   else {
                                           str = str_VX;
                                   }
                                   if (milstr_cmp(np2cfg.model, str)) {
                                           milstr_ncpy(np2cfg.model, str, sizeof(np2cfg.model));
                                           update |= SYS_UPDATECFG;
                                   }
                                 if (np2cfg.samplingrate != rate) {                                  if (np2cfg.samplingrate != rate) {
                                         np2cfg.samplingrate = rate;                                          np2cfg.samplingrate = rate;
                                         update |= SYS_UPDATECFG | SYS_UPDATERATE;                                          update |= SYS_UPDATECFG | SYS_UPDATERATE;
Line 176  void ConfigDialogProc(void) { Line 213  void ConfigDialogProc(void) {
                                 setclock(GetDlgItem(hDlg, IDC_CLOCKMSG), base, multiple);                                  setclock(GetDlgItem(hDlg, IDC_CLOCKMSG), base, multiple);
                                 break;                                  break;
   
                           case IDC_MODELVM:
                                   model = 0;
                                   setmodel(modelbtn, model);
                                   break;
   
                           case IDC_MODELVX:
                                   model = 1;
                                   setmodel(modelbtn, model);
                                   break;
   
                           case IDC_MODELEPSON:
                                   model = 2;
                                   setmodel(modelbtn, model);
                                   break;
   
                         case IDC_RATE11:                          case IDC_RATE11:
                                 rate = 11025;                                  rate = 11025;
                                 setrate(ratebtn, rate);                                  setrate(ratebtn, rate);

Removed from v.1.1  
changed lines
  Added in v.1.3


RetroPC.NET-CVS <cvs@retropc.net>