X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_dialog.cc;h=975f7cd9d6c375802c1b684296e2ff8138fcd21e;hb=b7672a6d2d999489a188c539de7d01f5042fdee5;hp=77acb9758e9960dd49709f03b7872673d4e7481c;hpb=e0255a64d22440d718e5512f34a4f21f0d37a21b;p=dcpomatic.git diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index 77acb9758..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(), @@ -67,6 +70,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr film, weak_pt _toolbar = new wxToolBar (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL); _toolbar->SetMargins (4, 4); + _toolbar->SetToolBitmapSize (wxSize(32, 32)); _toolbar->AddRadioTool ((int) Timeline::SELECT, _("Select"), select, wxNullBitmap, _("Select and move content")); _toolbar->AddRadioTool ((int) Timeline::ZOOM, _("Zoom"), zoom, wxNullBitmap, _("Zoom in / out")); _toolbar->AddTool ((int) Timeline::ZOOM_ALL, _("Zoom all"), zoom_all, _("Zoom out to whole film")); @@ -80,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()); } @@ -96,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) { @@ -113,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))); } } }