X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimecode.h;h=c31a6740c5ea86c86e1fb9a2763dba874a23e85d;hb=7926a03f67cf0a371e43b5d8b4d075c7a789a478;hp=3fe35981db6a8048e5e44a6ebb61efbbdc4939d5;hpb=ef31a94cd00dcc88fc83093cbc709b5b79acc4b6;p=dcpomatic.git diff --git a/src/wx/timecode.h b/src/wx/timecode.h index 3fe35981d..c31a6740c 100644 --- a/src/wx/timecode.h +++ b/src/wx/timecode.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2020 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -22,6 +22,7 @@ #define DCPOMATIC_WX_TIMECODE_H #include "wx_util.h" +#include "lib/dcpomatic_time.h" #include "lib/types.h" #include #include @@ -53,6 +54,8 @@ protected: wxTextCtrl* _frames; wxButton* _set_button; wxStaticText* _fixed; + + bool _ignore_changed = false; }; template @@ -87,7 +90,7 @@ public: _frames->SetHint (std_to_wx(dcp::raw_convert(hmsf.f))); } - T get (float fps) const + dcpomatic::HMSF get () const { auto value_or_hint = [](wxTextCtrl const * t) { auto s = wx_to_std (t->GetValue().IsEmpty() ? t->GetHint() : t->GetValue()); @@ -97,15 +100,15 @@ public: return dcp::raw_convert(s); }; - return T ( - { - value_or_hint(_hours), - value_or_hint(_minutes), - value_or_hint(_seconds), - value_or_hint(_frames) - }, - fps - ); + return { value_or_hint(_hours), + value_or_hint(_minutes), + value_or_hint(_seconds), + value_or_hint(_frames) }; + } + + T get (float fps) const + { + return T(get(), fps); } };