From cc3a87b302581647330753a09815ca78c0a23fe4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 12 Dec 2023 01:32:04 +0100 Subject: [PATCH 1/1] Rename Timeline -> ContentTimeline. --- src/wx/{timeline.cc => content_timeline.cc} | 120 ++++++++++---------- src/wx/{timeline.h => content_timeline.h} | 4 +- src/wx/timeline_atmos_content_view.cc | 2 +- src/wx/timeline_atmos_content_view.h | 2 +- src/wx/timeline_audio_content_view.cc | 8 +- src/wx/timeline_audio_content_view.h | 2 +- src/wx/timeline_content_view.cc | 4 +- src/wx/timeline_content_view.h | 2 +- src/wx/timeline_dialog.cc | 20 ++-- src/wx/timeline_dialog.h | 4 +- src/wx/timeline_labels_view.cc | 4 +- src/wx/timeline_labels_view.h | 2 +- src/wx/timeline_reels_view.cc | 4 +- src/wx/timeline_reels_view.h | 2 +- src/wx/timeline_text_content_view.cc | 2 +- src/wx/timeline_text_content_view.h | 6 +- src/wx/timeline_time_axis_view.cc | 4 +- src/wx/timeline_time_axis_view.h | 2 +- src/wx/timeline_video_content_view.cc | 5 +- src/wx/timeline_video_content_view.h | 2 +- src/wx/timeline_view.cc | 4 +- src/wx/timeline_view.h | 6 +- src/wx/wscript | 2 +- 23 files changed, 111 insertions(+), 102 deletions(-) rename src/wx/{timeline.cc => content_timeline.cc} (84%) rename src/wx/{timeline.h => content_timeline.h} (96%) diff --git a/src/wx/timeline.cc b/src/wx/content_timeline.cc similarity index 84% rename from src/wx/timeline.cc rename to src/wx/content_timeline.cc index 38e9de4ee..b650f8e92 100644 --- a/src/wx/timeline.cc +++ b/src/wx/content_timeline.cc @@ -19,9 +19,9 @@ */ #include "content_panel.h" +#include "content_timeline.h" #include "film_editor.h" #include "film_viewer.h" -#include "timeline.h" #include "timeline_atmos_content_view.h" #include "timeline_audio_content_view.h" #include "timeline_labels_view.h" @@ -64,11 +64,11 @@ using namespace boost::placeholders; /* 3 hours in 640 pixels */ -double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3); -int const Timeline::_minimum_pixels_per_track = 16; +double const ContentTimeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3); +int const ContentTimeline::_minimum_pixels_per_track = 16; -Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, FilmViewer& viewer) +ContentTimeline::ContentTimeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, FilmViewer& viewer) : wxPanel (parent, wxID_ANY) , _labels_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)) , _main_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)) @@ -102,30 +102,30 @@ Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, Fi sizer->Add (_main_canvas, 1, wxEXPAND); SetSizer (sizer); - _labels_canvas->Bind (wxEVT_PAINT, boost::bind (&Timeline::paint_labels, this)); - _main_canvas->Bind (wxEVT_PAINT, boost::bind (&Timeline::paint_main, this)); - _main_canvas->Bind (wxEVT_LEFT_DOWN, boost::bind (&Timeline::left_down, this, _1)); - _main_canvas->Bind (wxEVT_LEFT_UP, boost::bind (&Timeline::left_up, this, _1)); - _main_canvas->Bind (wxEVT_RIGHT_DOWN, boost::bind (&Timeline::right_down, this, _1)); - _main_canvas->Bind (wxEVT_MOTION, boost::bind (&Timeline::mouse_moved, this, _1)); - _main_canvas->Bind (wxEVT_SIZE, boost::bind (&Timeline::resized, this)); - _main_canvas->Bind (wxEVT_MOUSEWHEEL, boost::bind(&Timeline::mouse_wheel_turned, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_TOP, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_BOTTOM, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_LINEUP, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_LINEDOWN, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_PAGEUP, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_PAGEDOWN, boost::bind (&Timeline::scrolled, this, _1)); - _main_canvas->Bind (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind (&Timeline::scrolled, this, _1)); + _labels_canvas->Bind(wxEVT_PAINT, boost::bind(&ContentTimeline::paint_labels, this)); + _main_canvas->Bind (wxEVT_PAINT, boost::bind(&ContentTimeline::paint_main, this)); + _main_canvas->Bind (wxEVT_LEFT_DOWN, boost::bind(&ContentTimeline::left_down, this, _1)); + _main_canvas->Bind (wxEVT_LEFT_UP, boost::bind(&ContentTimeline::left_up, this, _1)); + _main_canvas->Bind (wxEVT_RIGHT_DOWN, boost::bind(&ContentTimeline::right_down, this, _1)); + _main_canvas->Bind (wxEVT_MOTION, boost::bind(&ContentTimeline::mouse_moved, this, _1)); + _main_canvas->Bind (wxEVT_SIZE, boost::bind(&ContentTimeline::resized, this)); + _main_canvas->Bind (wxEVT_MOUSEWHEEL, boost::bind(&ContentTimeline::mouse_wheel_turned, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_TOP, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_BOTTOM, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_LINEUP, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_LINEDOWN, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_PAGEUP, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_PAGEDOWN, boost::bind(&ContentTimeline::scrolled, this, _1)); + _main_canvas->Bind (wxEVT_SCROLLWIN_THUMBTRACK, boost::bind(&ContentTimeline::scrolled, this, _1)); film_change(ChangeType::DONE, FilmProperty::CONTENT); SetMinSize (wxSize (640, 4 * pixels_per_track() + 96)); - _film_changed_connection = film->Change.connect (bind (&Timeline::film_change, this, _1, _2)); - _film_content_change_connection = film->ContentChange.connect (bind (&Timeline::film_content_change, this, _1, _3, _4)); + _film_changed_connection = film->Change.connect(bind(&ContentTimeline::film_change, this, _1, _2)); + _film_content_change_connection = film->ContentChange.connect(bind(&ContentTimeline::film_content_change, this, _1, _3, _4)); - Bind (wxEVT_TIMER, boost::bind(&Timeline::update_playhead, this)); + Bind(wxEVT_TIMER, boost::bind(&ContentTimeline::update_playhead, this)); _timer.Start (200, wxTIMER_CONTINUOUS); setup_scrollbars (); @@ -134,7 +134,7 @@ Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, Fi void -Timeline::mouse_wheel_turned(wxMouseEvent& event) +ContentTimeline::mouse_wheel_turned(wxMouseEvent& event) { auto const rotation = event.GetWheelRotation(); @@ -178,21 +178,21 @@ Timeline::mouse_wheel_turned(wxMouseEvent& event) void -Timeline::update_playhead () +ContentTimeline::update_playhead() { Refresh (); } void -Timeline::set_pixels_per_second (double pps) +ContentTimeline::set_pixels_per_second(double pps) { _pixels_per_second = max (_minimum_pixels_per_second, pps); } void -Timeline::paint_labels () +ContentTimeline::paint_labels() { wxPaintDC dc (_labels_canvas); @@ -217,7 +217,7 @@ Timeline::paint_labels () void -Timeline::paint_main () +ContentTimeline::paint_main() { wxPaintDC dc (_main_canvas); dc.Clear(); @@ -283,7 +283,7 @@ Timeline::paint_main () void -Timeline::film_change(ChangeType type, FilmProperty p) +ContentTimeline::film_change(ChangeType type, FilmProperty p) { if (type != ChangeType::DONE) { return; @@ -299,7 +299,7 @@ Timeline::film_change(ChangeType type, FilmProperty p) void -Timeline::recreate_views () +ContentTimeline::recreate_views() { auto film = _film.lock (); if (!film) { @@ -335,7 +335,7 @@ Timeline::recreate_views () void -Timeline::film_content_change (ChangeType type, int property, bool frequent) +ContentTimeline::film_content_change(ChangeType type, int property, bool frequent) { if (type != ChangeType::DONE) { return; @@ -432,7 +432,7 @@ struct AudioMappingComparator { void -Timeline::assign_tracks () +ContentTimeline::assign_tracks() { /* Tracks are: Video 1 @@ -496,14 +496,14 @@ Timeline::assign_tracks () int -Timeline::tracks () const +ContentTimeline::tracks() const { return _tracks; } void -Timeline::setup_scrollbars () +ContentTimeline::setup_scrollbars() { auto film = _film.lock (); if (!film || !_pixels_per_second) { @@ -520,7 +520,7 @@ Timeline::setup_scrollbars () shared_ptr -Timeline::event_to_view (wxMouseEvent& ev) +ContentTimeline::event_to_view(wxMouseEvent& ev) { /* Search backwards through views so that we find the uppermost one first */ auto i = _views.rbegin(); @@ -542,7 +542,7 @@ Timeline::event_to_view (wxMouseEvent& ev) void -Timeline::left_down (wxMouseEvent& ev) +ContentTimeline::left_down(wxMouseEvent& ev) { _left_down = true; _down_point = ev.GetPosition (); @@ -562,7 +562,7 @@ Timeline::left_down (wxMouseEvent& ev) void -Timeline::left_down_select (wxMouseEvent& ev) +ContentTimeline::left_down_select(wxMouseEvent& ev) { auto view = event_to_view (ev); auto content_view = dynamic_pointer_cast(view); @@ -625,7 +625,7 @@ Timeline::left_down_select (wxMouseEvent& ev) void -Timeline::left_up (wxMouseEvent& ev) +ContentTimeline::left_up(wxMouseEvent& ev) { _left_down = false; @@ -645,7 +645,7 @@ Timeline::left_up (wxMouseEvent& ev) void -Timeline::left_up_select (wxMouseEvent& ev) +ContentTimeline::left_up_select(wxMouseEvent& ev) { if (_down_view) { _down_view->content()->set_change_signals_frequent (false); @@ -670,7 +670,7 @@ Timeline::left_up_select (wxMouseEvent& ev) void -Timeline::left_up_zoom (wxMouseEvent& ev) +ContentTimeline::left_up_zoom(wxMouseEvent& ev) { _zoom_point = ev.GetPosition (); @@ -706,14 +706,14 @@ Timeline::left_up_zoom (wxMouseEvent& ev) void -Timeline::set_pixels_per_track (int h) +ContentTimeline::set_pixels_per_track(int h) { _pixels_per_track = max(_minimum_pixels_per_track, h); } void -Timeline::mouse_moved (wxMouseEvent& ev) +ContentTimeline::mouse_moved(wxMouseEvent& ev) { switch (_tool) { case SELECT: @@ -731,7 +731,7 @@ Timeline::mouse_moved (wxMouseEvent& ev) void -Timeline::mouse_moved_select (wxMouseEvent& ev) +ContentTimeline::mouse_moved_select(wxMouseEvent& ev) { if (!_left_down) { return; @@ -742,7 +742,7 @@ Timeline::mouse_moved_select (wxMouseEvent& ev) void -Timeline::mouse_moved_zoom (wxMouseEvent& ev) +ContentTimeline::mouse_moved_zoom(wxMouseEvent& ev) { if (!_left_down) { return; @@ -755,7 +755,7 @@ Timeline::mouse_moved_zoom (wxMouseEvent& ev) void -Timeline::right_down (wxMouseEvent& ev) +ContentTimeline::right_down(wxMouseEvent& ev) { switch (_tool) { case SELECT: @@ -777,7 +777,7 @@ Timeline::right_down (wxMouseEvent& ev) void -Timeline::right_down_select (wxMouseEvent& ev) +ContentTimeline::right_down_select(wxMouseEvent& ev) { auto view = event_to_view (ev); auto cv = dynamic_pointer_cast (view); @@ -795,7 +795,7 @@ Timeline::right_down_select (wxMouseEvent& ev) void -Timeline::maybe_snap (DCPTime a, DCPTime b, optional& nearest_distance) const +ContentTimeline::maybe_snap(DCPTime a, DCPTime b, optional& nearest_distance) const { auto const d = a - b; if (!nearest_distance || d.abs() < nearest_distance.get().abs()) { @@ -805,7 +805,7 @@ Timeline::maybe_snap (DCPTime a, DCPTime b, optional& nearest_distance) void -Timeline::set_position_from_event (wxMouseEvent& ev, bool force_emit) +ContentTimeline::set_position_from_event(wxMouseEvent& ev, bool force_emit) { if (!_pixels_per_second) { return; @@ -871,21 +871,21 @@ Timeline::set_position_from_event (wxMouseEvent& ev, bool force_emit) void -Timeline::force_redraw (dcpomatic::Rect const & r) +ContentTimeline::force_redraw(dcpomatic::Rect const & r) { _main_canvas->RefreshRect (wxRect (r.x, r.y, r.width, r.height), false); } shared_ptr -Timeline::film () const +ContentTimeline::film() const { return _film.lock (); } void -Timeline::resized () +ContentTimeline::resized() { if (_main_canvas->GetSize().GetWidth() > 0 && _first_resize) { zoom_all (); @@ -896,7 +896,7 @@ Timeline::resized () void -Timeline::clear_selection () +ContentTimeline::clear_selection() { for (auto i: _views) { shared_ptr cv = dynamic_pointer_cast(i); @@ -908,7 +908,7 @@ Timeline::clear_selection () TimelineContentViewList -Timeline::selected_views () const +ContentTimeline::selected_views() const { TimelineContentViewList sel; @@ -924,7 +924,7 @@ Timeline::selected_views () const ContentList -Timeline::selected_content () const +ContentTimeline::selected_content() const { ContentList sel; @@ -937,7 +937,7 @@ Timeline::selected_content () const void -Timeline::set_selection (ContentList selection) +ContentTimeline::set_selection(ContentList selection) { for (auto i: _views) { auto cv = dynamic_pointer_cast (i); @@ -949,21 +949,21 @@ Timeline::set_selection (ContentList selection) int -Timeline::tracks_y_offset () const +ContentTimeline::tracks_y_offset() const { return _reels_view->bbox().height + 4; } int -Timeline::width () const +ContentTimeline::width() const { return _main_canvas->GetVirtualSize().GetWidth(); } void -Timeline::scrolled (wxScrollWinEvent& ev) +ContentTimeline::scrolled(wxScrollWinEvent& ev) { if (ev.GetOrientation() == wxVERTICAL) { int x, y; @@ -975,7 +975,7 @@ Timeline::scrolled (wxScrollWinEvent& ev) void -Timeline::tool_clicked (Tool t) +ContentTimeline::tool_clicked(Tool t) { switch (t) { case ZOOM: @@ -993,7 +993,7 @@ Timeline::tool_clicked (Tool t) void -Timeline::zoom_all () +ContentTimeline::zoom_all() { auto film = _film.lock (); DCPOMATIC_ASSERT (film); @@ -1007,7 +1007,7 @@ Timeline::zoom_all () void -Timeline::keypress(wxKeyEvent const& event) +ContentTimeline::keypress(wxKeyEvent const& event) { if (event.GetKeyCode() == WXK_DELETE) { auto film = _film.lock(); diff --git a/src/wx/timeline.h b/src/wx/content_timeline.h similarity index 96% rename from src/wx/timeline.h rename to src/wx/content_timeline.h index 621609fa7..65b2ff956 100644 --- a/src/wx/timeline.h +++ b/src/wx/content_timeline.h @@ -39,10 +39,10 @@ class TimelineTimeAxisView; class TimelineView; -class Timeline : public wxPanel +class ContentTimeline : public wxPanel { public: - Timeline (wxWindow *, ContentPanel *, std::shared_ptr, FilmViewer& viewer); + ContentTimeline(wxWindow *, ContentPanel *, std::shared_ptr, FilmViewer& viewer); std::shared_ptr film () const; diff --git a/src/wx/timeline_atmos_content_view.cc b/src/wx/timeline_atmos_content_view.cc index ec0f06ec1..d40ede137 100644 --- a/src/wx/timeline_atmos_content_view.cc +++ b/src/wx/timeline_atmos_content_view.cc @@ -29,7 +29,7 @@ using std::shared_ptr; * @brief Timeline view for AtmosContent. */ -TimelineAtmosContentView::TimelineAtmosContentView (Timeline& tl, shared_ptr c) +TimelineAtmosContentView::TimelineAtmosContentView(ContentTimeline& tl, shared_ptr c) : TimelineContentView (tl, c) { diff --git a/src/wx/timeline_atmos_content_view.h b/src/wx/timeline_atmos_content_view.h index 15da14edc..9536837e0 100644 --- a/src/wx/timeline_atmos_content_view.h +++ b/src/wx/timeline_atmos_content_view.h @@ -28,7 +28,7 @@ class TimelineAtmosContentView : public TimelineContentView { public: - TimelineAtmosContentView (Timeline& tl, std::shared_ptr c); + TimelineAtmosContentView(ContentTimeline& tl, std::shared_ptr c); private: bool active () const override { diff --git a/src/wx/timeline_audio_content_view.cc b/src/wx/timeline_audio_content_view.cc index 057ebb944..2920bf4fd 100644 --- a/src/wx/timeline_audio_content_view.cc +++ b/src/wx/timeline_audio_content_view.cc @@ -18,20 +18,24 @@ */ + #include "timeline_audio_content_view.h" #include "wx_util.h" #include "lib/audio_content.h" #include "lib/util.h" + +using std::dynamic_pointer_cast; using std::list; using std::shared_ptr; -using std::dynamic_pointer_cast; + /** @class TimelineAudioContentView * @brief Timeline view for AudioContent. */ -TimelineAudioContentView::TimelineAudioContentView (Timeline& tl, shared_ptr c) + +TimelineAudioContentView::TimelineAudioContentView(ContentTimeline& tl, shared_ptr c) : TimelineContentView (tl, c) { diff --git a/src/wx/timeline_audio_content_view.h b/src/wx/timeline_audio_content_view.h index 5b8d6cdc2..29849adb2 100644 --- a/src/wx/timeline_audio_content_view.h +++ b/src/wx/timeline_audio_content_view.h @@ -28,7 +28,7 @@ class TimelineAudioContentView : public TimelineContentView { public: - TimelineAudioContentView (Timeline& tl, std::shared_ptr c); + TimelineAudioContentView(ContentTimeline& tl, std::shared_ptr c); private: bool active () const override { diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index 5d039d0d3..05ee6617b 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -19,7 +19,7 @@ */ -#include "timeline.h" +#include "content_timeline.h" #include "timeline_content_view.h" #include "wx_util.h" #include "lib/content.h" @@ -37,7 +37,7 @@ using namespace boost::placeholders; #endif -TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr c) +TimelineContentView::TimelineContentView(ContentTimeline& tl, shared_ptr c) : TimelineView (tl) , _content (c) { diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h index 7794120cd..ac84214f0 100644 --- a/src/wx/timeline_content_view.h +++ b/src/wx/timeline_content_view.h @@ -40,7 +40,7 @@ class Content; class TimelineContentView : public TimelineView { public: - TimelineContentView (Timeline& tl, std::shared_ptr c); + TimelineContentView(ContentTimeline& tl, std::shared_ptr c); dcpomatic::Rect bbox () const override; diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc index e0e1689a8..f0216a9cb 100644 --- a/src/wx/timeline_dialog.cc +++ b/src/wx/timeline_dialog.cc @@ -73,11 +73,11 @@ TimelineDialog::TimelineDialog(ContentPanel* cp, shared_ptr film, FilmView _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")); - _toolbar->AddCheckTool ((int) Timeline::SNAP, _("Snap"), snap, wxNullBitmap, _("Snap")); - _toolbar->AddCheckTool ((int) Timeline::SEQUENCE, _("Sequence"), sequence, wxNullBitmap, _("Keep video and subtitles in sequence")); + _toolbar->AddRadioTool(static_cast(ContentTimeline::SELECT), _("Select"), select, wxNullBitmap, _("Select and move content")); + _toolbar->AddRadioTool(static_cast(ContentTimeline::ZOOM), _("Zoom"), zoom, wxNullBitmap, _("Zoom in / out")); + _toolbar->AddTool(static_cast(ContentTimeline::ZOOM_ALL), _("Zoom all"), zoom_all, _("Zoom out to whole film")); + _toolbar->AddCheckTool(static_cast(ContentTimeline::SNAP), _("Snap"), snap, wxNullBitmap, _("Snap")); + _toolbar->AddCheckTool(static_cast(ContentTimeline::SEQUENCE), _("Sequence"), sequence, wxNullBitmap, _("Keep video and subtitles in sequence")); _toolbar->Realize (); _toolbar->Bind (wxEVT_TOOL, bind (&TimelineDialog::tool_clicked, this, _1)); @@ -98,7 +98,7 @@ TimelineDialog::TimelineDialog(ContentPanel* cp, shared_ptr film, FilmView Bind(wxEVT_CHAR_HOOK, boost::bind(&TimelineDialog::keypress, this, _1)); - _toolbar->ToggleTool ((int) Timeline::SNAP, _timeline.snap ()); + _toolbar->ToggleTool(static_cast(ContentTimeline::SNAP), _timeline.snap ()); film_change(ChangeType::DONE, FilmProperty::SEQUENCE); _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2)); @@ -118,7 +118,7 @@ TimelineDialog::film_change(ChangeType type, FilmProperty p) } if (p == FilmProperty::SEQUENCE) { - _toolbar->ToggleTool ((int) Timeline::SEQUENCE, film->sequence ()); + _toolbar->ToggleTool(static_cast(ContentTimeline::SEQUENCE), film->sequence()); } } @@ -133,11 +133,11 @@ TimelineDialog::set_selection (ContentList selection) void TimelineDialog::tool_clicked (wxCommandEvent& ev) { - Timeline::Tool t = static_cast(ev.GetId()); + auto t = static_cast(ev.GetId()); _timeline.tool_clicked (t); - if (t == Timeline::SNAP) { + if (t == ContentTimeline::SNAP) { _timeline.set_snap (_toolbar->GetToolState(static_cast(t))); - } else if (t == Timeline::SEQUENCE) { + } else if (t == ContentTimeline::SEQUENCE) { auto film = _film.lock (); if (film) { film->set_sequence (_toolbar->GetToolState(static_cast(t))); diff --git a/src/wx/timeline_dialog.h b/src/wx/timeline_dialog.h index 8134aa6db..d2821c20c 100644 --- a/src/wx/timeline_dialog.h +++ b/src/wx/timeline_dialog.h @@ -19,7 +19,7 @@ */ -#include "timeline.h" +#include "content_timeline.h" #include LIBDCP_DISABLE_WARNINGS #include @@ -42,7 +42,7 @@ private: void keypress(wxKeyEvent const& event); std::weak_ptr _film; - Timeline _timeline; + ContentTimeline _timeline; wxToolBar* _toolbar; boost::signals2::scoped_connection _film_changed_connection; }; diff --git a/src/wx/timeline_labels_view.cc b/src/wx/timeline_labels_view.cc index 181adc5ca..48c879d13 100644 --- a/src/wx/timeline_labels_view.cc +++ b/src/wx/timeline_labels_view.cc @@ -19,7 +19,7 @@ */ -#include "timeline.h" +#include "content_timeline.h" #include "timeline_labels_view.h" #include "wx_util.h" #include @@ -34,7 +34,7 @@ using std::max; using std::min; -TimelineLabelsView::TimelineLabelsView (Timeline& tl) +TimelineLabelsView::TimelineLabelsView(ContentTimeline& tl) : TimelineView (tl) { wxString labels[] = { diff --git a/src/wx/timeline_labels_view.h b/src/wx/timeline_labels_view.h index fb80b1bf3..1fa5b60b1 100644 --- a/src/wx/timeline_labels_view.h +++ b/src/wx/timeline_labels_view.h @@ -28,7 +28,7 @@ class wxWindow; class TimelineLabelsView : public TimelineView { public: - explicit TimelineLabelsView (Timeline& tl); + explicit TimelineLabelsView(ContentTimeline& tl); dcpomatic::Rect bbox () const override; diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc index 0601a1196..34ce96a4e 100644 --- a/src/wx/timeline_reels_view.cc +++ b/src/wx/timeline_reels_view.cc @@ -19,7 +19,7 @@ */ -#include "timeline.h" +#include "content_timeline.h" #include "timeline_reels_view.h" #include "wx_util.h" #include "lib/film.h" @@ -35,7 +35,7 @@ using std::list; using namespace dcpomatic; -TimelineReelsView::TimelineReelsView (Timeline& tl, int y) +TimelineReelsView::TimelineReelsView(ContentTimeline& tl, int y) : TimelineView (tl) , _y (y) { diff --git a/src/wx/timeline_reels_view.h b/src/wx/timeline_reels_view.h index 357fe2ce4..670df7c9d 100644 --- a/src/wx/timeline_reels_view.h +++ b/src/wx/timeline_reels_view.h @@ -25,7 +25,7 @@ class TimelineReelsView : public TimelineView { public: - TimelineReelsView (Timeline& tl, int y); + TimelineReelsView(ContentTimeline& tl, int y); dcpomatic::Rect bbox () const override; void set_y (int y); diff --git a/src/wx/timeline_text_content_view.cc b/src/wx/timeline_text_content_view.cc index a57398599..bc099d4d6 100644 --- a/src/wx/timeline_text_content_view.cc +++ b/src/wx/timeline_text_content_view.cc @@ -27,7 +27,7 @@ using std::shared_ptr; -TimelineTextContentView::TimelineTextContentView (Timeline& tl, shared_ptr c, shared_ptr caption) +TimelineTextContentView::TimelineTextContentView(ContentTimeline& tl, shared_ptr c, shared_ptr caption) : TimelineContentView (tl, c) , _caption (caption) { diff --git a/src/wx/timeline_text_content_view.h b/src/wx/timeline_text_content_view.h index 046f5b3e6..c33c2662e 100644 --- a/src/wx/timeline_text_content_view.h +++ b/src/wx/timeline_text_content_view.h @@ -18,10 +18,12 @@ */ + #include "timeline_content_view.h" + class TextContent; -class TextContent; + /** @class TimelineTextContentView * @brief Timeline view for TextContent. @@ -29,7 +31,7 @@ class TextContent; class TimelineTextContentView : public TimelineContentView { public: - TimelineTextContentView (Timeline& tl, std::shared_ptr, std::shared_ptr); + TimelineTextContentView(ContentTimeline& tl, std::shared_ptr, std::shared_ptr); private: bool active () const override; diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc index d055bda7d..b17b274b2 100644 --- a/src/wx/timeline_time_axis_view.cc +++ b/src/wx/timeline_time_axis_view.cc @@ -19,7 +19,7 @@ */ -#include "timeline.h" +#include "content_timeline.h" #include "timeline_time_axis_view.h" #include "wx_util.h" #include @@ -34,7 +34,7 @@ using std::list; using namespace dcpomatic; -TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y) +TimelineTimeAxisView::TimelineTimeAxisView(ContentTimeline& tl, int y) : TimelineView (tl) , _y (y) { diff --git a/src/wx/timeline_time_axis_view.h b/src/wx/timeline_time_axis_view.h index 4c8e090fe..6ffb9e5dc 100644 --- a/src/wx/timeline_time_axis_view.h +++ b/src/wx/timeline_time_axis_view.h @@ -23,7 +23,7 @@ class TimelineTimeAxisView : public TimelineView { public: - TimelineTimeAxisView (Timeline& tl, int y); + TimelineTimeAxisView(ContentTimeline& tl, int y); dcpomatic::Rect bbox () const override; void set_y (int y); diff --git a/src/wx/timeline_video_content_view.cc b/src/wx/timeline_video_content_view.cc index b0f4b4f5d..d72b1e149 100644 --- a/src/wx/timeline_video_content_view.cc +++ b/src/wx/timeline_video_content_view.cc @@ -18,14 +18,17 @@ */ + #include "lib/image_content.h" #include "lib/video_content.h" #include "timeline_video_content_view.h" + using std::dynamic_pointer_cast; using std::shared_ptr; -TimelineVideoContentView::TimelineVideoContentView (Timeline& tl, shared_ptr c) + +TimelineVideoContentView::TimelineVideoContentView(ContentTimeline& tl, shared_ptr c) : TimelineContentView (tl, c) { diff --git a/src/wx/timeline_video_content_view.h b/src/wx/timeline_video_content_view.h index fa8ddf54c..507f3caed 100644 --- a/src/wx/timeline_video_content_view.h +++ b/src/wx/timeline_video_content_view.h @@ -28,7 +28,7 @@ class TimelineVideoContentView : public TimelineContentView { public: - TimelineVideoContentView (Timeline& tl, std::shared_ptr c); + TimelineVideoContentView(ContentTimeline& tl, std::shared_ptr c); private: bool active () const override; diff --git a/src/wx/timeline_view.cc b/src/wx/timeline_view.cc index 2897c98e3..f81ddd413 100644 --- a/src/wx/timeline_view.cc +++ b/src/wx/timeline_view.cc @@ -19,8 +19,8 @@ */ +#include "content_timeline.h" #include "timeline_view.h" -#include "timeline.h" using std::list; @@ -30,7 +30,7 @@ using namespace dcpomatic; /** @class TimelineView * @brief Parent class for components of the timeline (e.g. a piece of content or an axis). */ -TimelineView::TimelineView (Timeline& t) +TimelineView::TimelineView(ContentTimeline& t) : _timeline (t) { diff --git a/src/wx/timeline_view.h b/src/wx/timeline_view.h index 166a1121a..e753255e3 100644 --- a/src/wx/timeline_view.h +++ b/src/wx/timeline_view.h @@ -28,7 +28,7 @@ class wxGraphicsContext; -class Timeline; +class ContentTimeline; /** @class TimelineView @@ -37,7 +37,7 @@ class Timeline; class TimelineView { public: - explicit TimelineView (Timeline& t); + explicit TimelineView(ContentTimeline& t); virtual ~TimelineView () {} TimelineView (TimelineView const&) = delete; @@ -54,7 +54,7 @@ protected: int time_x (dcpomatic::DCPTime t) const; int y_pos(int t) const; - Timeline& _timeline; + ContentTimeline& _timeline; private: dcpomatic::Rect _last_paint_bbox; diff --git a/src/wx/wscript b/src/wx/wscript index 7dbd214c6..abf260ad6 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -48,6 +48,7 @@ sources = """ content_panel.cc content_properties_dialog.cc content_sub_panel.cc + content_timeline.cc content_version_dialog.cc content_view.cc controls.cc @@ -160,7 +161,6 @@ sources = """ time_picker.cc timer_display.cc timecode.cc - timeline.cc timeline_atmos_content_view.cc timeline_content_view.cc timeline_dialog.cc -- 2.30.2