summaryrefslogtreecommitdiff
path: root/src/wx/timecode.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-12 23:42:45 +0100
committerCarl Hetherington <cth@carlh.net>2024-03-12 23:42:45 +0100
commit2354c1fd781879d215834ebe54661f125fcb324e (patch)
tree936e6ae61f3f1eac565e48babf169de1833f9ac8 /src/wx/timecode.h
parenta7be213f1063e3c5cb4dcba37aa0443d1f28f9d5 (diff)
parentda46a695431d3b573924e53ac1a0163056a1a5b5 (diff)
Merge branch '2678-reel-break' into v2.17.x
Diffstat (limited to 'src/wx/timecode.h')
-rw-r--r--src/wx/timecode.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wx/timecode.h b/src/wx/timecode.h
index 6c5d8ae23..22899ddc9 100644
--- a/src/wx/timecode.h
+++ b/src/wx/timecode.h
@@ -50,6 +50,7 @@ public:
protected:
void changed ();
void set_clicked ();
+ virtual bool valid() const = 0;
wxSizer* _sizer;
wxPanel* _editable;
@@ -96,6 +97,11 @@ public:
_frames->SetHint (std_to_wx(dcp::raw_convert<std::string>(hmsf.f)));
}
+ void set_maximum(dcpomatic::HMSF maximum)
+ {
+ _maximum = std::move(maximum);
+ }
+
dcpomatic::HMSF get () const
{
auto value_or_hint = [](wxTextCtrl const * t) {
@@ -116,6 +122,13 @@ public:
{
return T(get(), fps);
}
+
+private:
+ bool valid() const override {
+ return !_maximum || get() <= *_maximum;
+ }
+
+ boost::optional<dcpomatic::HMSF> _maximum;
};
#endif