Logo Search packages:      
Sourcecode: lame version File versions  Download package

bool AEncodeProperties::UpdateDlgFromValue ( HWND  hDialog )

Update the config dialog box from the instance parameters.

Select the right saved config

Definition at line 541 of file AEncodeProperties.cpp.

References GetAbrOutputMode(), GetChannelLentgh(), GetCopyrightMode(), GetCRCMode(), GetOriginalMode(), GetPrivateMode(), GetSmartOutputMode(), and UpdateDlgFromSlides().

Referenced by InitConfigDlg(), and UpdateConfigs().

      // get all the required strings
//    TCHAR Version[5];
//    LoadString(hDllInstance, IDS_STRING_VERSION, Version, 5);

      int i;

      // Check boxes if required
      ::CheckDlgButton( HwndDlg, IDC_CHECK_CHECKSUM,     GetCRCMode()        ?BST_CHECKED:BST_UNCHECKED );
      ::CheckDlgButton( HwndDlg, IDC_CHECK_ORIGINAL,     GetOriginalMode()   ?BST_CHECKED:BST_UNCHECKED );
      ::CheckDlgButton( HwndDlg, IDC_CHECK_PRIVATE,      GetPrivateMode()    ?BST_CHECKED:BST_UNCHECKED );
      ::CheckDlgButton( HwndDlg, IDC_CHECK_COPYRIGHT,    GetCopyrightMode()  ?BST_CHECKED:BST_UNCHECKED );
      ::CheckDlgButton( HwndDlg, IDC_CHECK_ENC_SMART,    GetSmartOutputMode()?BST_CHECKED:BST_UNCHECKED );
      ::CheckDlgButton( HwndDlg, IDC_CHECK_ENC_ABR,      GetAbrOutputMode()  ?BST_CHECKED:BST_UNCHECKED );
//    ::CheckDlgButton( HwndDlg, IDC_CHECK_RESERVOIR,    !GetNoBiResMode() ?BST_CHECKED:BST_UNCHECKED );
//    ::CheckDlgButton( HwndDlg, IDC_CHECK_XINGVBR,      GetXingFrameMode()?BST_CHECKED:BST_UNCHECKED );
//    ::CheckDlgButton( HwndDlg, IDC_CHECK_RESAMPLE,     GetResampleMode() ?BST_CHECKED:BST_UNCHECKED );
//    ::CheckDlgButton( HwndDlg, IDC_CHECK_CHANNELFORCE, bForceChannel     ?BST_CHECKED:BST_UNCHECKED );
      // Add required channel modes
      for (i=0;i<GetChannelLentgh();i++)
            if (i == nChannelIndex)
                  SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_ENC_STEREO), CB_SETCURSEL, i, NULL);

      // Add VBR Quality
      SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_AVERAGE_MIN), TBM_SETPOS, TRUE, AverageBitrate_Min);
      SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_AVERAGE_MAX), TBM_SETPOS, TRUE, AverageBitrate_Max);
      SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_AVERAGE_STEP), TBM_SETPOS, TRUE, AverageBitrate_Step);
      SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_AVERAGE_SAMPLE), TBM_SETPOS, TRUE, AverageBitrate_Max);


      EnableAbrOptions(HwndDlg, GetAbrOutputMode());
//    UpdateAbrSteps(AverageBitrate_Min, AverageBitrate_Max, AverageBitrate_Step);
      // Add all possible re-sampling freq
/*    SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_SAMPLEFREQ), CB_SETCURSEL, nSamplingFreqIndex, NULL);

      // Add required bitrates
      for (i=0;i<GetBitrateLentgh();i++)
            if (i == nMinBitrateIndex)
                  SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_BITRATE), CB_SETCURSEL, i, NULL);

      // Add bitrates to the VBR combo box too
      for (i=0;i<GetBitrateLentgh();i++)
            if (i == nMaxBitrateIndex)
                  SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_MAXBITRATE), CB_SETCURSEL, i, NULL);

//    SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_QUALITY), TBM_SETRANGE, TRUE, MAKELONG(0,9));

      char tmp[3];
      SetWindowText(GetDlgItem( HwndDlg, IDC_CONFIG_QUALITY), tmp);
      SendMessage(GetDlgItem( HwndDlg, IDC_SLIDER_QUALITY), TBM_SETPOS, TRUE, VbrQuality);
      SetWindowText(GetDlgItem( HwndDlg, IDC_EDIT_AVERAGE), tmp);
      // Display VBR settings if needed
      AEncodeProperties::DisplayVbrOptions(HwndDlg, mBRmode);

      // Display Resample settings if needed
      if (GetResampleMode())
            ::EnableWindow(::GetDlgItem(HwndDlg,IDC_COMBO_SAMPLEFREQ), TRUE);
            ::EnableWindow(::GetDlgItem(HwndDlg,IDC_COMBO_SAMPLEFREQ), FALSE);

      // Add presets
      for (i=0;i<GetPresetLentgh();i++)
            if (i == nPresetIndex)
                  SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_PRESET), CB_SETCURSEL, i, NULL);

      // Add User configs
//    SendMessage(GetDlgItem( HwndDlg, IDC_COMBO_SETTINGS), CB_RESETCONTENT , NULL, NULL);
      ::SetWindowText(::GetDlgItem( HwndDlg, IDC_EDIT_OUTPUTDIR), OutputDir.c_str());
            \todo Select the right saved config

      return true;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index