From e034606284e49233d9a903bfe11c7802cfa28a0e Mon Sep 17 00:00:00 2001 From: manoreken Date: Sun, 28 Feb 2021 16:03:54 +0900 Subject: [PATCH] Video state control --- HDR10Capture2019/MainApp.cpp | 33 ++++++++++++++++++++------------- HDR10Capture2019/MainApp.h | 1 + HDR10Capture2019/Resource.rc | 8 ++++---- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/HDR10Capture2019/MainApp.cpp b/HDR10Capture2019/MainApp.cpp index bd3d863..c5ad915 100644 --- a/HDR10Capture2019/MainApp.cpp +++ b/HDR10Capture2019/MainApp.cpp @@ -838,6 +838,7 @@ MainApp::OnDropFiles(HDROP hDrop) if (APS_Playing == mAviPlayState) { mAviReader.Close(); mAviPlayState = APS_PreInit; + mState = S_Init; } if (0 == _wcsicmp(L".avi", &path[sz - 4])) { @@ -1297,6 +1298,7 @@ MainApp::ShowSettingsWindow(void) { ImGui::Text("ALT+Enter to toggle fullscreen."); ImGui::Text("F7 to show/hide UI."); + ImGui::Text("Drop file to display it."); switch (mState) { case S_Init: @@ -1305,8 +1307,11 @@ MainApp::ShowSettingsWindow(void) { case S_ImageViewing: ImGui::Text("Image loaded."); break; + case S_VideoViewing: + ImGui::Text("Video viewing."); + break; case S_Capturing: - ImGui::Text("Captureing."); + ImGui::Text("Video Capturing."); break; default: assert(0); @@ -1422,18 +1427,6 @@ MainApp::ShowSettingsWindow(void) { } } - if (ImGui::TreeNodeEx("Image Quantization Range (Set Full for HDR)", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) { - int cg = 0 != (mShaderConsts.flags & MLColorConvShaderConstants::FLAG_LimitedRange); - ImGui::RadioButton("Full ##ICG", &cg, 0); - ImGui::RadioButton("Limited ##ICG", &cg, 1); - - if (cg) { - mShaderConsts.flags |= MLColorConvShaderConstants::FLAG_LimitedRange; - } else { - mShaderConsts.flags = mShaderConsts.flags & (~MLColorConvShaderConstants::FLAG_LimitedRange); - } - } - if (ImGui::TreeNodeEx("Image Color Gamut", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) { //ImGui::Text("Color Gamut is %s", MLColorGamutToStr(img.colorGamut)); @@ -1454,6 +1447,18 @@ MainApp::ShowSettingsWindow(void) { } } + if (ImGui::TreeNodeEx("Image Quantization Range (Set Full for HDR)", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) { + int cg = 0 != (mShaderConsts.flags & MLColorConvShaderConstants::FLAG_LimitedRange); + ImGui::RadioButton("Full ##ICG", &cg, 0); + ImGui::RadioButton("Limited ##ICG", &cg, 1); + + if (cg) { + mShaderConsts.flags |= MLColorConvShaderConstants::FLAG_LimitedRange; + } else { + mShaderConsts.flags = mShaderConsts.flags & (~MLColorConvShaderConstants::FLAG_LimitedRange); + } + } + ImGui::End(); } @@ -1692,6 +1697,7 @@ MainApp::ShowAviPlaybackWindow(void) { mAviImgBuf = nullptr; mAviImgBuf = new uint8_t[mAviImgBufBytes]; mAviPlayState = APS_Playing; + mState = S_VideoViewing; } } else { sprintf_s(mPlayMsg, "Read AVI Failed.\nFile open error : %S", mAviFilePath); @@ -1746,6 +1752,7 @@ MainApp::ShowAviPlaybackWindow(void) { if (ImGui::Button("Close")) { mAviReader.Close(); mAviPlayState = APS_PreInit; + mState = S_Init; } } diff --git a/HDR10Capture2019/MainApp.h b/HDR10Capture2019/MainApp.h index 1b3f9c4..c1c7f75 100644 --- a/HDR10Capture2019/MainApp.h +++ b/HDR10Capture2019/MainApp.h @@ -65,6 +65,7 @@ class MainApp : public MLDX12, IMLVideoCapUserCallback { enum State { S_Init, S_ImageViewing, + S_VideoViewing, S_Capturing, }; diff --git a/HDR10Capture2019/Resource.rc b/HDR10Capture2019/Resource.rc index 3805ddc..36b6d1b 100644 --- a/HDR10Capture2019/Resource.rc +++ b/HDR10Capture2019/Resource.rc @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,10,0,1 - PRODUCTVERSION 1,10,0,1 + FILEVERSION 1,11,0,1 + PRODUCTVERSION 1,11,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -79,12 +79,12 @@ BEGIN BEGIN VALUE "CompanyName", "TODO: " VALUE "FileDescription", "HDR10Capture" - VALUE "FileVersion", "1.10.0.1" + VALUE "FileVersion", "1.11.0.1" VALUE "InternalName", "HDR10Capture" VALUE "LegalCopyright", "Copyright (C) 2020" VALUE "OriginalFilename", "HDR10Capture.exe" VALUE "ProductName", "HDR10Capture" - VALUE "ProductVersion", "1.10.0.1" + VALUE "ProductVersion", "1.11.0.1" END END BLOCK "VarFileInfo"