- T t;
- 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);
- t += T::from_seconds (dcp::raw_convert<int>(m.empty() ? "0" : m) * 60);
- std::string const s = value_or_hint (_seconds);
- t += T::from_seconds (dcp::raw_convert<int>(s.empty() ? "0" : s));
- std::string const f = value_or_hint (_frames);
- t += T::from_seconds (dcp::raw_convert<double>(f.empty() ? "0" : f) / fps);
-
- return t;
+ auto value_or_hint = [](wxTextCtrl const * t) {
+ auto s = wx_to_std (t->GetValue().IsEmpty() ? t->GetHint() : t->GetValue());
+ if (s.empty()) {
+ return 0;
+ }
+ return dcp::raw_convert<int>(s);
+ };
+
+ return { value_or_hint(_hours),
+ value_or_hint(_minutes),
+ value_or_hint(_seconds),
+ value_or_hint(_frames) };