2 Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "timeline_labels_view.h"
25 #include <wx/graphics.h>
31 TimelineLabelsView::TimelineLabelsView (Timeline& tl)
34 , _subtitle_tracks (0)
46 wxClientDC dc (&_timeline);
47 for (int i = 0; i < 3; ++i) {
48 wxSize size = dc.GetTextExtent (labels[i]);
49 _width = max (_width, size.GetWidth());
56 TimelineLabelsView::bbox () const
58 return dcpomatic::Rect<int> (0, 0, _width, _timeline.tracks() * _timeline.track_height());
62 TimelineLabelsView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> >)
64 int const h = _timeline.track_height ();
65 gc->SetFont (gc->CreateFont(wxNORMAL_FONT->Bold(), wxColour (0, 0, 0)));
68 int ty = _threed ? 2 * h : h;
69 gc->DrawText (_("Video"), 0, _timeline.tracks_position().y + (ty + fy) / 2 - 8);
72 if (_subtitle_tracks) {
73 ty = fy + _subtitle_tracks * h;
74 gc->DrawText (_("Subtitles"), 0, _timeline.tracks_position().y + (ty + fy) / 2 - 8);
80 gc->DrawText (_("Atmos"), 0, _timeline.tracks_position().y + (ty + fy) / 2 - 8);
84 ty = _timeline.tracks() * h;
85 gc->DrawText (_("Audio"), 0, _timeline.tracks_position().y + (ty + fy) / 2 - 8);
89 TimelineLabelsView::set_3d (bool s)
95 TimelineLabelsView::set_subtitle_tracks (int n)
101 TimelineLabelsView::set_atmos (bool s)