X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=8cdc6d63d5cf52282534630055d92733c6fa12a1;hb=313319ba2d8544bc25524e02e634804a503b54f1;hp=5be006b60a6ee6039e97e4ae835832391c6a4e9d;hpb=86646e17164f7e085bae1574ecda5784ce9a67ac;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 5be006b60..8cdc6d63d 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,26 +18,27 @@ */ + +#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; using std::shared_ptr; +using std::string; using std::weak_ptr; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif + TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_ptr viewer) : wxDialog ( cp->window(), @@ -81,7 +82,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 +98,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 +116,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))); } } }