1159b3361Sopenharmony_ci/* 2159b3361Sopenharmony_ci * LAME MP3 encoder for DirectShow 3159b3361Sopenharmony_ci * Advanced property page 4159b3361Sopenharmony_ci * 5159b3361Sopenharmony_ci * Copyright (c) 2000-2005 Marie Orlova, Peter Gubanov, Vitaly Ivanov, Elecard Ltd. 6159b3361Sopenharmony_ci * 7159b3361Sopenharmony_ci * This library is free software; you can redistribute it and/or 8159b3361Sopenharmony_ci * modify it under the terms of the GNU Library General Public 9159b3361Sopenharmony_ci * License as published by the Free Software Foundation; either 10159b3361Sopenharmony_ci * version 2 of the License, or (at your option) any later version. 11159b3361Sopenharmony_ci * 12159b3361Sopenharmony_ci * This library is distributed in the hope that it will be useful, 13159b3361Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 14159b3361Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15159b3361Sopenharmony_ci * Library General Public License for more details. 16159b3361Sopenharmony_ci * 17159b3361Sopenharmony_ci * You should have received a copy of the GNU Library General Public 18159b3361Sopenharmony_ci * License along with this library; if not, write to the 19159b3361Sopenharmony_ci * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20159b3361Sopenharmony_ci * Boston, MA 02111-1307, USA. 21159b3361Sopenharmony_ci */ 22159b3361Sopenharmony_ci 23159b3361Sopenharmony_ci#include <streams.h> 24159b3361Sopenharmony_ci#include <olectl.h> 25159b3361Sopenharmony_ci#include <commctrl.h> 26159b3361Sopenharmony_ci#include "iaudioprops.h" 27159b3361Sopenharmony_ci#include "mpegac.h" 28159b3361Sopenharmony_ci#include "resource.h" 29159b3361Sopenharmony_ci#include "PropPage_adv.h" 30159b3361Sopenharmony_ci#include "Reg.h" 31159b3361Sopenharmony_ci 32159b3361Sopenharmony_ci#define MPG_MD_STEREO 0 33159b3361Sopenharmony_ci#define MPG_MD_JOINT_STEREO 1 34159b3361Sopenharmony_ci#define MPG_MD_DUAL_CHANNEL 2 35159b3361Sopenharmony_ci#define MPG_MD_MONO 3 36159b3361Sopenharmony_ci 37159b3361Sopenharmony_ci// Strings which apear in comboboxes 38159b3361Sopenharmony_ciconst char *chChMode[4] = { 39159b3361Sopenharmony_ci "Mono", 40159b3361Sopenharmony_ci "Standard stereo", 41159b3361Sopenharmony_ci "Joint stereo", 42159b3361Sopenharmony_ci "Dual channel"}; 43159b3361Sopenharmony_ci 44159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 45159b3361Sopenharmony_ci// CreateInstance 46159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 47159b3361Sopenharmony_ciCUnknown *CMpegAudEncPropertyPageAdv::CreateInstance( LPUNKNOWN punk, HRESULT *phr ) 48159b3361Sopenharmony_ci{ 49159b3361Sopenharmony_ci CMpegAudEncPropertyPageAdv *pNewObject 50159b3361Sopenharmony_ci = new CMpegAudEncPropertyPageAdv( punk, phr ); 51159b3361Sopenharmony_ci 52159b3361Sopenharmony_ci if( pNewObject == NULL ) 53159b3361Sopenharmony_ci *phr = E_OUTOFMEMORY; 54159b3361Sopenharmony_ci 55159b3361Sopenharmony_ci return pNewObject; 56159b3361Sopenharmony_ci} 57159b3361Sopenharmony_ci 58159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 59159b3361Sopenharmony_ci// Constructor 60159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 61159b3361Sopenharmony_ciCMpegAudEncPropertyPageAdv::CMpegAudEncPropertyPageAdv(LPUNKNOWN punk, HRESULT *phr) : 62159b3361Sopenharmony_ci CBasePropertyPage(NAME("Encoder Advanced Property Page"), punk, IDD_ADVPROPS, IDS_AUDIO_ADVANCED_TITLE), 63159b3361Sopenharmony_ci m_pAEProps(NULL) 64159b3361Sopenharmony_ci{ 65159b3361Sopenharmony_ci ASSERT(phr); 66159b3361Sopenharmony_ci 67159b3361Sopenharmony_ci InitCommonControls(); 68159b3361Sopenharmony_ci} 69159b3361Sopenharmony_ci 70159b3361Sopenharmony_ci// 71159b3361Sopenharmony_ci// OnConnect 72159b3361Sopenharmony_ci// 73159b3361Sopenharmony_ci// Give us the filter to communicate with 74159b3361Sopenharmony_ciHRESULT CMpegAudEncPropertyPageAdv::OnConnect(IUnknown *pUnknown) 75159b3361Sopenharmony_ci{ 76159b3361Sopenharmony_ci ASSERT(m_pAEProps == NULL); 77159b3361Sopenharmony_ci 78159b3361Sopenharmony_ci // Ask the filter for it's control interface 79159b3361Sopenharmony_ci 80159b3361Sopenharmony_ci HRESULT hr = pUnknown->QueryInterface(IID_IAudioEncoderProperties,(void **)&m_pAEProps); 81159b3361Sopenharmony_ci if (FAILED(hr) || !m_pAEProps) 82159b3361Sopenharmony_ci return E_NOINTERFACE; 83159b3361Sopenharmony_ci 84159b3361Sopenharmony_ci ASSERT(m_pAEProps); 85159b3361Sopenharmony_ci 86159b3361Sopenharmony_ci // Get current filter state 87159b3361Sopenharmony_ci// m_pAEProps->LoadAudioEncoderPropertiesFromRegistry(); 88159b3361Sopenharmony_ci 89159b3361Sopenharmony_ci m_pAEProps->get_EnforceVBRmin(&m_dwEnforceVBRmin); 90159b3361Sopenharmony_ci m_pAEProps->get_VoiceMode(&m_dwVoiceMode); 91159b3361Sopenharmony_ci m_pAEProps->get_KeepAllFreq(&m_dwKeepAllFreq); 92159b3361Sopenharmony_ci m_pAEProps->get_StrictISO(&m_dwStrictISO); 93159b3361Sopenharmony_ci m_pAEProps->get_NoShortBlock(&m_dwNoShortBlock); 94159b3361Sopenharmony_ci m_pAEProps->get_XingTag(&m_dwXingTag); 95159b3361Sopenharmony_ci m_pAEProps->get_ChannelMode(&m_dwChannelMode); 96159b3361Sopenharmony_ci m_pAEProps->get_ForceMS(&m_dwForceMS); 97159b3361Sopenharmony_ci m_pAEProps->get_ModeFixed(&m_dwModeFixed); 98159b3361Sopenharmony_ci m_pAEProps->get_SampleOverlap(&m_dwOverlap); 99159b3361Sopenharmony_ci m_pAEProps->get_SetDuration(&m_dwSetStop); 100159b3361Sopenharmony_ci 101159b3361Sopenharmony_ci return NOERROR; 102159b3361Sopenharmony_ci} 103159b3361Sopenharmony_ci 104159b3361Sopenharmony_ci// 105159b3361Sopenharmony_ci// OnDisconnect 106159b3361Sopenharmony_ci// 107159b3361Sopenharmony_ci// Release the interface 108159b3361Sopenharmony_ci 109159b3361Sopenharmony_ciHRESULT CMpegAudEncPropertyPageAdv::OnDisconnect() 110159b3361Sopenharmony_ci{ 111159b3361Sopenharmony_ci // Release the interface 112159b3361Sopenharmony_ci if (m_pAEProps == NULL) 113159b3361Sopenharmony_ci return E_UNEXPECTED; 114159b3361Sopenharmony_ci 115159b3361Sopenharmony_ci m_pAEProps->set_EnforceVBRmin(m_dwEnforceVBRmin); 116159b3361Sopenharmony_ci m_pAEProps->set_VoiceMode(m_dwVoiceMode); 117159b3361Sopenharmony_ci m_pAEProps->set_KeepAllFreq(m_dwKeepAllFreq); 118159b3361Sopenharmony_ci m_pAEProps->set_StrictISO(m_dwStrictISO); 119159b3361Sopenharmony_ci m_pAEProps->set_NoShortBlock(m_dwNoShortBlock); 120159b3361Sopenharmony_ci m_pAEProps->set_XingTag(m_dwXingTag); 121159b3361Sopenharmony_ci m_pAEProps->set_ChannelMode(m_dwChannelMode); 122159b3361Sopenharmony_ci m_pAEProps->set_ForceMS(m_dwForceMS); 123159b3361Sopenharmony_ci m_pAEProps->set_ModeFixed(m_dwModeFixed); 124159b3361Sopenharmony_ci m_pAEProps->set_SampleOverlap(m_dwOverlap); 125159b3361Sopenharmony_ci m_pAEProps->set_SetDuration(m_dwSetStop); 126159b3361Sopenharmony_ci m_pAEProps->SaveAudioEncoderPropertiesToRegistry(); 127159b3361Sopenharmony_ci 128159b3361Sopenharmony_ci m_pAEProps->Release(); 129159b3361Sopenharmony_ci m_pAEProps = NULL; 130159b3361Sopenharmony_ci 131159b3361Sopenharmony_ci return NOERROR; 132159b3361Sopenharmony_ci} 133159b3361Sopenharmony_ci 134159b3361Sopenharmony_ci// 135159b3361Sopenharmony_ci// OnActivate 136159b3361Sopenharmony_ci// 137159b3361Sopenharmony_ci// Called on dialog creation 138159b3361Sopenharmony_ci 139159b3361Sopenharmony_ciHRESULT CMpegAudEncPropertyPageAdv::OnActivate(void) 140159b3361Sopenharmony_ci{ 141159b3361Sopenharmony_ci InitPropertiesDialog(m_hwnd); 142159b3361Sopenharmony_ci 143159b3361Sopenharmony_ci return NOERROR; 144159b3361Sopenharmony_ci} 145159b3361Sopenharmony_ci 146159b3361Sopenharmony_ci// 147159b3361Sopenharmony_ci// OnDeactivate 148159b3361Sopenharmony_ci// 149159b3361Sopenharmony_ci// Called on dialog destruction 150159b3361Sopenharmony_ci 151159b3361Sopenharmony_ciHRESULT CMpegAudEncPropertyPageAdv::OnDeactivate(void) 152159b3361Sopenharmony_ci{ 153159b3361Sopenharmony_ci return NOERROR; 154159b3361Sopenharmony_ci} 155159b3361Sopenharmony_ci 156159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 157159b3361Sopenharmony_ci// OnReceiveMessage - message handler function 158159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 159159b3361Sopenharmony_ciBOOL CMpegAudEncPropertyPageAdv::OnReceiveMessage(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam) 160159b3361Sopenharmony_ci{ 161159b3361Sopenharmony_ci switch (uMsg) 162159b3361Sopenharmony_ci { 163159b3361Sopenharmony_ci case WM_COMMAND: 164159b3361Sopenharmony_ci switch (LOWORD(wParam)) 165159b3361Sopenharmony_ci { 166159b3361Sopenharmony_ci case IDC_RADIO_STEREO: 167159b3361Sopenharmony_ci case IDC_RADIO_JSTEREO: 168159b3361Sopenharmony_ci case IDC_RADIO_DUAL: 169159b3361Sopenharmony_ci case IDC_RADIO_MONO: 170159b3361Sopenharmony_ci { 171159b3361Sopenharmony_ci 172159b3361Sopenharmony_ci DWORD dwChannelMode = LOWORD(wParam) - IDC_RADIO_STEREO; 173159b3361Sopenharmony_ci CheckRadioButton(hwnd, IDC_RADIO_STEREO, IDC_RADIO_MONO, LOWORD(wParam)); 174159b3361Sopenharmony_ci 175159b3361Sopenharmony_ci if (dwChannelMode == MPG_MD_JOINT_STEREO) 176159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwnd,IDC_CHECK_FORCE_MS),TRUE); 177159b3361Sopenharmony_ci else 178159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwnd,IDC_CHECK_FORCE_MS),FALSE); 179159b3361Sopenharmony_ci 180159b3361Sopenharmony_ci m_pAEProps->set_ChannelMode(dwChannelMode); 181159b3361Sopenharmony_ci SetDirty(); 182159b3361Sopenharmony_ci } 183159b3361Sopenharmony_ci break; 184159b3361Sopenharmony_ci 185159b3361Sopenharmony_ci case IDC_CHECK_ENFORCE_MIN: 186159b3361Sopenharmony_ci m_pAEProps->set_EnforceVBRmin(IsDlgButtonChecked(hwnd, IDC_CHECK_ENFORCE_MIN)); 187159b3361Sopenharmony_ci SetDirty(); 188159b3361Sopenharmony_ci break; 189159b3361Sopenharmony_ci 190159b3361Sopenharmony_ci case IDC_CHECK_VOICE: 191159b3361Sopenharmony_ci m_pAEProps->set_VoiceMode(IsDlgButtonChecked(hwnd, IDC_CHECK_VOICE)); 192159b3361Sopenharmony_ci SetDirty(); 193159b3361Sopenharmony_ci break; 194159b3361Sopenharmony_ci 195159b3361Sopenharmony_ci case IDC_CHECK_KEEP_ALL_FREQ: 196159b3361Sopenharmony_ci m_pAEProps->set_KeepAllFreq(IsDlgButtonChecked(hwnd, IDC_CHECK_KEEP_ALL_FREQ)); 197159b3361Sopenharmony_ci SetDirty(); 198159b3361Sopenharmony_ci break; 199159b3361Sopenharmony_ci 200159b3361Sopenharmony_ci case IDC_CHECK_STRICT_ISO: 201159b3361Sopenharmony_ci m_pAEProps->set_StrictISO(IsDlgButtonChecked(hwnd, IDC_CHECK_STRICT_ISO)); 202159b3361Sopenharmony_ci SetDirty(); 203159b3361Sopenharmony_ci break; 204159b3361Sopenharmony_ci 205159b3361Sopenharmony_ci case IDC_CHECK_DISABLE_SHORT_BLOCK: 206159b3361Sopenharmony_ci m_pAEProps->set_NoShortBlock(IsDlgButtonChecked(hwnd, IDC_CHECK_DISABLE_SHORT_BLOCK)); 207159b3361Sopenharmony_ci SetDirty(); 208159b3361Sopenharmony_ci break; 209159b3361Sopenharmony_ci 210159b3361Sopenharmony_ci case IDC_CHECK_XING_TAG: 211159b3361Sopenharmony_ci m_pAEProps->set_XingTag(IsDlgButtonChecked(hwnd, IDC_CHECK_XING_TAG)); 212159b3361Sopenharmony_ci SetDirty(); 213159b3361Sopenharmony_ci break; 214159b3361Sopenharmony_ci 215159b3361Sopenharmony_ci case IDC_CHECK_FORCE_MS: 216159b3361Sopenharmony_ci m_pAEProps->set_ForceMS(IsDlgButtonChecked(hwnd, IDC_CHECK_FORCE_MS)); 217159b3361Sopenharmony_ci SetDirty(); 218159b3361Sopenharmony_ci break; 219159b3361Sopenharmony_ci 220159b3361Sopenharmony_ci case IDC_CHECK_MODE_FIXED: 221159b3361Sopenharmony_ci m_pAEProps->set_ModeFixed(IsDlgButtonChecked(hwnd, IDC_CHECK_MODE_FIXED)); 222159b3361Sopenharmony_ci SetDirty(); 223159b3361Sopenharmony_ci break; 224159b3361Sopenharmony_ci 225159b3361Sopenharmony_ci case IDC_CHECK_OVERLAP: 226159b3361Sopenharmony_ci m_pAEProps->set_SampleOverlap(IsDlgButtonChecked(hwnd, IDC_CHECK_OVERLAP)); 227159b3361Sopenharmony_ci SetDirty(); 228159b3361Sopenharmony_ci break; 229159b3361Sopenharmony_ci 230159b3361Sopenharmony_ci case IDC_CHECK_STOP: 231159b3361Sopenharmony_ci m_pAEProps->set_SetDuration(IsDlgButtonChecked(hwnd, IDC_CHECK_STOP)); 232159b3361Sopenharmony_ci SetDirty(); 233159b3361Sopenharmony_ci break; 234159b3361Sopenharmony_ci } 235159b3361Sopenharmony_ci 236159b3361Sopenharmony_ci return TRUE; 237159b3361Sopenharmony_ci 238159b3361Sopenharmony_ci case WM_DESTROY: 239159b3361Sopenharmony_ci return TRUE; 240159b3361Sopenharmony_ci 241159b3361Sopenharmony_ci default: 242159b3361Sopenharmony_ci return FALSE; 243159b3361Sopenharmony_ci } 244159b3361Sopenharmony_ci 245159b3361Sopenharmony_ci return TRUE; 246159b3361Sopenharmony_ci} 247159b3361Sopenharmony_ci 248159b3361Sopenharmony_ci// 249159b3361Sopenharmony_ci// OnApplyChanges 250159b3361Sopenharmony_ci// 251159b3361Sopenharmony_ciHRESULT CMpegAudEncPropertyPageAdv::OnApplyChanges() 252159b3361Sopenharmony_ci{ 253159b3361Sopenharmony_ci m_pAEProps->get_EnforceVBRmin(&m_dwEnforceVBRmin); 254159b3361Sopenharmony_ci m_pAEProps->get_VoiceMode(&m_dwVoiceMode); 255159b3361Sopenharmony_ci m_pAEProps->get_KeepAllFreq(&m_dwKeepAllFreq); 256159b3361Sopenharmony_ci m_pAEProps->get_StrictISO(&m_dwStrictISO); 257159b3361Sopenharmony_ci m_pAEProps->get_ChannelMode(&m_dwChannelMode); 258159b3361Sopenharmony_ci m_pAEProps->get_ForceMS(&m_dwForceMS); 259159b3361Sopenharmony_ci m_pAEProps->get_NoShortBlock(&m_dwNoShortBlock); 260159b3361Sopenharmony_ci m_pAEProps->get_XingTag(&m_dwXingTag); 261159b3361Sopenharmony_ci m_pAEProps->get_ModeFixed(&m_dwModeFixed); 262159b3361Sopenharmony_ci m_pAEProps->get_SampleOverlap(&m_dwOverlap); 263159b3361Sopenharmony_ci m_pAEProps->get_SetDuration(&m_dwSetStop); 264159b3361Sopenharmony_ci m_pAEProps->SaveAudioEncoderPropertiesToRegistry(); 265159b3361Sopenharmony_ci 266159b3361Sopenharmony_ci m_pAEProps->ApplyChanges(); 267159b3361Sopenharmony_ci 268159b3361Sopenharmony_ci return S_OK; 269159b3361Sopenharmony_ci} 270159b3361Sopenharmony_ci 271159b3361Sopenharmony_ci// 272159b3361Sopenharmony_ci// Initialize dialogbox controls with proper values 273159b3361Sopenharmony_ci// 274159b3361Sopenharmony_civoid CMpegAudEncPropertyPageAdv::InitPropertiesDialog(HWND hwndParent) 275159b3361Sopenharmony_ci{ 276159b3361Sopenharmony_ci EnableControls(hwndParent, TRUE); 277159b3361Sopenharmony_ci 278159b3361Sopenharmony_ci // 279159b3361Sopenharmony_ci // initialize radio bottons 280159b3361Sopenharmony_ci // 281159b3361Sopenharmony_ci DWORD dwChannelMode; 282159b3361Sopenharmony_ci m_pAEProps->get_ChannelMode(&dwChannelMode); 283159b3361Sopenharmony_ci CheckRadioButton(hwndParent, IDC_RADIO_STEREO, IDC_RADIO_MONO, IDC_RADIO_STEREO + dwChannelMode); 284159b3361Sopenharmony_ci 285159b3361Sopenharmony_ci if (dwChannelMode == MPG_MD_JOINT_STEREO) 286159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_FORCE_MS), TRUE); 287159b3361Sopenharmony_ci else 288159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_FORCE_MS), FALSE); 289159b3361Sopenharmony_ci 290159b3361Sopenharmony_ci // 291159b3361Sopenharmony_ci // initialize checkboxes 292159b3361Sopenharmony_ci // 293159b3361Sopenharmony_ci DWORD dwEnforceVBRmin; 294159b3361Sopenharmony_ci m_pAEProps->get_EnforceVBRmin(&dwEnforceVBRmin); 295159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_ENFORCE_MIN, dwEnforceVBRmin ? BST_CHECKED : BST_UNCHECKED); 296159b3361Sopenharmony_ci 297159b3361Sopenharmony_ci DWORD dwVoiceMode; 298159b3361Sopenharmony_ci m_pAEProps->get_VoiceMode(&dwVoiceMode); 299159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_VOICE, dwVoiceMode ? BST_CHECKED : BST_UNCHECKED); 300159b3361Sopenharmony_ci 301159b3361Sopenharmony_ci DWORD dwKeepAllFreq; 302159b3361Sopenharmony_ci m_pAEProps->get_KeepAllFreq(&dwKeepAllFreq); 303159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_KEEP_ALL_FREQ, dwKeepAllFreq ? BST_CHECKED : BST_UNCHECKED); 304159b3361Sopenharmony_ci 305159b3361Sopenharmony_ci DWORD dwStrictISO; 306159b3361Sopenharmony_ci m_pAEProps->get_StrictISO(&dwStrictISO); 307159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_STRICT_ISO, dwStrictISO ? BST_CHECKED : BST_UNCHECKED); 308159b3361Sopenharmony_ci 309159b3361Sopenharmony_ci DWORD dwNoShortBlock; 310159b3361Sopenharmony_ci m_pAEProps->get_NoShortBlock(&dwNoShortBlock); 311159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_DISABLE_SHORT_BLOCK, dwNoShortBlock ? BST_CHECKED : BST_UNCHECKED); 312159b3361Sopenharmony_ci 313159b3361Sopenharmony_ci DWORD dwXingEnabled; 314159b3361Sopenharmony_ci m_pAEProps->get_XingTag(&dwXingEnabled); 315159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_XING_TAG, dwXingEnabled ? BST_CHECKED : BST_UNCHECKED); 316159b3361Sopenharmony_ci 317159b3361Sopenharmony_ci DWORD dwForceMS; 318159b3361Sopenharmony_ci m_pAEProps->get_ForceMS(&dwForceMS); 319159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_FORCE_MS, dwForceMS ? BST_CHECKED : BST_UNCHECKED); 320159b3361Sopenharmony_ci 321159b3361Sopenharmony_ci DWORD dwModeFixed; 322159b3361Sopenharmony_ci m_pAEProps->get_ModeFixed(&dwModeFixed); 323159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_MODE_FIXED, dwModeFixed ? BST_CHECKED : BST_UNCHECKED); 324159b3361Sopenharmony_ci 325159b3361Sopenharmony_ci DWORD dwOverlap; 326159b3361Sopenharmony_ci m_pAEProps->get_SampleOverlap(&dwOverlap); 327159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_OVERLAP, dwOverlap ? BST_CHECKED : BST_UNCHECKED); 328159b3361Sopenharmony_ci 329159b3361Sopenharmony_ci DWORD dwStopTime; 330159b3361Sopenharmony_ci m_pAEProps->get_SetDuration(&dwStopTime); 331159b3361Sopenharmony_ci CheckDlgButton(hwndParent, IDC_CHECK_STOP, dwStopTime ? BST_CHECKED : BST_UNCHECKED); 332159b3361Sopenharmony_ci} 333159b3361Sopenharmony_ci 334159b3361Sopenharmony_ci 335159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 336159b3361Sopenharmony_ci// EnableControls 337159b3361Sopenharmony_ci//////////////////////////////////////////////////////////////// 338159b3361Sopenharmony_civoid CMpegAudEncPropertyPageAdv::EnableControls(HWND hwndParent, bool bEnable) 339159b3361Sopenharmony_ci{ 340159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_ENFORCE_MIN), bEnable); 341159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_RADIO_STEREO), bEnable); 342159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_RADIO_JSTEREO), bEnable); 343159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_RADIO_DUAL), bEnable); 344159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_RADIO_MONO), bEnable); 345159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_FORCE_MS), bEnable); 346159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_VOICE), bEnable); 347159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_KEEP_ALL_FREQ), bEnable); 348159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_STRICT_ISO), bEnable); 349159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_DISABLE_SHORT_BLOCK), bEnable); 350159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_XING_TAG), bEnable); 351159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_MODE_FIXED), bEnable); 352159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_OVERLAP), bEnable); 353159b3361Sopenharmony_ci EnableWindow(GetDlgItem(hwndParent, IDC_CHECK_STOP), bEnable); 354159b3361Sopenharmony_ci} 355159b3361Sopenharmony_ci 356159b3361Sopenharmony_ci// 357159b3361Sopenharmony_ci// SetDirty 358159b3361Sopenharmony_ci// 359159b3361Sopenharmony_ci// notifies the property page site of changes 360159b3361Sopenharmony_ci 361159b3361Sopenharmony_civoid CMpegAudEncPropertyPageAdv::SetDirty() 362159b3361Sopenharmony_ci{ 363159b3361Sopenharmony_ci m_bDirty = TRUE; 364159b3361Sopenharmony_ci if (m_pPageSite) 365159b3361Sopenharmony_ci m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY); 366159b3361Sopenharmony_ci} 367159b3361Sopenharmony_ci 368