#include "film_viewer.h"
+#include "id.h"
#include "markers.h"
#include "markers_panel.h"
#include "wx_util.h"
+#include "lib/film.h"
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
#include <wx/graphics.h>
enum {
- ID_move_marker_to_current_position,
+ ID_move_marker_to_current_position = DCPOMATIC_MARKERS_PANEL_MENU,
ID_remove_marker,
ID_add_marker,
/* Leave some space after this one as we use an ID for each marker type
Bind (wxEVT_MENU, boost::bind(&MarkersPanel::move_marker_to_current_position, this), ID_move_marker_to_current_position);
Bind (wxEVT_MENU, boost::bind(&MarkersPanel::remove_marker, this), ID_remove_marker);
- Bind (wxEVT_MENU, boost::bind(&MarkersPanel::add_marker, this, _1), ID_add_base, ID_add_base + all_editable_markers().size());
+ Bind(wxEVT_MENU, boost::bind(&MarkersPanel::add_marker, this, _1), ID_add_base, ID_add_base + all_editable_markers().size() + uneditable_markers);
}
void
-MarkersPanel::film_changed (ChangeType type, Film::Property property)
+MarkersPanel::film_changed(ChangeType type, FilmProperty property)
{
if (type != ChangeType::DONE) {
return;
return;
}
- if (property == Film::Property::MARKERS || property == Film::Property::CONTENT || property == Film::Property::CONTENT_ORDER || property == Film::Property::VIDEO_FRAME_RATE) {
+ if (property == FilmProperty::MARKERS || property == FilmProperty::CONTENT || property == FilmProperty::CONTENT_ORDER || property == FilmProperty::VIDEO_FRAME_RATE) {
update_from_film (film);
}
}
line.MoveToPoint (pos, 0);
line.AddLineToPoint (pos, panel_height);
gc->StrokePath (line);
- if (marker.second.line_before_label) {
- gc->DrawText (label, pos + line_to_label_gap, 0);
+
+ auto label_x = 0;
+
+ if (GetLayoutDirection() == wxLayout_RightToLeft) {
+ auto matrix = dc.GetTransformMatrix();
+ matrix.Translate(0, 0);
+ matrix.Mirror(wxHORIZONTAL);
+ dc.SetTransformMatrix(matrix);
+ label_x = marker.second.line_before_label ? (pos + line_to_label_gap + marker.second.width) : (pos - line_to_label_gap);
+ label_x = -label_x;
} else {
- gc->DrawText (label, pos - line_to_label_gap - marker.second.width, 0);
+ label_x = marker.second.line_before_label ? (pos + line_to_label_gap) : (pos - line_to_label_gap - marker.second.width);
}
+
+ gc->DrawText(label, label_x, 0);
+
+ dc.ResetTransformMatrix();
}
}