Use DCPTime::split.
authorCarl Hetherington <cth@carlh.net>
Wed, 14 Nov 2018 22:39:11 +0000 (22:39 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 22 Nov 2018 23:26:01 +0000 (23:26 +0000)
src/wx/controls.cc

index 0fa92b69ada51014c1cca92e30ca7c25546be491..cc0ed25bb1a20f2cc1b914f36e5ab36bb5f907b0 100644 (file)
@@ -605,12 +605,9 @@ Controls::add_content_to_list (shared_ptr<Content> content, wxListCtrl* ctrl)
        it.SetId(N);
        it.SetColumn(0);
        DCPTime length = content->length_after_trim (_film);
-       int seconds = length.seconds();
-       int minutes = seconds / 60;
-       seconds -= minutes * 60;
-       int hours = minutes / 60;
-       minutes -= hours * 60;
-       it.SetText(wxString::Format("%02d:%02d:%02d", hours, minutes, seconds));
+       int h, m, s, f;
+       length.split (24, h, m, s, f);
+       it.SetText(wxString::Format("%02d:%02d:%02d", h, m, s));
        ctrl->InsertItem(it);
 
        shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(content);