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;
* 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) {
}
-shared_ptr<TimelineView>
+shared_ptr<ContentTimelineView>
ContentTimeline::event_to_view(wxMouseEvent& ev)
{
/* Search backwards through views so that we find the uppermost one first */
class ContentPanel;
+class ContentTimelineView;
class Film;
class FilmViewer;
class TimelineLabelsView;
class TimelineReelsView;
class TimelineTimeAxisView;
-class TimelineView;
class ContentTimeline : public wxPanel
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;
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;
--- /dev/null
+/*
+ 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();
+}
+
+
--- /dev/null
+/*
+ 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
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));
#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
/** @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);
TimelineLabelsView::TimelineLabelsView(ContentTimeline& tl)
- : TimelineView (tl)
+ : ContentTimelineView(tl)
{
wxString labels[] = {
_("Video"),
*/
-#include "timeline_view.h"
+#include "content_timeline_view.h"
class wxWindow;
-class TimelineLabelsView : public TimelineView
+class TimelineLabelsView : public ContentTimelineView
{
public:
explicit TimelineLabelsView(ContentTimeline& tl);
TimelineReelsView::TimelineReelsView(ContentTimeline& tl, int y)
- : TimelineView (tl)
+ : ContentTimelineView(tl)
, _y (y)
{
*/
-#include "timeline_view.h"
+#include "content_timeline_view.h"
-class TimelineReelsView : public TimelineView
+class TimelineReelsView : public ContentTimelineView
{
public:
TimelineReelsView(ContentTimeline& tl, int y);
TimelineTimeAxisView::TimelineTimeAxisView(ContentTimeline& tl, int y)
- : TimelineView (tl)
+ : ContentTimelineView(tl)
, _y (y)
{
*/
-#include "timeline_view.h"
-class TimelineTimeAxisView : public TimelineView
+#include "content_timeline_view.h"
+
+
+class TimelineTimeAxisView : public ContentTimelineView
{
public:
TimelineTimeAxisView(ContentTimeline& tl, int y);
+++ /dev/null
-/*
- 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();
-}
-
-
+++ /dev/null
-/*
- 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
content_properties_dialog.cc
content_sub_panel.cc
content_timeline.cc
+ content_timeline_view.cc
content_version_dialog.cc
content_view.cc
controls.cc
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