Rename TimelineView -> ContentTimelineView.
authorCarl Hetherington <cth@carlh.net>
Wed, 13 Dec 2023 22:01:23 +0000 (23:01 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2024 23:43:51 +0000 (00:43 +0100)
15 files changed:
src/wx/content_timeline.cc
src/wx/content_timeline.h
src/wx/content_timeline_view.cc [new file with mode: 0644]
src/wx/content_timeline_view.h [new file with mode: 0644]
src/wx/timeline_content_view.cc
src/wx/timeline_content_view.h
src/wx/timeline_labels_view.cc
src/wx/timeline_labels_view.h
src/wx/timeline_reels_view.cc
src/wx/timeline_reels_view.h
src/wx/timeline_time_axis_view.cc
src/wx/timeline_time_axis_view.h
src/wx/timeline_view.cc [deleted file]
src/wx/timeline_view.h [deleted file]
src/wx/wscript

index b650f8e922beeb22c1c0dd360808b70f883c7f89..368cbcca485dedfe8b8de6a383c9ba1773903464 100644 (file)
@@ -356,7 +356,7 @@ ContentTimeline::film_content_change(ChangeType type, int property, bool frequen
 
 template <class T>
 int
-place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
+place(shared_ptr<const Film> film, ContentTimelineViewList& views, int& tracks)
 {
        int const base = tracks;
 
@@ -413,7 +413,7 @@ place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
  *  order of first mapped DCP channel.
  */
 struct AudioMappingComparator {
-       bool operator()(shared_ptr<TimelineView> a, shared_ptr<TimelineView> b) {
+       bool operator()(shared_ptr<ContentTimelineView> a, shared_ptr<ContentTimelineView> b) {
                int la = -1;
                auto cva = dynamic_pointer_cast<TimelineAudioContentView>(a);
                if (cva) {
@@ -519,7 +519,7 @@ ContentTimeline::setup_scrollbars()
 }
 
 
-shared_ptr<TimelineView>
+shared_ptr<ContentTimelineView>
 ContentTimeline::event_to_view(wxMouseEvent& ev)
 {
        /* Search backwards through views so that we find the uppermost one first */
index 65b2ff956e8dc2b6220d8fbb0254312dde665505..994f18ad4620f4380c100032332ab73f6a04600b 100644 (file)
@@ -31,12 +31,12 @@ LIBDCP_ENABLE_WARNINGS
 
 
 class ContentPanel;
+class ContentTimelineView;
 class Film;
 class FilmViewer;
 class TimelineLabelsView;
 class TimelineReelsView;
 class TimelineTimeAxisView;
-class TimelineView;
 
 
 class ContentTimeline : public wxPanel
@@ -112,7 +112,7 @@ private:
        void update_playhead ();
        void mouse_wheel_turned(wxMouseEvent& event);
 
-       std::shared_ptr<TimelineView> event_to_view (wxMouseEvent &);
+       std::shared_ptr<ContentTimelineView> event_to_view(wxMouseEvent &);
        TimelineContentViewList selected_views () const;
        ContentList selected_content () const;
        void maybe_snap (dcpomatic::DCPTime a, dcpomatic::DCPTime b, boost::optional<dcpomatic::DCPTime>& nearest_distance) const;
@@ -122,7 +122,7 @@ private:
        ContentPanel* _content_panel;
        std::weak_ptr<Film> _film;
        FilmViewer& _viewer;
-       TimelineViewList _views;
+       ContentTimelineViewList _views;
        std::shared_ptr<TimelineTimeAxisView> _time_axis_view;
        std::shared_ptr<TimelineReelsView> _reels_view;
        std::shared_ptr<TimelineLabelsView> _labels_view;
diff --git a/src/wx/content_timeline_view.cc b/src/wx/content_timeline_view.cc
new file mode 100644 (file)
index 0000000..05922d5
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "content_timeline.h"
+#include "content_timeline_view.h"
+
+
+using std::list;
+using namespace dcpomatic;
+
+
+/** @class ContentContentTimelineView
+ *  @brief Parent class for components of the content timeline (e.g. a piece of content or an axis).
+ */
+ContentTimelineView::ContentTimelineView(ContentTimeline& t)
+       : _timeline (t)
+{
+
+}
+
+
+void
+ContentTimelineView::paint(wxGraphicsContext* g, list<dcpomatic::Rect<int>> overlaps)
+{
+       _last_paint_bbox = bbox ();
+       do_paint (g, overlaps);
+}
+
+
+void
+ContentTimelineView::force_redraw()
+{
+       _timeline.force_redraw (_last_paint_bbox.extended(4));
+       _timeline.force_redraw (bbox().extended(4));
+}
+
+
+int
+ContentTimelineView::time_x(DCPTime t) const
+{
+       return t.seconds() * _timeline.pixels_per_second().get_value_or(0);
+}
+
+
+int
+ContentTimelineView::y_pos(int t) const
+{
+       return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset();
+}
+
+
diff --git a/src/wx/content_timeline_view.h b/src/wx/content_timeline_view.h
new file mode 100644 (file)
index 0000000..0f6eeae
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#ifndef DCPOMATIC_CONTENT_TIMELINE_VIEW_H
+#define DCPOMATIC_CONTENT_TIMELINE_VIEW_H
+
+
+#include "lib/rect.h"
+#include "lib/dcpomatic_time.h"
+
+
+class wxGraphicsContext;
+class ContentTimeline;
+
+
+/** @class ContentTimelineView
+ *  @brief Parent class for components of the content timeline (e.g. a piece of content or an axis).
+ */
+class ContentTimelineView
+{
+public:
+       explicit ContentTimelineView(ContentTimeline& t);
+       virtual ~ContentTimelineView () = default;
+
+       ContentTimelineView(ContentTimelineView const&) = delete;
+       ContentTimelineView& operator=(ContentTimelineView const&) = delete;
+
+       void paint (wxGraphicsContext* g, std::list<dcpomatic::Rect<int>> overlaps);
+       void force_redraw ();
+
+       virtual dcpomatic::Rect<int> bbox () const = 0;
+
+protected:
+       virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0;
+
+       int time_x (dcpomatic::DCPTime t) const;
+       int y_pos(int t) const;
+
+       ContentTimeline& _timeline;
+
+private:
+       dcpomatic::Rect<int> _last_paint_bbox;
+};
+
+
+typedef std::vector<std::shared_ptr<ContentTimelineView>> ContentTimelineViewList;
+
+
+#endif
index 05ee6617b4148ffdce8c0cc93a116c3f8e2fdefd..cb0d102405ea34cad4e6b8bc65a4c56820b75557 100644 (file)
@@ -38,7 +38,7 @@ using namespace boost::placeholders;
 
 
 TimelineContentView::TimelineContentView(ContentTimeline& tl, shared_ptr<Content> c)
-       : TimelineView (tl)
+       : ContentTimelineView(tl)
        , _content (c)
 {
        _content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3));
index ac84214f04d24795b36f6cadc9f9911aaaee3891..7b206d30f324f8fefb0cc5580997e12ab29cab9c 100644 (file)
@@ -23,7 +23,7 @@
 #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 
 
-#include "timeline_view.h"
+#include "content_timeline_view.h"
 #include "lib/change_signaller.h"
 #include <dcp/warnings.h>
 LIBDCP_DISABLE_WARNINGS
@@ -37,7 +37,7 @@ class Content;
 /** @class TimelineContentView
  *  @brief Parent class for views of pieces of content.
  */
-class TimelineContentView : public TimelineView
+class TimelineContentView : public ContentTimelineView
 {
 public:
        TimelineContentView(ContentTimeline& tl, std::shared_ptr<Content> c);
index 48c879d13dd616d4a7159b54fc253e186968394e..c869d7ec524a63d85287e42dfe765a0674aa8dd6 100644 (file)
@@ -35,7 +35,7 @@ using std::min;
 
 
 TimelineLabelsView::TimelineLabelsView(ContentTimeline& tl)
-       : TimelineView (tl)
+       : ContentTimelineView(tl)
 {
        wxString labels[] = {
                _("Video"),
index 1fa5b60b1ee1397604b9dd0403f398d01ed8f377..324531c397c715b810b0ba431ea017d0c70e21fe 100644 (file)
 */
 
 
-#include "timeline_view.h"
+#include "content_timeline_view.h"
 
 
 class wxWindow;
 
 
-class TimelineLabelsView : public TimelineView
+class TimelineLabelsView : public ContentTimelineView
 {
 public:
        explicit TimelineLabelsView(ContentTimeline& tl);
index 34ce96a4ee3bc12028a26fd0300fe3d7cb709403..5f2a7807954dd047a0019966e444518196a0711c 100644 (file)
@@ -36,7 +36,7 @@ using namespace dcpomatic;
 
 
 TimelineReelsView::TimelineReelsView(ContentTimeline& tl, int y)
-       : TimelineView (tl)
+       : ContentTimelineView(tl)
        , _y (y)
 {
 
index 670df7c9dd169d79f4554a4e43122c6069c90d48..7dbc34308289721e32424831df359540d2b31da3 100644 (file)
 */
 
 
-#include "timeline_view.h"
+#include "content_timeline_view.h"
 
 
-class TimelineReelsView : public TimelineView
+class TimelineReelsView : public ContentTimelineView
 {
 public:
        TimelineReelsView(ContentTimeline& tl, int y);
index b17b274b2af5540acf6da2dee824d3bdc97e75d0..d9b7710c62589ff61f4ceae5ac37d6a13ef14f4c 100644 (file)
@@ -35,7 +35,7 @@ using namespace dcpomatic;
 
 
 TimelineTimeAxisView::TimelineTimeAxisView(ContentTimeline& tl, int y)
-       : TimelineView (tl)
+       : ContentTimelineView(tl)
        , _y (y)
 {
 
index 6ffb9e5dc27a3c19719216c1cd7b0a8585ab144c..f89121776dcb774fa853cf358e9ec44313d0df60 100644 (file)
 
 */
 
-#include "timeline_view.h"
 
-class TimelineTimeAxisView : public TimelineView
+#include "content_timeline_view.h"
+
+
+class TimelineTimeAxisView : public ContentTimelineView
 {
 public:
        TimelineTimeAxisView(ContentTimeline& tl, int y);
diff --git a/src/wx/timeline_view.cc b/src/wx/timeline_view.cc
deleted file mode 100644 (file)
index f81ddd4..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-
-#include "content_timeline.h"
-#include "timeline_view.h"
-
-
-using std::list;
-using namespace dcpomatic;
-
-
-/** @class TimelineView
- *  @brief Parent class for components of the timeline (e.g. a piece of content or an axis).
- */
-TimelineView::TimelineView(ContentTimeline& t)
-       : _timeline (t)
-{
-
-}
-
-
-void
-TimelineView::paint (wxGraphicsContext* g, list<dcpomatic::Rect<int>> overlaps)
-{
-       _last_paint_bbox = bbox ();
-       do_paint (g, overlaps);
-}
-
-
-void
-TimelineView::force_redraw ()
-{
-       _timeline.force_redraw (_last_paint_bbox.extended(4));
-       _timeline.force_redraw (bbox().extended(4));
-}
-
-
-int
-TimelineView::time_x (DCPTime t) const
-{
-       return t.seconds() * _timeline.pixels_per_second().get_value_or(0);
-}
-
-
-int
-TimelineView::y_pos(int t) const
-{
-       return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset();
-}
-
-
diff --git a/src/wx/timeline_view.h b/src/wx/timeline_view.h
deleted file mode 100644 (file)
index e753255..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
-
-    This file is part of DCP-o-matic.
-
-    DCP-o-matic is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    DCP-o-matic is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-
-#ifndef DCPOMATIC_TIMELINE_VIEW_H
-#define DCPOMATIC_TIMELINE_VIEW_H
-
-
-#include "lib/rect.h"
-#include "lib/dcpomatic_time.h"
-
-
-class wxGraphicsContext;
-class ContentTimeline;
-
-
-/** @class TimelineView
- *  @brief Parent class for components of the timeline (e.g. a piece of content or an axis).
- */
-class TimelineView
-{
-public:
-       explicit TimelineView(ContentTimeline& t);
-       virtual ~TimelineView () {}
-
-       TimelineView (TimelineView const&) = delete;
-       TimelineView& operator= (TimelineView const&) = delete;
-
-       void paint (wxGraphicsContext* g, std::list<dcpomatic::Rect<int>> overlaps);
-       void force_redraw ();
-
-       virtual dcpomatic::Rect<int> bbox () const = 0;
-
-protected:
-       virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0;
-
-       int time_x (dcpomatic::DCPTime t) const;
-       int y_pos(int t) const;
-
-       ContentTimeline& _timeline;
-
-private:
-       dcpomatic::Rect<int> _last_paint_bbox;
-};
-
-
-typedef std::vector<std::shared_ptr<TimelineView>> TimelineViewList;
-
-
-#endif
index abf260ad6a1d2be1fb848d89598e833297ee7001..830d76731979551effd12ca56ef6aca99c78c2fc 100644 (file)
@@ -49,6 +49,7 @@ sources = """
           content_properties_dialog.cc
           content_sub_panel.cc
           content_timeline.cc
+          content_timeline_view.cc
           content_version_dialog.cc
           content_view.cc
           controls.cc
@@ -170,7 +171,6 @@ sources = """
           timeline_reels_view.cc
           timeline_time_axis_view.cc
           timeline_video_content_view.cc
-          timeline_view.cc
           timing_panel.cc
           try_unmount_dialog.cc
           update_dialog.cc