diff --git a/plugins/GSdx/GSCaptureDlg.cpp b/plugins/GSdx/GSCaptureDlg.cpp index 7fcfe37d69..513fc0730f 100644 --- a/plugins/GSdx/GSCaptureDlg.cpp +++ b/plugins/GSdx/GSCaptureDlg.cpp @@ -67,7 +67,6 @@ void GSCaptureDlg::OnInit() _bstr_t selected = theApp.GetConfigS("CaptureVideoCodecDisplayName").c_str(); ComboBoxAppend(IDC_CODECS, "Uncompressed", 0, true); - ComboBoxAppend(IDC_COLORSPACE, "YUY2", 0, true); ComboBoxAppend(IDC_COLORSPACE, "RGB32", 1, false); @@ -117,66 +116,73 @@ void GSCaptureDlg::OnInit() bool GSCaptureDlg::OnCommand(HWND hWnd, UINT id, UINT code) { - if(id == IDC_BROWSE && code == BN_CLICKED) + switch (id) { - char buff[MAX_PATH] = {0}; - - OPENFILENAME ofn; - - memset(&ofn, 0, sizeof(ofn)); - - ofn.lStructSize = sizeof(ofn); - ofn.hwndOwner = m_hWnd; - ofn.lpstrFile = buff; - ofn.nMaxFile = countof(buff); - ofn.lpstrFilter = "Avi files (*.avi)\0*.avi\0"; - ofn.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST; - - strcpy(ofn.lpstrFile, m_filename.c_str()); - - if(GetSaveFileName(&ofn)) - { - m_filename = ofn.lpstrFile; - - SetText(IDC_FILENAME, m_filename.c_str()); - } - - return true; - } - else if(id == IDC_CONFIGURE && code == BN_CLICKED) + case IDC_BROWSE: { - Codec c; - - if(GetSelCodec(c) == 1) + if (code == BN_CLICKED) { - if(CComQIPtr pSPP = c.filter) + char buff[MAX_PATH] = { 0 }; + + OPENFILENAME ofn; + memset(&ofn, 0, sizeof(ofn)); + + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = m_hWnd; + ofn.lpstrFile = buff; + ofn.nMaxFile = countof(buff); + ofn.lpstrFilter = "Avi files (*.avi)\0*.avi\0"; + ofn.Flags = OFN_EXPLORER | OFN_ENABLESIZING | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST; + + strcpy(ofn.lpstrFile, m_filename.c_str()); + if (GetSaveFileName(&ofn)) { - CAUUID caGUID; + m_filename = ofn.lpstrFile; + SetText(IDC_FILENAME, m_filename.c_str()); + } - memset(&caGUID, 0, sizeof(caGUID)); - - if(SUCCEEDED(pSPP->GetPages(&caGUID))) + return true; + } + break; + } + case IDC_CONFIGURE: + { + if (code == BN_CLICKED) + { + Codec c; + if (GetSelCodec(c) == 1) + { + if (CComQIPtr pSPP = c.filter) { - IUnknown* lpUnk = NULL; - pSPP.QueryInterface(&lpUnk); - OleCreatePropertyFrame(m_hWnd, 0, 0, c.FriendlyName.c_str(), 1, (IUnknown**)&lpUnk, caGUID.cElems, caGUID.pElems, 0, 0, NULL); - lpUnk->Release(); + CAUUID caGUID; + memset(&caGUID, 0, sizeof(caGUID)); - if(caGUID.pElems) CoTaskMemFree(caGUID.pElems); - } - } - else if(CComQIPtr pAMVfWCD = c.filter) - { - if(pAMVfWCD->ShowDialog(VfwCompressDialog_QueryConfig, NULL) == S_OK) - { - pAMVfWCD->ShowDialog(VfwCompressDialog_Config, m_hWnd); + if (SUCCEEDED(pSPP->GetPages(&caGUID))) + { + IUnknown* lpUnk = NULL; + pSPP.QueryInterface(&lpUnk); + OleCreatePropertyFrame(m_hWnd, 0, 0, c.FriendlyName.c_str(), 1, (IUnknown**)&lpUnk, caGUID.cElems, caGUID.pElems, 0, 0, NULL); + lpUnk->Release(); + + if (caGUID.pElems) + CoTaskMemFree(caGUID.pElems); + } + } + else if (CComQIPtr pAMVfWCD = c.filter) + { + if (pAMVfWCD->ShowDialog(VfwCompressDialog_QueryConfig, NULL) == S_OK) + pAMVfWCD->ShowDialog(VfwCompressDialog_Config, m_hWnd); } } + return true; } - - return true; + break; } - else if(id == IDOK) + case IDC_CODECS: + { + break; + } + case IDOK: { m_width = GetTextAsInt(IDC_WIDTH); m_height = GetTextAsInt(IDC_HEIGHT); @@ -184,12 +190,9 @@ bool GSCaptureDlg::OnCommand(HWND hWnd, UINT id, UINT code) ComboBoxGetSelData(IDC_COLORSPACE, m_colorspace); Codec c; - int ris = GetSelCodec(c); - if(ris == 0) - { + if (ris == 0) return false; - } m_enc = c.filter; @@ -198,14 +201,13 @@ bool GSCaptureDlg::OnCommand(HWND hWnd, UINT id, UINT code) theApp.SetConfig("CaptureFileName", m_filename.c_str()); if (ris != 2) - { theApp.SetConfig("CaptureVideoCodecDisplayName", c.DisplayName); - } else - { theApp.SetConfig("CaptureVideoCodecDisplayName", ""); - } + break; + } + default: + break; } - return __super::OnCommand(hWnd, id, code); }