2 Copyright (C) 2016-2021 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/>.
23 #include "timeline_labels_view.h"
24 #include <dcp/warnings.h>
25 LIBDCP_DISABLE_WARNINGS
26 #include <wx/graphics.h>
28 LIBDCP_ENABLE_WARNINGS
36 TimelineLabelsView::TimelineLabelsView (Timeline& tl)
42 _("Subtitles/captions"),
46 wxClientDC dc (&_timeline);
47 for (int i = 0; i < 3; ++i) {
48 auto size = dc.GetTextExtent (labels[i]);
49 _width = max (_width, size.GetWidth());
57 TimelineLabelsView::bbox () const
59 return dcpomatic::Rect<int> (0, 0, _width, _timeline.tracks() * _timeline.pixels_per_track());
64 TimelineLabelsView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>>)
66 int const h = _timeline.pixels_per_track ();
67 gc->SetFont (gc->CreateFont(wxNORMAL_FONT->Bold(), wxColour(0, 0, 0)));
71 int ty = fy + _video_tracks * h;
72 gc->DrawText (_("Video"), 0, (ty + fy) / 2 - 8);
77 int ty = fy + _text_tracks * h;
78 gc->DrawText (_("Subtitles/captions"), 0, (ty + fy) / 2 - 8);
84 gc->DrawText (_("Atmos"), 0, (ty + fy) / 2 - 8);
89 int ty = _timeline.tracks() * h;
90 gc->DrawText (_("Audio"), 0, (ty + fy) / 2 - 8);
96 TimelineLabelsView::set_video_tracks (int n)
103 TimelineLabelsView::set_audio_tracks (int n)
110 TimelineLabelsView::set_text_tracks (int n)
117 TimelineLabelsView::set_atmos (bool s)