Skip to content

Commit

Permalink
Video state control
Browse files Browse the repository at this point in the history
  • Loading branch information
manoreken2 committed Feb 28, 2021
1 parent 1c272b1 commit e034606
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
33 changes: 20 additions & 13 deletions HDR10Capture2019/MainApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down Expand Up @@ -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:
Expand All @@ -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);
Expand Down Expand Up @@ -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));

Expand All @@ -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();
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1746,6 +1752,7 @@ MainApp::ShowAviPlaybackWindow(void) {
if (ImGui::Button("Close")) {
mAviReader.Close();
mAviPlayState = APS_PreInit;
mState = S_Init;
}
}

Expand Down
1 change: 1 addition & 0 deletions HDR10Capture2019/MainApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class MainApp : public MLDX12, IMLVideoCapUserCallback {
enum State {
S_Init,
S_ImageViewing,
S_VideoViewing,
S_Capturing,
};

Expand Down
8 changes: 4 additions & 4 deletions HDR10Capture2019/Resource.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "TODO: <Company name>"
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"
Expand Down

0 comments on commit e034606

Please sign in to comment.