Skip to content

Commit

Permalink
Allow toggling TFF
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikewando committed Apr 17, 2024
1 parent 28f54d9 commit 0e8d496
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion WalnutApp/src/WalnutApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ class ExampleLayer : public Walnut::Layer
} else {
m_NoMatchHandling = NoMatchHandling::PREVIOUS;
}
m_TopFieldFirst = SetDefault(m_JsonProps, "tff", true);
SetDefault(m_JsonProps, "project_garbage", json::object());
SetDefault(m_JsonProps, "extra_attributes", json::object());

Expand Down Expand Up @@ -413,6 +414,7 @@ class ExampleLayer : public Walnut::Layer
m_ProjectFile = "";
m_JsonProps = R"({
"ivtc_actions": [],
"tff": true,
"no_match_handling": {},
"no_match_handling_default": "Previous",
"project_garbage": {
Expand All @@ -433,10 +435,13 @@ class ExampleLayer : public Walnut::Layer
m_JsonProps["project_garbage"]["notes"][i] = notes[i % 10];
}
LoadFrames();
// TODO this is increasingly redundant with OpenProject, should probably delegate
m_ActiveCycle = 0;
m_AutoReload = true;
m_CombedDetection = false;
m_CombedThreshold = 45;
m_NoMatchHandling = NoMatchHandling::PREVIOUS;
m_TopFieldFirst = true;
m_ProjectOpened = true;
}

Expand All @@ -458,7 +463,7 @@ class ExampleLayer : public Walnut::Layer

void UpdateCombedDetection() {
m_JsonProps["project_garbage"]["combed_detection"] = m_CombedDetection;
LoadFrames();
AutoLoadFrames();
}

void UpdateCombedThreshold() {
Expand All @@ -480,11 +485,17 @@ class ExampleLayer : public Walnut::Layer
AutoLoadFrames();
}

void UpdateTopFieldFirst() {
m_JsonProps["tff"] = m_TopFieldFirst;
AutoLoadFrames();
}

bool m_AutoReload = true;
bool m_ProjectOpened = false;
bool m_CombedDetection = false;
int m_CombedThreshold = 45;
int m_NoMatchHandling = NoMatchHandling::PREVIOUS;
bool m_TopFieldFirst = true;

private:
const VSAPI* m_VSAPI = nullptr;
Expand Down Expand Up @@ -982,6 +993,9 @@ Walnut::Application* Walnut::CreateApplication(int argc, char** argv)
g_Layer->UpdateNoMatchHandling();
}
ImGui::Unindent();
if (ImGui::Checkbox("Top Field First", &g_Layer->m_TopFieldFirst)) {
g_Layer->UpdateTopFieldFirst();
}
if (!g_Layer->m_ProjectOpened) {
ImGui::EndDisabled();
}
Expand Down

0 comments on commit 0e8d496

Please sign in to comment.