X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=975f7cd9d6c375802c1b684296e2ff8138fcd21e;hb=9b85acc342e0cbfc6a9f9533bb7067978bd1294e;hp=5be006b60a6ee6039e97e4ae835832391c6a4e9d;hpb=86646e17164f7e085bae1574ecda5784ce9a67ac;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 5be006b60..975f7cd9d 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2019 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,17 +18,19 @@ */ + +#include "content_panel.h" #include "film_editor.h" #include "timeline_dialog.h" #include "wx_util.h" -#include "content_panel.h" -#include "lib/playlist.h" -#include "lib/cross.h" #include "lib/compose.hpp" +#include "lib/cross.h" +#include "lib/playlist.h" #include #include #include + using std::list; using std::cout; using std::string; @@ -38,6 +40,7 @@ using std::weak_ptr; using namespace boost::placeholders; #endif + TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_ptr viewer) : wxDialog ( cp->window(), @@ -81,7 +84,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_pt sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12); #ifdef DCPOMATIC_LINUX - wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE); + auto buttons = CreateSeparatedButtonSizer (wxCLOSE); if (buttons) { sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); } @@ -97,6 +100,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_pt _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2)); } + void TimelineDialog::film_change (ChangeType type, Film::Property p) { @@ -114,23 +118,25 @@ TimelineDialog::film_change (ChangeType type, Film::Property p) } } + void TimelineDialog::set_selection (ContentList selection) { _timeline.set_selection (selection); } + void TimelineDialog::tool_clicked (wxCommandEvent& ev) { - Timeline::Tool t = (Timeline::Tool) ev.GetId(); + Timeline::Tool t = static_cast(ev.GetId()); _timeline.tool_clicked (t); if (t == Timeline::SNAP) { - _timeline.set_snap (_toolbar->GetToolState ((int) t)); + _timeline.set_snap (_toolbar->GetToolState(static_cast(t))); } else if (t == Timeline::SEQUENCE) { auto film = _film.lock (); if (film) { - film->set_sequence (_toolbar->GetToolState ((int) t)); + film->set_sequence (_toolbar->GetToolState(static_cast(t))); } } }