summaryrefslogtreecommitdiff
path: root/src/wx/timeline_content_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-04 23:42:21 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-04 23:42:21 +0100
commita44d87088c380e2e282b1df65d6bd55795091c72 (patch)
treeeb7d736602a3b97da7581818953957ad8fdbc377 /src/wx/timeline_content_view.cc
parentc15424c691168f2071bc54dadb9e265a58d334d1 (diff)
Label audio content with mapping (part of #1279).
Diffstat (limited to 'src/wx/timeline_content_view.cc')
-rw-r--r--src/wx/timeline_content_view.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index 88b50076a..bf22e0156 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -141,15 +141,15 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
}
/* Label text */
- wxString name = std_to_wx (cont->summary());
- wxDouble name_width;
- wxDouble name_height;
- wxDouble name_descent;
- wxDouble name_leading;
+ wxString lab = label ();
+ wxDouble lab_width;
+ wxDouble lab_height;
+ wxDouble lab_descent;
+ wxDouble lab_leading;
gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, foreground_colour ()));
- gc->GetTextExtent (name, &name_width, &name_height, &name_descent, &name_leading);
+ gc->GetTextExtent (lab, &lab_width, &lab_height, &lab_descent, &lab_leading);
gc->Clip (wxRegion (time_x (position), y_pos (_track.get()), len.seconds() * _timeline.pixels_per_second().get_value_or(0), _timeline.pixels_per_track()));
- gc->DrawText (name, time_x (position) + 12, y_pos (_track.get() + 1) - name_height - 4);
+ gc->DrawText (lab, time_x (position) + 12, y_pos (_track.get() + 1) - lab_height - 4);
gc->ResetClip ();
}
@@ -168,3 +168,9 @@ TimelineContentView::content_changed (int p)
force_redraw ();
}
}
+
+wxString
+TimelineContentView::label () const
+{
+ return std_to_wx(content()->summary());
+}