Move y_pos to TimelineView.
[dcpomatic.git] / src / wx / timeline_content_view.h
index 7875900991b587f83c496739afec984c18e3983e..aa9832e5db14453accce3c2ae88fa17587d261e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 
+
 #include "timeline_view.h"
+#include "lib/change_signaller.h"
+#include "lib/types.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
 class Content;
 
+
 /** @class TimelineContentView
  *  @brief Parent class for views of pieces of content.
  */
 class TimelineContentView : public TimelineView
 {
 public:
-       TimelineContentView (Timeline& tl, boost::shared_ptr<Content> c);
+       TimelineContentView (Timeline& tl, std::shared_ptr<Content> c);
 
-       dcpomatic::Rect<int> bbox () const;
+       dcpomatic::Rect<int> bbox () const override;
 
        void set_selected (bool s);
        bool selected () const;
-       boost::shared_ptr<Content> content () const;
+       std::shared_ptr<Content> content () const;
        void set_track (int t);
        void unset_track ();
        boost::optional<int> track () const;
@@ -47,23 +55,25 @@ public:
        virtual bool active () const = 0;
        virtual wxColour background_colour () const = 0;
        virtual wxColour foreground_colour () const = 0;
+       virtual wxString label () const;
 
 protected:
 
-       boost::weak_ptr<Content> _content;
+       std::weak_ptr<Content> _content;
 
 private:
 
-       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps);
-       int y_pos (int t) const;
-       void content_changed (int p);
+       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) override;
+       void content_change (ChangeType type, int p);
 
        boost::optional<int> _track;
-       bool _selected;
+       bool _selected = false;
 
        boost::signals2::scoped_connection _content_connection;
 };
 
-typedef std::vector<boost::shared_ptr<TimelineContentView> > TimelineContentViewList;
+
+typedef std::vector<std::shared_ptr<TimelineContentView>> TimelineContentViewList;
+
 
 #endif