2 Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef DCPOMATIC_TIMELINE_CONTENT_VIEW_H
21 #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
23 #include "timeline_view.h"
25 #include <boost/signals2.hpp>
29 /** @class TimelineContentView
30 * @brief Parent class for views of pieces of content.
32 class TimelineContentView : public TimelineView
35 TimelineContentView (Timeline& tl, boost::shared_ptr<Content> c);
37 dcpomatic::Rect<int> bbox () const;
39 void set_selected (bool s);
40 bool selected () const;
41 boost::shared_ptr<Content> content () const;
42 void set_track (int t);
44 boost::optional<int> track () const;
46 virtual wxString type () const = 0;
47 virtual wxColour background_colour () const = 0;
48 virtual wxColour foreground_colour () const = 0;
52 void do_paint (wxGraphicsContext* gc);
53 int y_pos (int t) const;
54 void content_changed (int p, bool frequent);
56 boost::weak_ptr<Content> _content;
57 boost::optional<int> _track;
60 boost::signals2::scoped_connection _content_connection;
63 typedef std::vector<boost::shared_ptr<TimelineContentView> > TimelineContentViewList;