[svn] / branches / dev-api-4 / xvidcore / vfw / src / config.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/vfw/src/config.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1360, Thu Feb 12 15:11:22 2004 UTC revision 1376, Sat Mar 6 01:59:32 2004 UTC
# Line 500  Line 500 
500          return (success) ? tmp : config;          return (success) ? tmp : config;
501  }  }
502    
503    /* get uint from combobox
504       GetDlgItemInt doesnt work properly for cb list items */
505    #define UINT_BUF_SZ     20
506    static int config_get_cbuint(HWND hDlg, UINT item, int def)
507    {
508            int sel = SendMessage(GetDlgItem(hDlg, item), CB_GETCURSEL, 0, 0);
509            char buf[UINT_BUF_SZ];
510    
511            if (sel<0) {
512                    return config_get_uint(hDlg, item, def);
513            }
514    
515            if (SendMessage(GetDlgItem(hDlg, item), CB_GETLBTEXT, sel, (LPARAM)buf) == CB_ERR) {
516                    return def;
517            }
518    
519            return atoi(buf);
520    }
521    
522    
523  /* we use "100 base" floats */  /* we use "100 base" floats */
524    
# Line 731  Line 750 
750    
751                  SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"665600");                  SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"665600");
752                  SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"716800");                  SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"716800");
753                    SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"1331200");
754                    SendDlgItemMessage(hDlg, IDC_BITRATE_TSIZE, CB_ADDSTRING, 0, (LPARAM)"1433600");
755    
756                  for (i=0; i<sizeof(video_fps_list)/sizeof(named_float_t); i++)                  for (i=0; i<sizeof(video_fps_list)/sizeof(named_float_t); i++)
757                          SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_ADDSTRING, 0, (LPARAM)video_fps_list[i].name);                          SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_ADDSTRING, 0, (LPARAM)video_fps_list[i].name);
# Line 863  Line 884 
884          case IDD_BITRATE :          case IDD_BITRATE :
885                  {                  {
886                          int ctype = SendDlgItemMessage(hDlg, IDC_BITRATE_CFORMAT, CB_GETCURSEL, 0, 0);                          int ctype = SendDlgItemMessage(hDlg, IDC_BITRATE_CFORMAT, CB_GETCURSEL, 0, 0);
887                          int target_size = config_get_uint(hDlg, IDC_BITRATE_TSIZE, 0);                          int target_size = config_get_cbuint(hDlg, IDC_BITRATE_TSIZE, 0);
888                          int subtitle_size = config_get_uint(hDlg, IDC_BITRATE_SSIZE, 0);                          int subtitle_size = config_get_uint(hDlg, IDC_BITRATE_SSIZE, 0);
889                          int fps = SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_GETCURSEL, 0, 0);                          int fps = SendDlgItemMessage(hDlg, IDC_BITRATE_FPS, CB_GETCURSEL, 0, 0);
890    
# Line 874  Line 895 
895    
896                          int audio_type = SendDlgItemMessage(hDlg, IDC_BITRATE_AFORMAT, CB_GETCURSEL, 0, 0);                          int audio_type = SendDlgItemMessage(hDlg, IDC_BITRATE_AFORMAT, CB_GETCURSEL, 0, 0);
897                          int audio_mode = IsDlgChecked(hDlg, IDC_BITRATE_AMODE_SIZE);                          int audio_mode = IsDlgChecked(hDlg, IDC_BITRATE_AMODE_SIZE);
898                          int audio_rate = config_get_uint(hDlg, IDC_BITRATE_ARATE, 0);                          int audio_rate = config_get_cbuint(hDlg, IDC_BITRATE_ARATE, 0);
899                          int audio_size = config_get_uint(hDlg, IDC_BITRATE_ASIZE, 0);                          int audio_size = config_get_uint(hDlg, IDC_BITRATE_ASIZE, 0);
900    
901                          int frames;                          int frames;
# Line 1475  Line 1496 
1496                  }else if ((HIWORD(wParam) == CBN_EDITCHANGE || HIWORD(wParam)==CBN_SELCHANGE) &&                  }else if ((HIWORD(wParam) == CBN_EDITCHANGE || HIWORD(wParam)==CBN_SELCHANGE) &&
1497                          (LOWORD(wParam)==IDC_BITRATE_TSIZE ||                          (LOWORD(wParam)==IDC_BITRATE_TSIZE ||
1498                           LOWORD(wParam)==IDC_BITRATE_ARATE )) {                           LOWORD(wParam)==IDC_BITRATE_ARATE )) {
1499    
1500                          adv_mode(hDlg, psi->idd, psi->config);                          adv_mode(hDlg, psi->idd, psi->config);
1501    
1502                  }else if (HIWORD(wParam) == LBN_SELCHANGE &&                  }else if (HIWORD(wParam) == LBN_SELCHANGE &&
1503                          (LOWORD(wParam) == IDC_PROFILE_PROFILE ||                          (LOWORD(wParam) == IDC_PROFILE_PROFILE ||
1504                           LOWORD(wParam) == IDC_LEVEL_PROFILE ||                           LOWORD(wParam) == IDC_LEVEL_PROFILE ||
# Line 1522  Line 1545 
1545                  switch (((NMHDR *)lParam)->code)                  switch (((NMHDR *)lParam)->code)
1546                  {                  {
1547                  case PSN_SETACTIVE :                  case PSN_SETACTIVE :
1548                          OutputDebugString("PSN_SET");                          DPRINTF("PSN_SET");
1549                          adv_upload(hDlg, psi->idd, psi->config);                          adv_upload(hDlg, psi->idd, psi->config);
1550                          adv_mode(hDlg, psi->idd, psi->config);                          adv_mode(hDlg, psi->idd, psi->config);
1551                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1552                          break;                          break;
1553    
1554                  case PSN_KILLACTIVE :                  case PSN_KILLACTIVE :
1555                          OutputDebugString("PSN_KILL");                          DPRINTF("PSN_KILL");
1556                          adv_download(hDlg, psi->idd, psi->config);                          adv_download(hDlg, psi->idd, psi->config);
1557                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1558                          break;                          break;
1559    
1560                  case PSN_APPLY :                  case PSN_APPLY :
1561                          OutputDebugString("PSN_APPLY");                          DPRINTF("PSN_APPLY");
1562                          psi->config->save = TRUE;                          psi->config->save = TRUE;
1563                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);                          SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1564                          break;                          break;
# Line 1557  Line 1580 
1580    or fasle if changes were canceled.    or fasle if changes were canceled.
1581    
1582    */    */
1583    
1584    #ifndef PSH_NOCONTEXTHELP
1585    #define PSH_NOCONTEXTHELP 0x02000000
1586    #endif
1587    
1588  static BOOL adv_dialog(HWND hParent, CONFIG * config, const int * dlgs, int size)  static BOOL adv_dialog(HWND hParent, CONFIG * config, const int * dlgs, int size)
1589  {  {
1590          PROPSHEETINFO psi[6];          PROPSHEETINFO psi[6];
# Line 1583  Line 1611 
1611          }          }
1612    
1613          psh.dwSize = sizeof(PROPSHEETHEADER);          psh.dwSize = sizeof(PROPSHEETHEADER);
1614          psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW;          psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW | PSH_NOCONTEXTHELP;
1615          psh.hwndParent = hParent;          psh.hwndParent = hParent;
1616          psh.hInstance = g_hInst;          psh.hInstance = g_hInst;
1617          psh.pszCaption = (LPSTR) "XviD Configuration";          psh.pszCaption = (LPSTR) "XviD Configuration";
# Line 1839  Line 1867 
1867                                   break;                                   break;
1868                          }                          }
1869    
                         if (n->code == NM_RCLICK) {  
                                 OutputDebugString("Right click");  
                         }  
1870                  break;                  break;
1871                  }                  }
1872    

Legend:
Removed from v.1360  
changed lines
  Added in v.1376

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4