Skip to content

Commit e034606

Browse files
committed
Video state control
1 parent 1c272b1 commit e034606

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

HDR10Capture2019/MainApp.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ MainApp::OnDropFiles(HDROP hDrop)
838838
if (APS_Playing == mAviPlayState) {
839839
mAviReader.Close();
840840
mAviPlayState = APS_PreInit;
841+
mState = S_Init;
841842
}
842843

843844
if (0 == _wcsicmp(L".avi", &path[sz - 4])) {
@@ -1297,6 +1298,7 @@ MainApp::ShowSettingsWindow(void) {
12971298

12981299
ImGui::Text("ALT+Enter to toggle fullscreen.");
12991300
ImGui::Text("F7 to show/hide UI.");
1301+
ImGui::Text("Drop file to display it.");
13001302

13011303
switch (mState) {
13021304
case S_Init:
@@ -1305,8 +1307,11 @@ MainApp::ShowSettingsWindow(void) {
13051307
case S_ImageViewing:
13061308
ImGui::Text("Image loaded.");
13071309
break;
1310+
case S_VideoViewing:
1311+
ImGui::Text("Video viewing.");
1312+
break;
13081313
case S_Capturing:
1309-
ImGui::Text("Captureing.");
1314+
ImGui::Text("Video Capturing.");
13101315
break;
13111316
default:
13121317
assert(0);
@@ -1422,18 +1427,6 @@ MainApp::ShowSettingsWindow(void) {
14221427
}
14231428
}
14241429

1425-
if (ImGui::TreeNodeEx("Image Quantization Range (Set Full for HDR)", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) {
1426-
int cg = 0 != (mShaderConsts.flags & MLColorConvShaderConstants::FLAG_LimitedRange);
1427-
ImGui::RadioButton("Full ##ICG", &cg, 0);
1428-
ImGui::RadioButton("Limited ##ICG", &cg, 1);
1429-
1430-
if (cg) {
1431-
mShaderConsts.flags |= MLColorConvShaderConstants::FLAG_LimitedRange;
1432-
} else {
1433-
mShaderConsts.flags = mShaderConsts.flags & (~MLColorConvShaderConstants::FLAG_LimitedRange);
1434-
}
1435-
}
1436-
14371430
if (ImGui::TreeNodeEx("Image Color Gamut", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) {
14381431
//ImGui::Text("Color Gamut is %s", MLColorGamutToStr(img.colorGamut));
14391432

@@ -1454,6 +1447,18 @@ MainApp::ShowSettingsWindow(void) {
14541447
}
14551448
}
14561449

1450+
if (ImGui::TreeNodeEx("Image Quantization Range (Set Full for HDR)", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_CollapsingHeader)) {
1451+
int cg = 0 != (mShaderConsts.flags & MLColorConvShaderConstants::FLAG_LimitedRange);
1452+
ImGui::RadioButton("Full ##ICG", &cg, 0);
1453+
ImGui::RadioButton("Limited ##ICG", &cg, 1);
1454+
1455+
if (cg) {
1456+
mShaderConsts.flags |= MLColorConvShaderConstants::FLAG_LimitedRange;
1457+
} else {
1458+
mShaderConsts.flags = mShaderConsts.flags & (~MLColorConvShaderConstants::FLAG_LimitedRange);
1459+
}
1460+
}
1461+
14571462
ImGui::End();
14581463
}
14591464

@@ -1692,6 +1697,7 @@ MainApp::ShowAviPlaybackWindow(void) {
16921697
mAviImgBuf = nullptr;
16931698
mAviImgBuf = new uint8_t[mAviImgBufBytes];
16941699
mAviPlayState = APS_Playing;
1700+
mState = S_VideoViewing;
16951701
}
16961702
} else {
16971703
sprintf_s(mPlayMsg, "Read AVI Failed.\nFile open error : %S", mAviFilePath);
@@ -1746,6 +1752,7 @@ MainApp::ShowAviPlaybackWindow(void) {
17461752
if (ImGui::Button("Close")) {
17471753
mAviReader.Close();
17481754
mAviPlayState = APS_PreInit;
1755+
mState = S_Init;
17491756
}
17501757
}
17511758

HDR10Capture2019/MainApp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class MainApp : public MLDX12, IMLVideoCapUserCallback {
6565
enum State {
6666
S_Init,
6767
S_ImageViewing,
68+
S_VideoViewing,
6869
S_Capturing,
6970
};
7071

HDR10Capture2019/Resource.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
6161
//
6262

6363
VS_VERSION_INFO VERSIONINFO
64-
FILEVERSION 1,10,0,1
65-
PRODUCTVERSION 1,10,0,1
64+
FILEVERSION 1,11,0,1
65+
PRODUCTVERSION 1,11,0,1
6666
FILEFLAGSMASK 0x3fL
6767
#ifdef _DEBUG
6868
FILEFLAGS 0x1L
@@ -79,12 +79,12 @@ BEGIN
7979
BEGIN
8080
VALUE "CompanyName", "TODO: <Company name>"
8181
VALUE "FileDescription", "HDR10Capture"
82-
VALUE "FileVersion", "1.10.0.1"
82+
VALUE "FileVersion", "1.11.0.1"
8383
VALUE "InternalName", "HDR10Capture"
8484
VALUE "LegalCopyright", "Copyright (C) 2020"
8585
VALUE "OriginalFilename", "HDR10Capture.exe"
8686
VALUE "ProductName", "HDR10Capture"
87-
VALUE "ProductVersion", "1.10.0.1"
87+
VALUE "ProductVersion", "1.11.0.1"
8888
END
8989
END
9090
BLOCK "VarFileInfo"

0 commit comments

Comments
 (0)