mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Compare commits
6 commits
b884f7c534
...
dd159b0841
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd159b0841 | ||
|
|
4020561389 | ||
|
|
60cbe57a6e | ||
|
|
16c809986d | ||
|
|
90e6107972 | ||
|
|
8ddf057553 |
12 changed files with 408 additions and 209 deletions
|
|
@ -160,34 +160,32 @@ Editor::initialize_canvas ()
|
||||||
meter_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
|
meter_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, (timebar_height * 5.0) + 1.0));
|
||||||
CANVAS_DEBUG_NAME (meter_group, "meter group");
|
CANVAS_DEBUG_NAME (meter_group, "meter group");
|
||||||
|
|
||||||
meter_bar = new ArdourCanvas::Rectangle (meter_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
float timebar_thickness = timebar_height; //was 4
|
||||||
|
float timebar_top = (timebar_height - timebar_thickness)/2;
|
||||||
|
float timebar_btm = timebar_height - timebar_top;
|
||||||
|
|
||||||
|
meter_bar = new ArdourCanvas::Rectangle (meter_group, ArdourCanvas::Rect (0.0, 0., ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
CANVAS_DEBUG_NAME (meter_bar, "meter Bar");
|
||||||
meter_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
meter_bar->set_outline(false);
|
||||||
|
|
||||||
tempo_bar = new ArdourCanvas::Rectangle (tempo_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
tempo_bar = new ArdourCanvas::Rectangle (tempo_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||||
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
CANVAS_DEBUG_NAME (tempo_bar, "Tempo Bar");
|
||||||
tempo_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
CANVAS_DEBUG_NAME (range_marker_bar, "Range Marker Bar");
|
||||||
range_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
transport_marker_bar = new ArdourCanvas::Rectangle (transport_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
transport_marker_bar = new ArdourCanvas::Rectangle (transport_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
CANVAS_DEBUG_NAME (transport_marker_bar, "transport Marker Bar");
|
||||||
transport_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
marker_bar = new ArdourCanvas::Rectangle (marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
marker_bar = new ArdourCanvas::Rectangle (marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
CANVAS_DEBUG_NAME (marker_bar, "Marker Bar");
|
||||||
marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
cd_marker_bar = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
cd_marker_bar = new ArdourCanvas::Rectangle (cd_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
CANVAS_DEBUG_NAME (cd_marker_bar, "CD Marker Bar");
|
||||||
cd_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
cue_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
cue_marker_group = new ArdourCanvas::Container (_time_markers_group, ArdourCanvas::Duple (0.0, 0.0));
|
||||||
cue_marker_bar = new ArdourCanvas::Rectangle (cue_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
|
cue_marker_bar = new ArdourCanvas::Rectangle (cue_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
CANVAS_DEBUG_NAME (cd_marker_bar, "Cue Marker Bar");
|
CANVAS_DEBUG_NAME (cue_marker_bar, "Cue Marker Bar");
|
||||||
cue_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
|
|
||||||
|
|
||||||
ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
|
ARDOUR_UI::instance()->video_timeline = new VideoTimeLine(this, videotl_group, (timebar_height * videotl_bar_height));
|
||||||
|
|
||||||
|
|
@ -1028,26 +1026,14 @@ Editor::color_handler()
|
||||||
|
|
||||||
_playhead_cursor->set_color (UIConfiguration::instance().color ("play head"));
|
_playhead_cursor->set_color (UIConfiguration::instance().color ("play head"));
|
||||||
|
|
||||||
meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar"));
|
//these have no color (transparent) until moused-over
|
||||||
meter_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
meter_bar->set_fill_color (0);
|
||||||
|
tempo_bar->set_fill_color (0);
|
||||||
tempo_bar->set_fill_color (UIConfiguration::instance().color_mod ("tempo bar", "marker bar"));
|
cd_marker_bar->set_fill_color (0);
|
||||||
tempo_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
cue_marker_bar->set_fill_color (0);
|
||||||
|
range_marker_bar->set_fill_color (0);
|
||||||
marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("marker bar", "marker bar"));
|
marker_bar->set_fill_color (0);
|
||||||
marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
transport_marker_bar->set_fill_color (0);
|
||||||
|
|
||||||
cd_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("cd marker bar", "marker bar"));
|
|
||||||
cd_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
|
||||||
|
|
||||||
cue_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("cd marker bar", "marker bar"));
|
|
||||||
cue_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
|
||||||
|
|
||||||
range_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("range marker bar", "marker bar"));
|
|
||||||
range_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
|
||||||
|
|
||||||
transport_marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("transport marker bar", "marker bar"));
|
|
||||||
transport_marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
|
|
||||||
|
|
||||||
cd_marker_bar_drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag bar rect"));
|
cd_marker_bar_drag_rect->set_fill_color (UIConfiguration::instance().color ("range drag bar rect"));
|
||||||
cd_marker_bar_drag_rect->set_outline_color (UIConfiguration::instance().color ("range drag bar rect"));
|
cd_marker_bar_drag_rect->set_outline_color (UIConfiguration::instance().color ("range drag bar rect"));
|
||||||
|
|
|
||||||
|
|
@ -981,30 +981,105 @@ Editor::canvas_marker_event (GdkEvent *event, ArdourCanvas::Item* item, ArdourMa
|
||||||
bool
|
bool
|
||||||
Editor::canvas_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
marker_bar->set_fill_color (0xFFFFFF20);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
marker_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, MarkerBarItem);
|
return typed_event (item, event, MarkerBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_range_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_range_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
range_marker_bar->set_fill_color (0xFFFFFF20);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
range_marker_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, RangeMarkerBarItem);
|
return typed_event (item, event, RangeMarkerBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_transport_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_transport_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
transport_marker_bar->set_fill_color (0xFFFFFF20);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
transport_marker_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, TransportMarkerBarItem);
|
return typed_event (item, event, TransportMarkerBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_cd_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_cd_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
cd_marker_bar->set_fill_color (0xFFFFFF20); //TODO: theme these
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
cd_marker_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, CdMarkerBarItem);
|
return typed_event (item, event, CdMarkerBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_cue_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_cue_marker_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
cue_marker_bar->set_fill_color (0xFFFFFF20);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
cue_marker_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, CueMarkerBarItem);
|
return typed_event (item, event, CueMarkerBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1099,12 +1174,42 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType
|
||||||
bool
|
bool
|
||||||
Editor::canvas_tempo_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_tempo_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
tempo_bar->set_fill_color (0xFFFFFF20); //TODO: theme these
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
tempo_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, TempoBarItem);
|
return typed_event (item, event, TempoBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_meter_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
Editor::canvas_meter_bar_event (GdkEvent *event, ArdourCanvas::Item* item)
|
||||||
{
|
{
|
||||||
|
switch (event->type) {
|
||||||
|
case GDK_ENTER_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
meter_bar->set_fill_color (0xFFFFFF20); //TODO: theme these
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GDK_LEAVE_NOTIFY:
|
||||||
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
|
meter_bar->set_fill_color (0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
|
||||||
return typed_event (item, event, MeterBarItem);
|
return typed_event (item, event, MeterBarItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ Editor::add_new_location_internal (Location* location)
|
||||||
group = cd_marker_group;
|
group = cd_marker_group;
|
||||||
} else if (location->is_cue_marker() && ruler_cue_marker_action->get_active()) {
|
} else if (location->is_cue_marker() && ruler_cue_marker_action->get_active()) {
|
||||||
lam->start = new ArdourMarker (*this, *cue_marker_group, color, location->name(), ArdourMarker::Cue, location->start());
|
lam->start = new ArdourMarker (*this, *cue_marker_group, color, location->name(), ArdourMarker::Cue, location->start());
|
||||||
|
lam->start->set_cue_index(location->cue_id());
|
||||||
group = cue_marker_group;
|
group = cue_marker_group;
|
||||||
} else {
|
} else {
|
||||||
lam->start = new ArdourMarker (*this, *marker_group, color, location->name(), ArdourMarker::Mark, location->start());
|
lam->start = new ArdourMarker (*this, *marker_group, color, location->name(), ArdourMarker::Mark, location->start());
|
||||||
|
|
|
||||||
|
|
@ -1762,7 +1762,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
||||||
case CueMarkerBarItem:
|
case CueMarkerBarItem:
|
||||||
if (!_dragging_playhead) {
|
if (!_dragging_playhead) {
|
||||||
/* if we get here then a dragged range wasn't done */
|
/* if we get here then a dragged range wasn't done */
|
||||||
snap_to_with_modifier (where, event, Temporal::RoundNearest, SnapToGrid_Scaled);
|
snap_to_with_modifier (where, event, Temporal::RoundNearest, SnapToGrid_Scaled); //TODO: force to-measure?
|
||||||
mouse_add_new_marker (where, Location::IsCueMarker);
|
mouse_add_new_marker (where, Location::IsCueMarker);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -178,8 +178,8 @@ Editor::initialize_rulers ()
|
||||||
lab_children.push_back (Element(range_mark_label, PACK_SHRINK, PACK_START));
|
lab_children.push_back (Element(range_mark_label, PACK_SHRINK, PACK_START));
|
||||||
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
|
lab_children.push_back (Element(transport_mark_label, PACK_SHRINK, PACK_START));
|
||||||
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
|
lab_children.push_back (Element(cd_mark_label, PACK_SHRINK, PACK_START));
|
||||||
lab_children.push_back (Element(cue_mark_label, PACK_SHRINK, PACK_START));
|
|
||||||
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
|
lab_children.push_back (Element(mark_label, PACK_SHRINK, PACK_START));
|
||||||
|
lab_children.push_back (Element(cue_mark_label, PACK_SHRINK, PACK_START));
|
||||||
lab_children.push_back (Element(videotl_label, PACK_SHRINK, PACK_START));
|
lab_children.push_back (Element(videotl_label, PACK_SHRINK, PACK_START));
|
||||||
|
|
||||||
/* 1 event handler to bind them all ... */
|
/* 1 event handler to bind them all ... */
|
||||||
|
|
@ -538,6 +538,8 @@ Editor::update_ruler_visibility ()
|
||||||
tempo_label.hide();
|
tempo_label.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArdourCanvas::Rectangle *last_marker_bar = 0;
|
||||||
|
|
||||||
if (ruler_range_action->get_active()) {
|
if (ruler_range_action->get_active()) {
|
||||||
old_unit_pos = range_marker_group->position().y;
|
old_unit_pos = range_marker_group->position().y;
|
||||||
if (tbpos != old_unit_pos) {
|
if (tbpos != old_unit_pos) {
|
||||||
|
|
@ -546,6 +548,9 @@ Editor::update_ruler_visibility ()
|
||||||
range_marker_group->show();
|
range_marker_group->show();
|
||||||
range_mark_label.show();
|
range_mark_label.show();
|
||||||
|
|
||||||
|
range_marker_bar->set_outline(false);
|
||||||
|
last_marker_bar = range_marker_bar;
|
||||||
|
|
||||||
tbpos += timebar_height;
|
tbpos += timebar_height;
|
||||||
tbgpos += timebar_height;
|
tbgpos += timebar_height;
|
||||||
visible_timebars++;
|
visible_timebars++;
|
||||||
|
|
@ -561,6 +566,10 @@ Editor::update_ruler_visibility ()
|
||||||
}
|
}
|
||||||
transport_marker_group->show();
|
transport_marker_group->show();
|
||||||
transport_mark_label.show();
|
transport_mark_label.show();
|
||||||
|
|
||||||
|
transport_marker_bar->set_outline(false);
|
||||||
|
last_marker_bar = transport_marker_bar;
|
||||||
|
|
||||||
tbpos += timebar_height;
|
tbpos += timebar_height;
|
||||||
tbgpos += timebar_height;
|
tbgpos += timebar_height;
|
||||||
visible_timebars++;
|
visible_timebars++;
|
||||||
|
|
@ -576,6 +585,10 @@ Editor::update_ruler_visibility ()
|
||||||
}
|
}
|
||||||
cd_marker_group->show();
|
cd_marker_group->show();
|
||||||
cd_mark_label.show();
|
cd_mark_label.show();
|
||||||
|
|
||||||
|
cd_marker_bar->set_outline(false);
|
||||||
|
last_marker_bar = cd_marker_bar;
|
||||||
|
|
||||||
tbpos += timebar_height;
|
tbpos += timebar_height;
|
||||||
tbgpos += timebar_height;
|
tbgpos += timebar_height;
|
||||||
visible_timebars++;
|
visible_timebars++;
|
||||||
|
|
@ -588,6 +601,25 @@ Editor::update_ruler_visibility ()
|
||||||
update_cd_marker_display();
|
update_cd_marker_display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ruler_marker_action->get_active()) {
|
||||||
|
old_unit_pos = marker_group->position().y;
|
||||||
|
if (tbpos != old_unit_pos) {
|
||||||
|
marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
||||||
|
}
|
||||||
|
marker_group->show();
|
||||||
|
mark_label.show();
|
||||||
|
|
||||||
|
marker_bar->set_outline(false);
|
||||||
|
last_marker_bar = marker_bar;
|
||||||
|
|
||||||
|
tbpos += timebar_height;
|
||||||
|
tbgpos += timebar_height;
|
||||||
|
visible_timebars++;
|
||||||
|
} else {
|
||||||
|
marker_group->hide();
|
||||||
|
mark_label.hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (ruler_cue_marker_action->get_active()) {
|
if (ruler_cue_marker_action->get_active()) {
|
||||||
old_unit_pos = cue_marker_group->position().y;
|
old_unit_pos = cue_marker_group->position().y;
|
||||||
if (tbpos != old_unit_pos) {
|
if (tbpos != old_unit_pos) {
|
||||||
|
|
@ -595,6 +627,10 @@ Editor::update_ruler_visibility ()
|
||||||
}
|
}
|
||||||
cue_marker_group->show();
|
cue_marker_group->show();
|
||||||
cue_mark_label.show();
|
cue_mark_label.show();
|
||||||
|
|
||||||
|
cue_marker_bar->set_outline(false);
|
||||||
|
last_marker_bar = cue_marker_bar;
|
||||||
|
|
||||||
tbpos += timebar_height;
|
tbpos += timebar_height;
|
||||||
tbgpos += timebar_height;
|
tbgpos += timebar_height;
|
||||||
visible_timebars++;
|
visible_timebars++;
|
||||||
|
|
@ -607,19 +643,10 @@ Editor::update_ruler_visibility ()
|
||||||
update_cue_marker_display();
|
update_cue_marker_display();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ruler_marker_action->get_active()) {
|
//the bottom ruler needs a black outline to separate it from the editor canvas
|
||||||
old_unit_pos = marker_group->position().y;
|
if ( last_marker_bar ) {
|
||||||
if (tbpos != old_unit_pos) {
|
last_marker_bar->set_outline(true);
|
||||||
marker_group->move (ArdourCanvas::Duple (0.0, tbpos - old_unit_pos));
|
last_marker_bar->set_outline_what(ArdourCanvas::Rectangle::BOTTOM);
|
||||||
}
|
|
||||||
marker_group->show();
|
|
||||||
mark_label.show();
|
|
||||||
tbpos += timebar_height;
|
|
||||||
tbgpos += timebar_height;
|
|
||||||
visible_timebars++;
|
|
||||||
} else {
|
|
||||||
marker_group->hide();
|
|
||||||
mark_label.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ruler_video_action->get_active()) {
|
if (ruler_video_action->get_active()) {
|
||||||
|
|
|
||||||
|
|
@ -90,11 +90,13 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
, _label_offset (0)
|
, _label_offset (0)
|
||||||
, _line_height (-1)
|
, _line_height (-1)
|
||||||
, _region_view (rv)
|
, _region_view (rv)
|
||||||
|
, _cue_index (-1)
|
||||||
{
|
{
|
||||||
|
const double scale = UIConfiguration::instance ().get_ui_scale ();
|
||||||
|
|
||||||
const double MH = marker_height - .5;
|
const double MH = marker_height - .5;
|
||||||
const double M3 = std::max(1.f, rintf(3.f * UIConfiguration::instance().get_ui_scale()));
|
const double M3 = std::max(1.f, rintf(3.f * scale));
|
||||||
const double M6 = std::max(2.f, rintf(6.f * UIConfiguration::instance().get_ui_scale()));
|
const double M6 = std::max(2.f, rintf(6.f * scale));
|
||||||
|
|
||||||
/* Shapes we use:
|
/* Shapes we use:
|
||||||
*
|
*
|
||||||
|
|
@ -184,8 +186,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, MH * .4));
|
points->push_back (ArdourCanvas::Duple (0.0, MH * .4));
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
||||||
|
|
||||||
_shift = 3;
|
_shift = 3 * scale;
|
||||||
_label_offset = 10.0;
|
_label_offset = 4.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Tempo:
|
case Tempo:
|
||||||
|
|
@ -198,8 +200,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, MH * .6));
|
points->push_back (ArdourCanvas::Duple (0.0, MH * .6));
|
||||||
points->push_back (ArdourCanvas::Duple ( M3, 0.0));
|
points->push_back (ArdourCanvas::Duple ( M3, 0.0));
|
||||||
|
|
||||||
_shift = 3;
|
_shift = 3 * scale;
|
||||||
_label_offset = 8.0;
|
_label_offset = 8.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionStart:
|
case SessionStart:
|
||||||
|
|
@ -210,8 +212,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple ( 0.0, MH));
|
points->push_back (ArdourCanvas::Duple ( 0.0, MH));
|
||||||
points->push_back (ArdourCanvas::Duple ( 0.0, 0.0));
|
points->push_back (ArdourCanvas::Duple ( 0.0, 0.0));
|
||||||
|
|
||||||
_shift = 0;
|
_shift = 0 * scale;
|
||||||
_label_offset = 8.0;
|
_label_offset = 8.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SessionEnd:
|
case SessionEnd:
|
||||||
|
|
@ -223,7 +225,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple ( M6, 0.0));
|
points->push_back (ArdourCanvas::Duple ( M6, 0.0));
|
||||||
|
|
||||||
_shift = M6;
|
_shift = M6;
|
||||||
_label_offset = 0.0;
|
_label_offset = 0.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LoopStart:
|
case LoopStart:
|
||||||
|
|
@ -233,7 +235,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, MH));
|
points->push_back (ArdourCanvas::Duple (0.0, MH));
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
||||||
|
|
||||||
_shift = 0;
|
_shift = 0 * scale;
|
||||||
_label_offset = MH;
|
_label_offset = MH;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -245,7 +247,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (MH, 0.0));
|
points->push_back (ArdourCanvas::Duple (MH, 0.0));
|
||||||
|
|
||||||
_shift = MH;
|
_shift = MH;
|
||||||
_label_offset = 0.0;
|
_label_offset = 0.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PunchIn:
|
case PunchIn:
|
||||||
|
|
@ -255,7 +257,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, MH));
|
points->push_back (ArdourCanvas::Duple (0.0, MH));
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
||||||
|
|
||||||
_shift = 0;
|
_shift = 0 * scale;
|
||||||
_label_offset = MH;
|
_label_offset = MH;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -267,23 +269,15 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
||||||
|
|
||||||
_shift = MH;
|
_shift = MH;
|
||||||
_label_offset = 0.0;
|
_label_offset = 0.0 * scale;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Cue:
|
case Cue:
|
||||||
/* ben: new shape needed here */
|
|
||||||
points = new ArdourCanvas::Points ();
|
points = new ArdourCanvas::Points ();
|
||||||
|
_shift = MH/2;
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
_label_offset = 2.0 * scale;
|
||||||
points->push_back (ArdourCanvas::Duple ( M6, 0.0));
|
|
||||||
points->push_back (ArdourCanvas::Duple ( M6, MH * .4));
|
|
||||||
points->push_back (ArdourCanvas::Duple ( M3, MH));
|
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, MH * .4));
|
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
|
|
||||||
|
|
||||||
_shift = 3;
|
|
||||||
_label_offset = 10.0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_position = pos;
|
_position = pos;
|
||||||
|
|
@ -296,20 +290,35 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (type != RegionCue) {
|
if (type != RegionCue) {
|
||||||
_name_background = new ArdourCanvas::Rectangle (group);
|
_name_flag = new ArdourCanvas::Rectangle (group);
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
_name_background->name = string_compose ("Marker::_name_background for %1", annotation);
|
_name_flag->name = string_compose ("Marker::_name_flag for %1", annotation);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
_name_background = 0;
|
_name_flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust to properly locate the tip */
|
/* adjust to properly locate the tip */
|
||||||
|
|
||||||
mark = new ArdourCanvas::Polygon (group);
|
_pcue = new ArdourCanvas::Circle (group);
|
||||||
CANVAS_DEBUG_NAME (mark, string_compose ("Marker::mark for %1", annotation));
|
_pmark = new ArdourCanvas::Polygon (group);
|
||||||
|
CANVAS_DEBUG_NAME (_pmark, string_compose ("Marker::mark for %1", annotation));
|
||||||
|
|
||||||
mark->set (*points);
|
_pmark->set (*points);
|
||||||
|
|
||||||
|
if (_type == Cue) {
|
||||||
|
_pcue->set_outline(false);
|
||||||
|
_pcue->set_fill(true);
|
||||||
|
_pcue->set_center ( ArdourCanvas::Duple (MH/2, MH/2) );
|
||||||
|
_pcue->set_radius ( MH/2 );
|
||||||
|
|
||||||
|
_pcue->show();
|
||||||
|
_pmark->hide();
|
||||||
|
_name_flag->hide();
|
||||||
|
} else {
|
||||||
|
_pcue->hide();
|
||||||
|
_pmark->show();
|
||||||
|
}
|
||||||
|
|
||||||
/* setup name pixbuf sizes */
|
/* setup name pixbuf sizes */
|
||||||
name_font = get_font_for_style (N_("MarkerText"));
|
name_font = get_font_for_style (N_("MarkerText"));
|
||||||
|
|
@ -326,7 +335,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
CANVAS_DEBUG_NAME (_name_item, string_compose ("ArdourMarker::_name_item for %1", annotation));
|
CANVAS_DEBUG_NAME (_name_item, string_compose ("ArdourMarker::_name_item for %1", annotation));
|
||||||
_name_item->set_font_description (name_font);
|
_name_item->set_font_description (name_font);
|
||||||
_name_item->set_color (RGBA_TO_UINT (0,0,0,255));
|
_name_item->set_color (RGBA_TO_UINT (0,0,0,255));
|
||||||
_name_item->set_position (ArdourCanvas::Duple (_label_offset, (marker_height - name_height - 1) * .5 ));
|
_name_item->set_position (ArdourCanvas::Duple (_label_offset, (marker_height - 4)*0.5 - (name_height) * .5 ));
|
||||||
|
|
||||||
set_color_rgba (rgba);
|
set_color_rgba (rgba);
|
||||||
|
|
||||||
|
|
@ -339,7 +348,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
|
||||||
*/
|
*/
|
||||||
|
|
||||||
group->set_data ("marker", this);
|
group->set_data ("marker", this);
|
||||||
mark->set_data ("marker", this);
|
_pmark->set_data ("marker", this);
|
||||||
|
_pcue->set_data ("marker", this);
|
||||||
|
|
||||||
if (handle_events) {
|
if (handle_events) {
|
||||||
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), group, this));
|
group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), group, this));
|
||||||
|
|
@ -371,8 +381,10 @@ ArdourMarker::set_selected (bool s)
|
||||||
_selected = s;
|
_selected = s;
|
||||||
setup_line ();
|
setup_line ();
|
||||||
|
|
||||||
mark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
_pcue->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
||||||
mark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
|
|
||||||
|
_pmark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
||||||
|
_pmark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -467,9 +479,10 @@ ArdourMarker::set_name (const string& new_name)
|
||||||
{
|
{
|
||||||
_name = new_name;
|
_name = new_name;
|
||||||
|
|
||||||
mark->set_tooltip(new_name);
|
_pcue->set_tooltip(new_name);
|
||||||
if (_name_background) {
|
_pmark->set_tooltip(new_name);
|
||||||
_name_background->set_tooltip(new_name);
|
if (_name_flag) {
|
||||||
|
_name_flag->set_tooltip(new_name);
|
||||||
}
|
}
|
||||||
_name_item->set_tooltip(new_name);
|
_name_item->set_tooltip(new_name);
|
||||||
|
|
||||||
|
|
@ -510,13 +523,18 @@ ArdourMarker::setup_name_display ()
|
||||||
}
|
}
|
||||||
|
|
||||||
_name_item->clamp_width (name_width);
|
_name_item->clamp_width (name_width);
|
||||||
_name_item->set (_name);
|
|
||||||
|
|
||||||
if (_name_background) {
|
if (_type == Cue) {
|
||||||
|
_name_item->set (string_compose ("%1", (char)('A' + _cue_index))); // XXX not translatable
|
||||||
|
} else {
|
||||||
|
_name_item->set (_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_name_flag) {
|
||||||
if (label_on_left ()) {
|
if (label_on_left ()) {
|
||||||
/* adjust right edge of background to fit text */
|
/* adjust right edge of background to fit text */
|
||||||
_name_background->set_x0 (_name_item->position().x - padding);
|
_name_flag->set_x0 (_name_item->position().x - padding);
|
||||||
_name_background->set_x1 (_name_item->position().x + name_width + _shift);
|
_name_flag->set_x1 (_name_item->position().x + name_width + _shift);
|
||||||
} else {
|
} else {
|
||||||
/* right edge remains at zero (group-relative). Add
|
/* right edge remains at zero (group-relative). Add
|
||||||
* arbitrary 2 pixels of extra padding at the end
|
* arbitrary 2 pixels of extra padding at the end
|
||||||
|
|
@ -525,26 +543,26 @@ ArdourMarker::setup_name_display ()
|
||||||
case Tempo:
|
case Tempo:
|
||||||
_name_item->hide ();
|
_name_item->hide ();
|
||||||
// tip's x-pos is at "M3", box is 2x marker's
|
// tip's x-pos is at "M3", box is 2x marker's
|
||||||
_name_background->set_x0 (-M3);
|
_name_flag->set_x0 (-M3);
|
||||||
_name_background->set_x1 (3 * M3);
|
_name_flag->set_x1 (3 * M3);
|
||||||
break;
|
break;
|
||||||
case Mark:
|
case Mark:
|
||||||
case Meter:
|
case Meter:
|
||||||
_name_background->set_x0 (M3);
|
_name_flag->set_x0 (M3);
|
||||||
_name_background->set_x1 (_name_item->position().x + name_width + padding);
|
_name_flag->set_x1 (_name_item->position().x + name_width + padding);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_name_background->set_x0 (0);
|
_name_flag->set_x0 (0);
|
||||||
_name_background->set_x1 (_name_item->position().x + name_width + padding);
|
_name_flag->set_x1 (_name_item->position().x + name_width + padding);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_name_background) {
|
if (_name_flag) {
|
||||||
_name_background->set_y0 (0);
|
_name_flag->set_y0 (0);
|
||||||
_name_background->set_y1 (marker_height + 1);
|
_name_flag->set_y1 (marker_height - 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -586,8 +604,9 @@ void
|
||||||
ArdourMarker::set_points_color (uint32_t c)
|
ArdourMarker::set_points_color (uint32_t c)
|
||||||
{
|
{
|
||||||
_points_color = c;
|
_points_color = c;
|
||||||
mark->set_fill_color (_points_color);
|
_pcue->set_fill_color (_points_color);
|
||||||
mark->set_outline_color (_points_color);
|
_pmark->set_fill_color (_points_color);
|
||||||
|
_pmark->set_outline_color (_points_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -595,15 +614,16 @@ ArdourMarker::set_color_rgba (uint32_t c)
|
||||||
{
|
{
|
||||||
_color = c;
|
_color = c;
|
||||||
|
|
||||||
mark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
_pcue->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
||||||
mark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
|
_pmark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
|
||||||
|
_pmark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
|
||||||
|
|
||||||
if (_track_canvas_line && ((_type == RegionCue) || !_selected)) {
|
if (_track_canvas_line && ((_type == RegionCue) || !_selected)) {
|
||||||
_track_canvas_line->set_outline_color (_color);
|
_track_canvas_line->set_outline_color (_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_name_item) {
|
if (_name_item) {
|
||||||
if (_name_background) {
|
if (_name_flag) {
|
||||||
/* make sure text stands out over bg color */
|
/* make sure text stands out over bg color */
|
||||||
_name_item->set_color (contrasting_text_color (_color));
|
_name_item->set_color (contrasting_text_color (_color));
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -612,10 +632,10 @@ ArdourMarker::set_color_rgba (uint32_t c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_name_background) {
|
if (_name_flag) {
|
||||||
_name_background->set_fill (true);
|
_name_flag->set_fill (true);
|
||||||
_name_background->set_fill_color (UINT_RGBA_CHANGE_A (_color, 0x70));
|
_name_flag->set_fill_color (_color);
|
||||||
_name_background->set_outline (false);
|
_name_flag->set_outline (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -694,7 +714,7 @@ TempoMarker::update_height_mark (const double ratio)
|
||||||
points->push_back (ArdourCanvas::Duple (0.0, min (top + (MH * .6), MH)));
|
points->push_back (ArdourCanvas::Duple (0.0, min (top + (MH * .6), MH)));
|
||||||
points->push_back (ArdourCanvas::Duple ( M3, top));
|
points->push_back (ArdourCanvas::Duple ( M3, top));
|
||||||
|
|
||||||
mark->set (*points);
|
_pmark->set (*points);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
#include "canvas/fwd.h"
|
#include "canvas/fwd.h"
|
||||||
#include "canvas/types.h"
|
#include "canvas/types.h"
|
||||||
|
#include "canvas/circle.h"
|
||||||
|
|
||||||
namespace Temporal {
|
namespace Temporal {
|
||||||
class Point;
|
class Point;
|
||||||
|
|
@ -116,6 +117,11 @@ public:
|
||||||
|
|
||||||
RegionView* region_view() const { return _region_view; }
|
RegionView* region_view() const { return _region_view; }
|
||||||
|
|
||||||
|
/* this will be -1 for all non-cue markers; or cue_index for cue markers */
|
||||||
|
|
||||||
|
void set_cue_index(int c) { _cue_index = c; set_name(_name); }
|
||||||
|
int cue_index() const { return _cue_index; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PublicEditor& editor;
|
PublicEditor& editor;
|
||||||
|
|
||||||
|
|
@ -123,11 +129,12 @@ protected:
|
||||||
|
|
||||||
ArdourCanvas::Item* _parent;
|
ArdourCanvas::Item* _parent;
|
||||||
ArdourCanvas::Item *group;
|
ArdourCanvas::Item *group;
|
||||||
ArdourCanvas::Polygon *mark;
|
ArdourCanvas::Circle *_pcue;
|
||||||
|
ArdourCanvas::Polygon *_pmark;
|
||||||
ArdourCanvas::Text *_name_item;
|
ArdourCanvas::Text *_name_item;
|
||||||
ArdourCanvas::Points *points;
|
ArdourCanvas::Points *points;
|
||||||
ArdourCanvas::Line* _track_canvas_line;
|
ArdourCanvas::Line* _track_canvas_line;
|
||||||
ArdourCanvas::Rectangle* _name_background;
|
ArdourCanvas::Rectangle* _name_flag;
|
||||||
|
|
||||||
std::string _name;
|
std::string _name;
|
||||||
double unit_position;
|
double unit_position;
|
||||||
|
|
@ -149,6 +156,8 @@ protected:
|
||||||
|
|
||||||
RegionView* _region_view;
|
RegionView* _region_view;
|
||||||
|
|
||||||
|
int _cue_index;
|
||||||
|
|
||||||
void reposition ();
|
void reposition ();
|
||||||
void setup_line_x ();
|
void setup_line_x ();
|
||||||
void setup_name_display ();
|
void setup_name_display ();
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include "gtkmm2ext/colors.h"
|
#include "gtkmm2ext/colors.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/keyboard.h"
|
#include "gtkmm2ext/keyboard.h"
|
||||||
|
#include "gtkmm2ext/utils.h"
|
||||||
|
|
||||||
#include "widgets/tooltips.h"
|
#include "widgets/tooltips.h"
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@
|
||||||
#define BBT_BAR_CHAR "|"
|
#define BBT_BAR_CHAR "|"
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
using namespace Gtkmm2ext;
|
||||||
|
|
||||||
MiniTimeline::MiniTimeline ()
|
MiniTimeline::MiniTimeline ()
|
||||||
: _last_update_sample (-1)
|
: _last_update_sample (-1)
|
||||||
|
|
@ -67,8 +69,11 @@ MiniTimeline::MiniTimeline ()
|
||||||
Location::name_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
Location::name_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
||||||
Location::end_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
Location::end_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
||||||
Location::start_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
Location::start_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
||||||
|
Location::changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
||||||
Location::flags_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
Location::flags_changed.connect (marker_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context ());
|
||||||
|
|
||||||
|
Temporal::TempoMap::MapChanged.connect (tempo_map_connection, invalidator (*this), boost::bind (&MiniTimeline::update_minitimeline, this), gui_context());
|
||||||
|
|
||||||
ArdourWidgets::set_tooltip (*this,
|
ArdourWidgets::set_tooltip (*this,
|
||||||
string_compose (_("<b>Navigation Timeline</b>. Use left-click to locate to time position or marker; scroll-wheel to jump, hold %1 for fine grained and %2 + %3 for extra-fine grained control. Right-click to set display range. The display unit is defined by the primary clock."),
|
string_compose (_("<b>Navigation Timeline</b>. Use left-click to locate to time position or marker; scroll-wheel to jump, hold %1 for fine grained and %2 + %3 for extra-fine grained control. Right-click to set display range. The display unit is defined by the primary clock."),
|
||||||
Gtkmm2ext::Keyboard::primary_modifier_name(),
|
Gtkmm2ext::Keyboard::primary_modifier_name(),
|
||||||
|
|
@ -204,11 +209,6 @@ MiniTimeline::super_rapid_update ()
|
||||||
change = true;
|
change = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_clock_mode == AudioClock::BBT) {
|
|
||||||
// TODO check if tempo-map changed
|
|
||||||
change = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (change) {
|
if (change) {
|
||||||
_last_update_sample = sample;
|
_last_update_sample = sample;
|
||||||
update_minitimeline ();
|
update_minitimeline ();
|
||||||
|
|
@ -339,7 +339,7 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
|
||||||
|
|
||||||
const int y = PADDING;
|
const int y = PADDING;
|
||||||
int w2 = (h - 1) / 4;
|
int w2 = (h - 1) / 4;
|
||||||
double h0 = h * .4;
|
double h0 = h * .6;
|
||||||
double h1 = h - h0;
|
double h1 = h - h0;
|
||||||
|
|
||||||
int lw, lh;
|
int lw, lh;
|
||||||
|
|
@ -351,30 +351,14 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
|
||||||
prelight = true;
|
prelight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO cache in set_colors()
|
const double scale = UIConfiguration::instance ().get_ui_scale ();
|
||||||
uint32_t color = UIConfiguration::instance().color (
|
uint32_t color = UIConfiguration::instance().color (
|
||||||
prelight ? "entered marker" : "location marker");
|
prelight ? "entered marker" : "location marker");
|
||||||
|
|
||||||
double r, g, b, a;
|
//shrink the height of the 'flag' part, a bit.
|
||||||
Gtkmm2ext::color_to_rgba (color, r, g, b, a);
|
h -= 4*scale;
|
||||||
|
|
||||||
if (rw < x0) {
|
// draw marker first
|
||||||
rw = x1;
|
|
||||||
} else {
|
|
||||||
cairo_save (cr);
|
|
||||||
cairo_rectangle (cr, x0, y, rw - x0, h);
|
|
||||||
cairo_set_source_rgba (cr, r, g, b, 0.5); // this should use a shaded color
|
|
||||||
cairo_fill_preserve (cr);
|
|
||||||
cairo_clip (cr);
|
|
||||||
|
|
||||||
// marker label
|
|
||||||
cairo_move_to (cr, x0 + w2, y + .5 * (h - lh));
|
|
||||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
|
||||||
pango_cairo_show_layout (cr, _layout->gobj());
|
|
||||||
cairo_restore (cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// draw marker on top
|
|
||||||
cairo_move_to (cr, x0 - .5, y + .5);
|
cairo_move_to (cr, x0 - .5, y + .5);
|
||||||
cairo_rel_line_to (cr, -w2 , 0);
|
cairo_rel_line_to (cr, -w2 , 0);
|
||||||
cairo_rel_line_to (cr, 0, h0);
|
cairo_rel_line_to (cr, 0, h0);
|
||||||
|
|
@ -382,14 +366,67 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
|
||||||
cairo_rel_line_to (cr, w2, -h1);
|
cairo_rel_line_to (cr, w2, -h1);
|
||||||
cairo_rel_line_to (cr, 0, -h0);
|
cairo_rel_line_to (cr, 0, -h0);
|
||||||
cairo_close_path (cr);
|
cairo_close_path (cr);
|
||||||
cairo_set_source_rgba (cr, r, g, b, 1.0);
|
set_source_rgba (cr, color);
|
||||||
cairo_set_line_width (cr, 1.0);
|
cairo_set_line_width (cr, 1.0);
|
||||||
cairo_stroke_preserve (cr);
|
cairo_stroke_preserve (cr);
|
||||||
cairo_fill (cr);
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
if (rw < x0) {
|
||||||
|
rw = x1;
|
||||||
|
} else {
|
||||||
|
cairo_save (cr);
|
||||||
|
set_source_rgba (cr, color);
|
||||||
|
cairo_rectangle (cr, x0-5*scale, y, rw - x0 + 4*scale, h);
|
||||||
|
cairo_fill_preserve (cr);
|
||||||
|
cairo_clip (cr);
|
||||||
|
|
||||||
|
// marker label
|
||||||
|
cairo_move_to (cr, x0 + w2 - 4*scale, y + .5 * (h - lh));
|
||||||
|
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||||
|
pango_cairo_show_layout (cr, _layout->gobj());
|
||||||
|
cairo_restore (cr);
|
||||||
|
|
||||||
|
/* right line */
|
||||||
|
cairo_rectangle (cr, rw-2*scale, y, 1*scale, h);
|
||||||
|
cairo_set_source_rgba (cr, 0, 0, 0, 0.7);
|
||||||
|
cairo_fill (cr);
|
||||||
|
}
|
||||||
|
|
||||||
return rw;
|
return rw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MiniTimeline::draw_cue (cairo_t* cr, int x0, int x1, int cue_index, bool& prelight)
|
||||||
|
{
|
||||||
|
int y_offs = _marker_height * 1.4; //make room for 'regular' markers
|
||||||
|
|
||||||
|
int h = _marker_height;
|
||||||
|
x0 -= h/2; //left side of circle
|
||||||
|
x1 = x0 + h; //right side of circle
|
||||||
|
|
||||||
|
if (_pointer_y >= y_offs && _pointer_y <= y_offs+h && _pointer_x >= x0 && _pointer_x <= x1) {
|
||||||
|
prelight = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const double scale = UIConfiguration::instance ().get_ui_scale ();
|
||||||
|
uint32_t color = UIConfiguration::instance().color (
|
||||||
|
prelight ? "entered marker" : "location marker");
|
||||||
|
|
||||||
|
// draw Cue as a circle
|
||||||
|
cairo_arc(cr, x0+h/2, y_offs+h/2, (h/2)-1*scale, 0, 2*M_PI);
|
||||||
|
set_source_rgba (cr, color);
|
||||||
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
//draw cue letter
|
||||||
|
_layout->set_text (string_compose (_("%1"), (char) ('A' + cue_index)));
|
||||||
|
cairo_set_source_rgb (cr, 0, 0, 0); //black
|
||||||
|
cairo_move_to (cr, x0 + h/2, y_offs+h/2); //move to center of circle
|
||||||
|
int tw, th;
|
||||||
|
_layout->get_pixel_size (tw, th);
|
||||||
|
cairo_rel_move_to (cr, -tw/2, -th/2); //move to top-left of text
|
||||||
|
pango_cairo_show_layout (cr, _layout->gobj());
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
MiniTimeline::draw_edge (cairo_t* cr, int x0, int x1, bool left, const std::string& label, bool& prelight)
|
MiniTimeline::draw_edge (cairo_t* cr, int x0, int x1, bool left, const std::string& label, bool& prelight)
|
||||||
{
|
{
|
||||||
|
|
@ -475,8 +512,9 @@ MiniTimeline::draw_edge (cairo_t* cr, int x0, int x1, bool left, const std::stri
|
||||||
|
|
||||||
|
|
||||||
struct LocationMarker {
|
struct LocationMarker {
|
||||||
LocationMarker (const std::string& l, Temporal::timepos_t const & w)
|
LocationMarker (int idx, const std::string& l, Temporal::timepos_t const & w)
|
||||||
: label (l), when (w) {}
|
: cue_index(idx), label (l), when (w) {}
|
||||||
|
int cue_index;
|
||||||
std::string label;
|
std::string label;
|
||||||
Temporal::timepos_t when;
|
Temporal::timepos_t when;
|
||||||
};
|
};
|
||||||
|
|
@ -518,13 +556,13 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
}
|
}
|
||||||
|
|
||||||
/* time */
|
/* time */
|
||||||
const samplepos_t p = _last_update_sample;
|
const samplepos_t phead = _last_update_sample; //playhead location
|
||||||
const samplepos_t lower = (std::max ((samplepos_t)0, (p - _time_span_samples)) / _time_granularity) * _time_granularity;
|
const samplepos_t lower = (std::max ((samplepos_t)0, (phead - _time_span_samples)) / _time_granularity) * _time_granularity;
|
||||||
|
|
||||||
int dot_left = width * .5 + (lower - p) * _px_per_sample;
|
int dot_left = width * .5 + (lower - phead) * _px_per_sample;
|
||||||
for (int i = 0; i < 2 + _n_labels; ++i) {
|
for (int i = 0; i < 2 + _n_labels; ++i) {
|
||||||
samplepos_t when = lower + i * _time_granularity;
|
samplepos_t when = lower + i * _time_granularity;
|
||||||
double xpos = width * .5 + (when - p) * _px_per_sample;
|
double xpos = width * .5 + (when - phead) * _px_per_sample;
|
||||||
|
|
||||||
// TODO round to nearest display TC in +/- 1px
|
// TODO round to nearest display TC in +/- 1px
|
||||||
// prefer to display BBT |0 or .0
|
// prefer to display BBT |0 or .0
|
||||||
|
|
@ -545,9 +583,24 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
}
|
}
|
||||||
draw_dots (cr, dot_left, width, height - PADDING - _time_height * .5, text);
|
draw_dots (cr, dot_left, width, height - PADDING - _time_height * .5, text);
|
||||||
|
|
||||||
|
/* playhead beneath locations */
|
||||||
|
int xc = width * 0.5f;
|
||||||
|
cairo_set_line_width (cr, 1.0);
|
||||||
|
double r,g,b,a; Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
|
||||||
|
cairo_set_source_rgb (cr, r,g,b); // playhead color
|
||||||
|
cairo_move_to (cr, xc - .5, 0);
|
||||||
|
cairo_rel_line_to (cr, 0, height);
|
||||||
|
cairo_stroke (cr);
|
||||||
|
cairo_move_to (cr, xc - .5, height);
|
||||||
|
cairo_rel_line_to (cr, -3, 0);
|
||||||
|
cairo_rel_line_to (cr, 3, -4);
|
||||||
|
cairo_rel_line_to (cr, 3, 4);
|
||||||
|
cairo_close_path (cr);
|
||||||
|
cairo_fill (cr);
|
||||||
|
|
||||||
/* locations */
|
/* locations */
|
||||||
samplepos_t lmin = std::max ((samplepos_t)0, (p - _time_span_samples));
|
samplepos_t lmin = std::max ((samplepos_t)0, (phead - _time_span_samples));
|
||||||
samplepos_t lmax = p + _time_span_samples;
|
samplepos_t lmax = phead + _time_span_samples;
|
||||||
|
|
||||||
int tw, th;
|
int tw, th;
|
||||||
_layout->set_text (X_("Marker@"));
|
_layout->set_text (X_("Marker@"));
|
||||||
|
|
@ -565,8 +618,8 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
const Locations::LocationList& ll (_session->locations ()->list ());
|
const Locations::LocationList& ll (_session->locations ()->list ());
|
||||||
for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) {
|
for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) {
|
||||||
if ((*l)->is_session_range ()) {
|
if ((*l)->is_session_range ()) {
|
||||||
lm.push_back (LocationMarker(_("start"), (*l)->start ()));
|
lm.push_back (LocationMarker(-1, _("start"), (*l)->start ()));
|
||||||
lm.push_back (LocationMarker(_("end"), (*l)->end ()));
|
lm.push_back (LocationMarker(-1, _("end"), (*l)->end ()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -574,7 +627,8 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
lm.push_back (LocationMarker((*l)->name(), (*l)->start ()));
|
int cue_idx = (*l)->is_cue_marker () ? (*l)->cue_id() : -1;
|
||||||
|
lm.push_back (LocationMarker(cue_idx, (*l)->name(), (*l)->start ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
_jumplist.clear ();
|
_jumplist.clear ();
|
||||||
|
|
@ -593,7 +647,7 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
if (when < lmin) {
|
if (when < lmin) {
|
||||||
outside_left = l;
|
outside_left = l;
|
||||||
if (++l != lm.end()) {
|
if (++l != lm.end()) {
|
||||||
left_limit = floor (width * .5 + (when - p) * _px_per_sample) - 1 - mw;
|
left_limit = floor (width * .5 + (when - phead) * _px_per_sample) - 1 - mw;
|
||||||
} else {
|
} else {
|
||||||
left_limit = width * .5 - mw;
|
left_limit = width * .5 - mw;
|
||||||
}
|
}
|
||||||
|
|
@ -603,16 +657,31 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
outside_right = l;
|
outside_right = l;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int x0 = floor (width * .5 + (when - p) * _px_per_sample);
|
int x0 = floor (width * .5 + (when - phead) * _px_per_sample);
|
||||||
int x1 = width;
|
int x1 = width;
|
||||||
const std::string& label = (*l).label;
|
const std::string& label = (*l).label;
|
||||||
if (++l != lm.end()) {
|
const int cue_index = (*l).cue_index;
|
||||||
x1 = floor (width * .5 + (when - p) * _px_per_sample) - 1 - mw;
|
|
||||||
|
std::vector<LocationMarker>::const_iterator peek = l;
|
||||||
|
for (peek++; peek != lm.end(); peek++) {
|
||||||
|
if ((*peek).cue_index == -1) {
|
||||||
|
x1 = floor (width * .5 + ((*peek).when.samples() - phead) * _px_per_sample) - 1 - mw;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//draw the mark
|
||||||
bool prelight = false;
|
bool prelight = false;
|
||||||
x1 = draw_mark (cr, x0, x1, label, prelight);
|
if (cue_index >= 0) {
|
||||||
_jumplist.push_back (JumpRange (x0 - mw, x1, when, prelight));
|
draw_cue (cr, x0, x1, cue_index, prelight);
|
||||||
|
} else {
|
||||||
|
x1 = draw_mark (cr, x0, x1, label, prelight);
|
||||||
|
}
|
||||||
|
|
||||||
|
_jumplist.push_back (JumpRange (when, prelight));
|
||||||
right_limit = std::max (x1, right_limit);
|
right_limit = std::max (x1, right_limit);
|
||||||
|
|
||||||
|
l++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outside_left != lm.end ()) {
|
if (outside_left != lm.end ()) {
|
||||||
|
|
@ -622,7 +691,7 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
bool prelight = false;
|
bool prelight = false;
|
||||||
x1 = draw_edge (cr, x0, x1, true, (*outside_left).label, prelight);
|
x1 = draw_edge (cr, x0, x1, true, (*outside_left).label, prelight);
|
||||||
if (x0 != x1) {
|
if (x0 != x1) {
|
||||||
_jumplist.push_back (JumpRange (x0, x1, (*outside_left).when.samples(), prelight));
|
_jumplist.push_back (JumpRange ((*outside_left).when.samples(), prelight));
|
||||||
right_limit = std::max (x1, right_limit);
|
right_limit = std::max (x1, right_limit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -635,27 +704,12 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
|
||||||
bool prelight = false;
|
bool prelight = false;
|
||||||
x0 = draw_edge (cr, x0, x1, false, (*outside_right).label, prelight);
|
x0 = draw_edge (cr, x0, x1, false, (*outside_right).label, prelight);
|
||||||
if (x0 != x1) {
|
if (x0 != x1) {
|
||||||
_jumplist.push_back (JumpRange (x0, x1, (*outside_right).when.samples(), prelight));
|
_jumplist.push_back (JumpRange ((*outside_right).when.samples(), prelight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* playhead on top */
|
|
||||||
int xc = width * 0.5f;
|
|
||||||
cairo_set_line_width (cr, 1.0);
|
|
||||||
double r,g,b,a; Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
|
|
||||||
cairo_set_source_rgb (cr, r,g,b); // playhead color
|
|
||||||
cairo_move_to (cr, xc - .5, 0);
|
|
||||||
cairo_rel_line_to (cr, 0, height);
|
|
||||||
cairo_stroke (cr);
|
|
||||||
cairo_move_to (cr, xc - .5, height);
|
|
||||||
cairo_rel_line_to (cr, -3, 0);
|
|
||||||
cairo_rel_line_to (cr, 3, -4);
|
|
||||||
cairo_rel_line_to (cr, 3, 4);
|
|
||||||
cairo_close_path (cr);
|
|
||||||
cairo_fill (cr);
|
|
||||||
|
|
||||||
cairo_pop_group_to_source (cr);
|
cairo_pop_group_to_source (cr);
|
||||||
cairo_paint (cr);
|
cairo_paint (cr);
|
||||||
}
|
}
|
||||||
|
|
@ -711,16 +765,17 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
|
||||||
{
|
{
|
||||||
if (!_session) { return true; }
|
if (!_session) { return true; }
|
||||||
if (_session->actively_recording ()) { return true; }
|
if (_session->actively_recording ()) { return true; }
|
||||||
|
|
||||||
|
/* check that the release is still inside the timeline */
|
||||||
if (ev->y < 0 || ev->y > get_height () || ev->x < 0 || ev->x > get_width ()) {
|
if (ev->y < 0 || ev->y > get_height () || ev->x < 0 || ev->x > get_width ()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->y <= PADDING + _marker_height) {
|
/* check whether any marker was prelighted; if so, that's where the user will expect to jump */
|
||||||
for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
|
for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
|
||||||
if (i->left <= ev->x && ev->x <= i->right) {
|
if (i->prelight) {
|
||||||
_session->request_locate (i->to);
|
_session->request_locate (i->to);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -743,22 +798,7 @@ MiniTimeline::on_motion_notify_event (GdkEventMotion *ev)
|
||||||
|
|
||||||
bool need_expose = false;
|
bool need_expose = false;
|
||||||
|
|
||||||
for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
|
update_minitimeline ();
|
||||||
if (i->left < ev->x && ev->x < i->right && ev->y <= PADDING + _marker_height) {
|
|
||||||
if (!(*i).prelight) {
|
|
||||||
need_expose = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ((*i).prelight) {
|
|
||||||
need_expose = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (need_expose) {
|
|
||||||
update_minitimeline ();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ private:
|
||||||
void update_minitimeline ();
|
void update_minitimeline ();
|
||||||
void draw_dots (cairo_t*, int left, int right, int y, Gtkmm2ext::Color);
|
void draw_dots (cairo_t*, int left, int right, int y, Gtkmm2ext::Color);
|
||||||
int draw_mark (cairo_t*, int x0, int x1, const std::string&, bool& prelight);
|
int draw_mark (cairo_t*, int x0, int x1, const std::string&, bool& prelight);
|
||||||
|
void draw_cue (cairo_t*, int x0, int x1, int cue_index, bool& prelight);
|
||||||
int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight);
|
int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight);
|
||||||
|
|
||||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||||
|
|
@ -83,6 +84,7 @@ private:
|
||||||
Glib::RefPtr<Pango::Layout> _layout;
|
Glib::RefPtr<Pango::Layout> _layout;
|
||||||
sigc::connection super_rapid_connection;
|
sigc::connection super_rapid_connection;
|
||||||
PBD::ScopedConnectionList marker_connection;
|
PBD::ScopedConnectionList marker_connection;
|
||||||
|
PBD::ScopedConnectionList tempo_map_connection;
|
||||||
PBD::ScopedConnectionList session_connection;
|
PBD::ScopedConnectionList session_connection;
|
||||||
|
|
||||||
samplepos_t _last_update_sample;
|
samplepos_t _last_update_sample;
|
||||||
|
|
@ -104,10 +106,8 @@ private:
|
||||||
uint32_t _phead_color;
|
uint32_t _phead_color;
|
||||||
|
|
||||||
struct JumpRange {
|
struct JumpRange {
|
||||||
JumpRange (int l, int r, samplepos_t t, bool p = false)
|
JumpRange (samplepos_t t, bool p = false)
|
||||||
: left (l), right (r), to (t), prelight (p) {}
|
: to (t), prelight (p) {}
|
||||||
int left;
|
|
||||||
int right;
|
|
||||||
samplepos_t to;
|
samplepos_t to;
|
||||||
bool prelight;
|
bool prelight;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<Color name="theme:bg2" value="101010ff"/> <!--ruler base-->
|
<Color name="theme:bg2" value="101010ff"/> <!--ruler base-->
|
||||||
<Color name="theme:contrasting" value="0xf10000ff"/> <!--play head-->
|
<Color name="theme:contrasting" value="0xf10000ff"/> <!--play head-->
|
||||||
<Color name="theme:contrasting clock" value="4BCD2FFF"/> <!--clock: text-->
|
<Color name="theme:contrasting clock" value="4BCD2FFF"/> <!--clock: text-->
|
||||||
<Color name="theme:contrasting less" value="5697B3FF"/> <!--gtk_bg_tooltip-->
|
<Color name="theme:contrasting less" value="46B357FF"/>
|
||||||
<Color name="theme:contrasting selection" value="5da3c1ff"/> <!--gtk_bg_selected-->
|
<Color name="theme:contrasting selection" value="5da3c1ff"/> <!--gtk_bg_selected-->
|
||||||
<Color name="theme:contrasting alt" value="CCA336ff"/> <!--delta clock , clock edit-->
|
<Color name="theme:contrasting alt" value="CCA336ff"/> <!--delta clock , clock edit-->
|
||||||
<Color name="neutral:backgroundest" value="000000ff"/> <!--border color-->
|
<Color name="neutral:backgroundest" value="000000ff"/> <!--border color-->
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
<ColorAlias name="gtk_background" alias="theme:bg"/>
|
<ColorAlias name="gtk_background" alias="theme:bg"/>
|
||||||
<ColorAlias name="gtk_bases" alias="theme:bg2"/>
|
<ColorAlias name="gtk_bases" alias="theme:bg2"/>
|
||||||
<ColorAlias name="gtk_bg_selected" alias="theme:contrasting selection"/>
|
<ColorAlias name="gtk_bg_selected" alias="theme:contrasting selection"/>
|
||||||
<ColorAlias name="gtk_bg_tooltip" alias="theme:contrasting less"/>
|
<ColorAlias name="gtk_bg_tooltip" alias="neutral:backgroundest"/>
|
||||||
<ColorAlias name="gtk_bright_color" alias="widget:blue"/>
|
<ColorAlias name="gtk_bright_color" alias="widget:blue"/>
|
||||||
<ColorAlias name="gtk_bright_indicator" alias="alert:red"/>
|
<ColorAlias name="gtk_bright_indicator" alias="alert:red"/>
|
||||||
<ColorAlias name="gtk_clip_indicator" alias="alert:red"/>
|
<ColorAlias name="gtk_clip_indicator" alias="alert:red"/>
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
<ColorAlias name="gtk_darkest" alias="theme:bg2"/>
|
<ColorAlias name="gtk_darkest" alias="theme:bg2"/>
|
||||||
<ColorAlias name="gtk_entry_cursor" alias="alert:red"/>
|
<ColorAlias name="gtk_entry_cursor" alias="alert:red"/>
|
||||||
<ColorAlias name="gtk_fg_selected" alias="theme:bg2"/>
|
<ColorAlias name="gtk_fg_selected" alias="theme:bg2"/>
|
||||||
<ColorAlias name="gtk_fg_tooltip" alias="neutral:background"/>
|
<ColorAlias name="gtk_fg_tooltip" alias="neutral:foreground"/>
|
||||||
<ColorAlias name="gtk_foldback_bg" alias="theme:bg1"/>
|
<ColorAlias name="gtk_foldback_bg" alias="theme:bg1"/>
|
||||||
<ColorAlias name="gtk_foreground" alias="neutral:foreground"/>
|
<ColorAlias name="gtk_foreground" alias="neutral:foreground"/>
|
||||||
<ColorAlias name="gtk_light_text_on_dark" alias="neutral:foreground2"/>
|
<ColorAlias name="gtk_light_text_on_dark" alias="neutral:foreground2"/>
|
||||||
|
|
@ -167,11 +167,11 @@
|
||||||
<ColorAlias name="latency button: led active" alias="alert:ruddy"/>
|
<ColorAlias name="latency button: led active" alias="alert:ruddy"/>
|
||||||
<ColorAlias name="layered button: fill" alias="widget:bg"/>
|
<ColorAlias name="layered button: fill" alias="widget:bg"/>
|
||||||
<ColorAlias name="layered button: fill active" alias="alert:ruddy"/>
|
<ColorAlias name="layered button: fill active" alias="alert:ruddy"/>
|
||||||
<ColorAlias name="location cd marker" alias="alert:cyan"/>
|
<ColorAlias name="location cd marker" alias="theme:contrasting less"/>
|
||||||
<ColorAlias name="location loop" alias="alert:green"/>
|
<ColorAlias name="location loop" alias="theme:contrasting less"/>
|
||||||
<ColorAlias name="location marker" alias="theme:contrasting clock"/>
|
<ColorAlias name="location marker" alias="theme:contrasting less"/>
|
||||||
<ColorAlias name="location punch" alias="alert:ruddy"/>
|
<ColorAlias name="location punch" alias="widget:ruddy"/>
|
||||||
<ColorAlias name="location range" alias="alert:green"/>
|
<ColorAlias name="location range" alias="theme:contrasting less"/>
|
||||||
<ColorAlias name="lock button: fill active" alias="widget:bg"/>
|
<ColorAlias name="lock button: fill active" alias="widget:bg"/>
|
||||||
<ColorAlias name="lock button: led active" alias="alert:red"/>
|
<ColorAlias name="lock button: led active" alias="alert:red"/>
|
||||||
<ColorAlias name="lua action button: fill" alias="widget:bg"/>
|
<ColorAlias name="lua action button: fill" alias="widget:bg"/>
|
||||||
|
|
|
||||||
|
|
@ -966,7 +966,13 @@ TriggerBoxUI::slot_at_y (int y) const
|
||||||
bool
|
bool
|
||||||
TriggerBoxUI::drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int, int y, guint time)
|
TriggerBoxUI::drag_motion (Glib::RefPtr<Gdk::DragContext> const& context, int, int y, guint time)
|
||||||
{
|
{
|
||||||
bool can_drop = PublicEditor::instance ().pbdid_dragged_dt == _triggerbox.data_type ();
|
bool can_drop = true;
|
||||||
|
GtkCanvas* gtkcanvas = static_cast<GtkCanvas*> (canvas ());
|
||||||
|
std::string target = gtkcanvas->drag_dest_find_target (context, gtkcanvas->drag_dest_get_target_list ());
|
||||||
|
|
||||||
|
if (target == "x-ardour/region.pbdid") {
|
||||||
|
can_drop = PublicEditor::instance ().pbdid_dragged_dt == _triggerbox.data_type ();
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t n = slot_at_y (y);
|
uint64_t n = slot_at_y (y);
|
||||||
if (n >= _slots.size ()) {
|
if (n >= _slots.size ()) {
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ Trigger::set_use_follow_length (bool ufl)
|
||||||
bool
|
bool
|
||||||
Trigger::internal_use_follow_length () const
|
Trigger::internal_use_follow_length () const
|
||||||
{
|
{
|
||||||
return (_follow_action0.val().type != None) && _use_follow_length;
|
return (_follow_action0.val().type != FollowAction::None) && _use_follow_length;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -3018,6 +3018,11 @@ TriggerBox::determine_next_trigger (uint32_t current)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (all_triggers[current]->follow_action (0).type == FollowAction::None) {
|
||||||
|
/* when left follow action is disabled, no follow action */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* decide which of the two follow actions we're going to use (based on
|
/* decide which of the two follow actions we're going to use (based on
|
||||||
* random number and the probability setting)
|
* random number and the probability setting)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue