diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/timecode.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/wx/timecode.h b/src/wx/timecode.h index 0c99d5361..bce527ed2 100644 --- a/src/wx/timecode.h +++ b/src/wx/timecode.h @@ -98,6 +98,15 @@ public: T get (float fps) const { T t; + + auto value_or_hint = [](wxTextCtrl const * t) { + if (!t->GetValue().IsEmpty()) { + return wx_to_std (t->GetValue()); + } else { + return wx_to_std (t->GetHint()); + } + }; + std::string const h = value_or_hint (_hours); t += T::from_seconds (dcp::raw_convert<int>(h.empty() ? "0" : h) * 3600); std::string const m = value_or_hint (_minutes); @@ -109,16 +118,6 @@ public: return t; } - -private: - std::string value_or_hint (wxTextCtrl const * t) const - { - if (!t->GetValue().IsEmpty()) { - return wx_to_std (t->GetValue()); - } else { - return wx_to_std (t->GetHint()); - } - } }; #endif |
