X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ftimeline_content_view.h;h=7087e9641b62cd7073792cfa97441ff89b0fabd8;hb=e9ae050b0b15c91c3f591ad84938e60d271357b3;hp=7875900991b587f83c496739afec984c18e3983e;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/wx/timeline_content_view.h b/src/wx/timeline_content_view.h index 787590099..7087e9641 100644 --- a/src/wx/timeline_content_view.h +++ b/src/wx/timeline_content_view.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,28 +18,36 @@ */ + #ifndef DCPOMATIC_TIMELINE_CONTENT_VIEW_H #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H + +#include "lib/change_signaller.h" +#include "lib/types.h" +#include "lib/warnings.h" #include "timeline_view.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS #include class Content; + /** @class TimelineContentView * @brief Parent class for views of pieces of content. */ class TimelineContentView : public TimelineView { public: - TimelineContentView (Timeline& tl, boost::shared_ptr c); + TimelineContentView (Timeline& tl, std::shared_ptr c); - dcpomatic::Rect bbox () const; + dcpomatic::Rect bbox () const override; void set_selected (bool s); bool selected () const; - boost::shared_ptr content () const; + std::shared_ptr content () const; void set_track (int t); void unset_track (); boost::optional track () const; @@ -47,23 +55,26 @@ 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; + std::weak_ptr _content; private: - void do_paint (wxGraphicsContext* gc, std::list > overlaps); + void do_paint (wxGraphicsContext* gc, std::list> overlaps) override; int y_pos (int t) const; - void content_changed (int p); + void content_change (ChangeType type, int p); boost::optional _track; - bool _selected; + bool _selected = false; boost::signals2::scoped_connection _content_connection; }; -typedef std::vector > TimelineContentViewList; + +typedef std::vector> TimelineContentViewList; + #endif