diff --git a/gtk2_ardour/cuebox_ui.cc b/gtk2_ardour/cuebox_ui.cc
index 8a4797426d..a9c7480eca 100644
--- a/gtk2_ardour/cuebox_ui.cc
+++ b/gtk2_ardour/cuebox_ui.cc
@@ -247,12 +247,8 @@ CueBoxUI::context_menu (uint64_t idx)
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::None)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::None), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Stop)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::Stop), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Again)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::Again), idx)));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::PrevTrigger), idx)));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::NextTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::ForwardTrigger), idx)));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::AnyTrigger), idx)));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::OtherTrigger), idx)));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueBoxUI::set_all_follow_action), FollowAction (FollowAction::JumpTrigger), idx)));
Menu* launch_menu = manage (new Menu);
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 5384c32d57..8a5c6999cf 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -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));
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");
- 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));
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");
- 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");
- 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");
- 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");
- 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_bar = new ArdourCanvas::Rectangle (cue_marker_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height));
- CANVAS_DEBUG_NAME (cd_marker_bar, "Cue Marker Bar");
- cue_marker_bar->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
+ cue_marker_bar = new ArdourCanvas::Rectangle (cue_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
+ CANVAS_DEBUG_NAME (cue_marker_bar, "Cue Marker Bar");
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"));
- meter_bar->set_fill_color (UIConfiguration::instance().color_mod ("meter bar", "marker bar"));
- meter_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
-
- tempo_bar->set_fill_color (UIConfiguration::instance().color_mod ("tempo bar", "marker bar"));
- tempo_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
-
- marker_bar->set_fill_color (UIConfiguration::instance().color_mod ("marker bar", "marker bar"));
- marker_bar->set_outline_color (UIConfiguration::instance().color ("marker bar separator"));
-
- 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"));
+ //these have no color (transparent) until moused-over
+ meter_bar->set_fill_color (0);
+ tempo_bar->set_fill_color (0);
+ cd_marker_bar->set_fill_color (0);
+ cue_marker_bar->set_fill_color (0);
+ range_marker_bar->set_fill_color (0);
+ marker_bar->set_fill_color (0);
+ transport_marker_bar->set_fill_color (0);
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"));
diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc
index ee6b62f09b..5728e7be4c 100644
--- a/gtk2_ardour/editor_canvas_events.cc
+++ b/gtk2_ardour/editor_canvas_events.cc
@@ -981,30 +981,105 @@ Editor::canvas_marker_event (GdkEvent *event, ArdourCanvas::Item* item, ArdourMa
bool
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);
}
bool
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);
}
bool
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);
}
bool
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);
}
bool
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);
}
@@ -1099,12 +1174,42 @@ Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType
bool
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);
}
bool
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);
}
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 00afe7f0f5..e899433cc6 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -123,6 +123,7 @@ Editor::add_new_location_internal (Location* location)
group = cd_marker_group;
} 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->set_cue_index(location->cue_id());
group = cue_marker_group;
} else {
lam->start = new ArdourMarker (*this, *marker_group, color, location->name(), ArdourMarker::Mark, location->start());
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index e40bb424e0..baeae27bce 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1762,7 +1762,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
case CueMarkerBarItem:
if (!_dragging_playhead) {
/* 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);
}
return true;
diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc
index 835c767e8e..4f4f5be71a 100644
--- a/gtk2_ardour/editor_rulers.cc
+++ b/gtk2_ardour/editor_rulers.cc
@@ -178,8 +178,8 @@ Editor::initialize_rulers ()
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(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(cue_mark_label, PACK_SHRINK, PACK_START));
lab_children.push_back (Element(videotl_label, PACK_SHRINK, PACK_START));
/* 1 event handler to bind them all ... */
@@ -538,6 +538,8 @@ Editor::update_ruler_visibility ()
tempo_label.hide();
}
+ ArdourCanvas::Rectangle *last_marker_bar = 0;
+
if (ruler_range_action->get_active()) {
old_unit_pos = range_marker_group->position().y;
if (tbpos != old_unit_pos) {
@@ -546,6 +548,9 @@ Editor::update_ruler_visibility ()
range_marker_group->show();
range_mark_label.show();
+ range_marker_bar->set_outline(false);
+ last_marker_bar = range_marker_bar;
+
tbpos += timebar_height;
tbgpos += timebar_height;
visible_timebars++;
@@ -561,6 +566,10 @@ Editor::update_ruler_visibility ()
}
transport_marker_group->show();
transport_mark_label.show();
+
+ transport_marker_bar->set_outline(false);
+ last_marker_bar = transport_marker_bar;
+
tbpos += timebar_height;
tbgpos += timebar_height;
visible_timebars++;
@@ -576,6 +585,10 @@ Editor::update_ruler_visibility ()
}
cd_marker_group->show();
cd_mark_label.show();
+
+ cd_marker_bar->set_outline(false);
+ last_marker_bar = cd_marker_bar;
+
tbpos += timebar_height;
tbgpos += timebar_height;
visible_timebars++;
@@ -588,6 +601,25 @@ Editor::update_ruler_visibility ()
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()) {
old_unit_pos = cue_marker_group->position().y;
if (tbpos != old_unit_pos) {
@@ -595,6 +627,10 @@ Editor::update_ruler_visibility ()
}
cue_marker_group->show();
cue_mark_label.show();
+
+ cue_marker_bar->set_outline(false);
+ last_marker_bar = cue_marker_bar;
+
tbpos += timebar_height;
tbgpos += timebar_height;
visible_timebars++;
@@ -607,19 +643,10 @@ Editor::update_ruler_visibility ()
update_cue_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();
- tbpos += timebar_height;
- tbgpos += timebar_height;
- visible_timebars++;
- } else {
- marker_group->hide();
- mark_label.hide();
+ //the bottom ruler needs a black outline to separate it from the editor canvas
+ if ( last_marker_bar ) {
+ last_marker_bar->set_outline(true);
+ last_marker_bar->set_outline_what(ArdourCanvas::Rectangle::BOTTOM);
}
if (ruler_video_action->get_active()) {
diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc
index 9628320a7f..164947c18b 100644
--- a/gtk2_ardour/marker.cc
+++ b/gtk2_ardour/marker.cc
@@ -90,11 +90,13 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
, _label_offset (0)
, _line_height (-1)
, _region_view (rv)
+ , _cue_index (-1)
{
+ const double scale = UIConfiguration::instance ().get_ui_scale ();
const double MH = marker_height - .5;
- const double M3 = std::max(1.f, rintf(3.f * UIConfiguration::instance().get_ui_scale()));
- const double M6 = std::max(2.f, rintf(6.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 * scale));
/* 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, 0.0));
- _shift = 3;
- _label_offset = 10.0;
+ _shift = 3 * scale;
+ _label_offset = 4.0 * scale;
break;
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 ( M3, 0.0));
- _shift = 3;
- _label_offset = 8.0;
+ _shift = 3 * scale;
+ _label_offset = 8.0 * scale;
break;
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, 0.0));
- _shift = 0;
- _label_offset = 8.0;
+ _shift = 0 * scale;
+ _label_offset = 8.0 * scale;
break;
case SessionEnd:
@@ -223,7 +225,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
points->push_back (ArdourCanvas::Duple ( M6, 0.0));
_shift = M6;
- _label_offset = 0.0;
+ _label_offset = 0.0 * scale;
break;
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, 0.0));
- _shift = 0;
+ _shift = 0 * scale;
_label_offset = MH;
break;
@@ -245,7 +247,7 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
points->push_back (ArdourCanvas::Duple (MH, 0.0));
_shift = MH;
- _label_offset = 0.0;
+ _label_offset = 0.0 * scale;
break;
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, 0.0));
- _shift = 0;
+ _shift = 0 * scale;
_label_offset = MH;
break;
@@ -267,23 +269,15 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
points->push_back (ArdourCanvas::Duple (0.0, 0.0));
_shift = MH;
- _label_offset = 0.0;
+ _label_offset = 0.0 * scale;
break;
case Cue:
- /* ben: new shape needed here */
points = new ArdourCanvas::Points ();
-
- points->push_back (ArdourCanvas::Duple (0.0, 0.0));
- 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;
+ _shift = MH/2;
+ _label_offset = 2.0 * scale;
break;
+
}
_position = pos;
@@ -296,21 +290,36 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
#endif
if (type != RegionCue) {
- _name_background = new ArdourCanvas::Rectangle (group);
+ _name_flag = new ArdourCanvas::Rectangle (group);
#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
} else {
- _name_background = 0;
+ _name_flag = 0;
}
/* adjust to properly locate the tip */
- mark = new ArdourCanvas::Polygon (group);
- CANVAS_DEBUG_NAME (mark, string_compose ("Marker::mark for %1", annotation));
+ _pcue = new ArdourCanvas::Circle (group);
+ _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 */
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));
_name_item->set_font_description (name_font);
_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);
@@ -339,7 +348,8 @@ ArdourMarker::ArdourMarker (PublicEditor& ed, ArdourCanvas::Item& parent, guint3
*/
group->set_data ("marker", this);
- mark->set_data ("marker", this);
+ _pmark->set_data ("marker", this);
+ _pcue->set_data ("marker", this);
if (handle_events) {
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;
setup_line ();
- mark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
- mark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
+ _pcue->set_fill_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
@@ -467,9 +479,10 @@ ArdourMarker::set_name (const string& new_name)
{
_name = new_name;
- mark->set_tooltip(new_name);
- if (_name_background) {
- _name_background->set_tooltip(new_name);
+ _pcue->set_tooltip(new_name);
+ _pmark->set_tooltip(new_name);
+ if (_name_flag) {
+ _name_flag->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->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 ()) {
/* adjust right edge of background to fit text */
- _name_background->set_x0 (_name_item->position().x - padding);
- _name_background->set_x1 (_name_item->position().x + name_width + _shift);
+ _name_flag->set_x0 (_name_item->position().x - padding);
+ _name_flag->set_x1 (_name_item->position().x + name_width + _shift);
} else {
/* right edge remains at zero (group-relative). Add
* arbitrary 2 pixels of extra padding at the end
@@ -525,26 +543,26 @@ ArdourMarker::setup_name_display ()
case Tempo:
_name_item->hide ();
// tip's x-pos is at "M3", box is 2x marker's
- _name_background->set_x0 (-M3);
- _name_background->set_x1 (3 * M3);
+ _name_flag->set_x0 (-M3);
+ _name_flag->set_x1 (3 * M3);
break;
case Mark:
case Meter:
- _name_background->set_x0 (M3);
- _name_background->set_x1 (_name_item->position().x + name_width + padding);
+ _name_flag->set_x0 (M3);
+ _name_flag->set_x1 (_name_item->position().x + name_width + padding);
break;
default:
- _name_background->set_x0 (0);
- _name_background->set_x1 (_name_item->position().x + name_width + padding);
+ _name_flag->set_x0 (0);
+ _name_flag->set_x1 (_name_item->position().x + name_width + padding);
break;
}
}
}
}
- if (_name_background) {
- _name_background->set_y0 (0);
- _name_background->set_y1 (marker_height + 1);
+ if (_name_flag) {
+ _name_flag->set_y0 (0);
+ _name_flag->set_y1 (marker_height - 2);
}
}
@@ -586,8 +604,9 @@ void
ArdourMarker::set_points_color (uint32_t c)
{
_points_color = c;
- mark->set_fill_color (_points_color);
- mark->set_outline_color (_points_color);
+ _pcue->set_fill_color (_points_color);
+ _pmark->set_fill_color (_points_color);
+ _pmark->set_outline_color (_points_color);
}
void
@@ -595,15 +614,16 @@ ArdourMarker::set_color_rgba (uint32_t c)
{
_color = c;
- mark->set_fill_color (_selected ? UIConfiguration::instance().color ("entered marker") : _color);
- mark->set_outline_color ( _selected ? UIConfiguration::instance().color ("entered marker") : _color );
+ _pcue->set_fill_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)) {
_track_canvas_line->set_outline_color (_color);
}
if (_name_item) {
- if (_name_background) {
+ if (_name_flag) {
/* make sure text stands out over bg color */
_name_item->set_color (contrasting_text_color (_color));
} else {
@@ -612,10 +632,10 @@ ArdourMarker::set_color_rgba (uint32_t c)
}
}
- if (_name_background) {
- _name_background->set_fill (true);
- _name_background->set_fill_color (UINT_RGBA_CHANGE_A (_color, 0x70));
- _name_background->set_outline (false);
+ if (_name_flag) {
+ _name_flag->set_fill (true);
+ _name_flag->set_fill_color (_color);
+ _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 ( M3, top));
- mark->set (*points);
+ _pmark->set (*points);
}
void
diff --git a/gtk2_ardour/marker.h b/gtk2_ardour/marker.h
index 23fc4c7b8f..d65d28483c 100644
--- a/gtk2_ardour/marker.h
+++ b/gtk2_ardour/marker.h
@@ -34,6 +34,7 @@
#include "canvas/fwd.h"
#include "canvas/types.h"
+#include "canvas/circle.h"
namespace Temporal {
class Point;
@@ -116,6 +117,11 @@ public:
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:
PublicEditor& editor;
@@ -123,11 +129,12 @@ protected:
ArdourCanvas::Item* _parent;
ArdourCanvas::Item *group;
- ArdourCanvas::Polygon *mark;
+ ArdourCanvas::Circle *_pcue;
+ ArdourCanvas::Polygon *_pmark;
ArdourCanvas::Text *_name_item;
ArdourCanvas::Points *points;
ArdourCanvas::Line* _track_canvas_line;
- ArdourCanvas::Rectangle* _name_background;
+ ArdourCanvas::Rectangle* _name_flag;
std::string _name;
double unit_position;
@@ -149,6 +156,8 @@ protected:
RegionView* _region_view;
+ int _cue_index;
+
void reposition ();
void setup_line_x ();
void setup_name_display ();
diff --git a/gtk2_ardour/mini_timeline.cc b/gtk2_ardour/mini_timeline.cc
index f9f5cd6a6d..93c0644a54 100644
--- a/gtk2_ardour/mini_timeline.cc
+++ b/gtk2_ardour/mini_timeline.cc
@@ -24,6 +24,7 @@
#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/keyboard.h"
+#include "gtkmm2ext/utils.h"
#include "widgets/tooltips.h"
@@ -40,6 +41,7 @@
#define BBT_BAR_CHAR "|"
using namespace ARDOUR;
+using namespace Gtkmm2ext;
MiniTimeline::MiniTimeline ()
: _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::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::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,
string_compose (_("Navigation Timeline. 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(),
@@ -204,11 +209,6 @@ MiniTimeline::super_rapid_update ()
change = true;
}
- if (_clock_mode == AudioClock::BBT) {
- // TODO check if tempo-map changed
- change = true;
- }
-
if (change) {
_last_update_sample = sample;
update_minitimeline ();
@@ -339,7 +339,7 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
const int y = PADDING;
int w2 = (h - 1) / 4;
- double h0 = h * .4;
+ double h0 = h * .6;
double h1 = h - h0;
int lw, lh;
@@ -351,30 +351,14 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
prelight = true;
}
- // TODO cache in set_colors()
+ const double scale = UIConfiguration::instance ().get_ui_scale ();
uint32_t color = UIConfiguration::instance().color (
- prelight ? "entered marker" : "location marker");
+ prelight ? "entered marker" : "location marker");
- double r, g, b, a;
- Gtkmm2ext::color_to_rgba (color, r, g, b, a);
+ //shrink the height of the 'flag' part, a bit.
+ h -= 4*scale;
- if (rw < x0) {
- 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
+ // draw marker first
cairo_move_to (cr, x0 - .5, y + .5);
cairo_rel_line_to (cr, -w2 , 0);
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, 0, -h0);
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_stroke_preserve (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;
}
+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
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 {
- LocationMarker (const std::string& l, Temporal::timepos_t const & w)
- : label (l), when (w) {}
+ LocationMarker (int idx, const std::string& l, Temporal::timepos_t const & w)
+ : cue_index(idx), label (l), when (w) {}
+ int cue_index;
std::string label;
Temporal::timepos_t when;
};
@@ -518,13 +556,13 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
}
/* time */
- const samplepos_t p = _last_update_sample;
- const samplepos_t lower = (std::max ((samplepos_t)0, (p - _time_span_samples)) / _time_granularity) * _time_granularity;
+ const samplepos_t phead = _last_update_sample; //playhead location
+ 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) {
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
// prefer to display BBT |0 or .0
@@ -545,9 +583,24 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
}
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 */
- samplepos_t lmin = std::max ((samplepos_t)0, (p - _time_span_samples));
- samplepos_t lmax = p + _time_span_samples;
+ samplepos_t lmin = std::max ((samplepos_t)0, (phead - _time_span_samples));
+ samplepos_t lmax = phead + _time_span_samples;
int tw, th;
_layout->set_text (X_("Marker@"));
@@ -565,8 +618,8 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
const Locations::LocationList& ll (_session->locations ()->list ());
for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) {
if ((*l)->is_session_range ()) {
- lm.push_back (LocationMarker(_("start"), (*l)->start ()));
- lm.push_back (LocationMarker(_("end"), (*l)->end ()));
+ lm.push_back (LocationMarker(-1, _("start"), (*l)->start ()));
+ lm.push_back (LocationMarker(-1, _("end"), (*l)->end ()));
continue;
}
@@ -574,7 +627,8 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
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 ();
@@ -593,7 +647,7 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
if (when < lmin) {
outside_left = l;
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 {
left_limit = width * .5 - mw;
}
@@ -603,16 +657,31 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
outside_right = l;
break;
}
- int x0 = floor (width * .5 + (when - p) * _px_per_sample);
+ int x0 = floor (width * .5 + (when - phead) * _px_per_sample);
int x1 = width;
const std::string& label = (*l).label;
- if (++l != lm.end()) {
- x1 = floor (width * .5 + (when - p) * _px_per_sample) - 1 - mw;
+ const int cue_index = (*l).cue_index;
+
+ std::vector::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;
- x1 = draw_mark (cr, x0, x1, label, prelight);
- _jumplist.push_back (JumpRange (x0 - mw, x1, when, prelight));
+ if (cue_index >= 0) {
+ 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);
+
+ l++;
}
if (outside_left != lm.end ()) {
@@ -622,7 +691,7 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
bool prelight = false;
x1 = draw_edge (cr, x0, x1, true, (*outside_left).label, prelight);
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);
}
}
@@ -635,27 +704,12 @@ MiniTimeline::render (Cairo::RefPtr const& ctx, cairo_rectangle_
bool prelight = false;
x0 = draw_edge (cr, x0, x1, false, (*outside_right).label, prelight);
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_paint (cr);
}
@@ -711,16 +765,17 @@ MiniTimeline::on_button_release_event (GdkEventButton *ev)
{
if (!_session) { 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 ()) {
return true;
}
- if (ev->y <= PADDING + _marker_height) {
- for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
- if (i->left <= ev->x && ev->x <= i->right) {
- _session->request_locate (i->to);
- return true;
- }
+ /* 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) {
+ if (i->prelight) {
+ _session->request_locate (i->to);
+ return true;
}
}
@@ -743,22 +798,7 @@ MiniTimeline::on_motion_notify_event (GdkEventMotion *ev)
bool need_expose = false;
- for (JumpList::const_iterator i = _jumplist.begin (); i != _jumplist.end(); ++i) {
- 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 ();
- }
+ update_minitimeline ();
return true;
}
diff --git a/gtk2_ardour/mini_timeline.h b/gtk2_ardour/mini_timeline.h
index 5ab3551828..65a8743ee3 100644
--- a/gtk2_ardour/mini_timeline.h
+++ b/gtk2_ardour/mini_timeline.h
@@ -66,6 +66,7 @@ private:
void update_minitimeline ();
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);
+ 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);
void render (Cairo::RefPtr const&, cairo_rectangle_t*);
@@ -83,6 +84,7 @@ private:
Glib::RefPtr _layout;
sigc::connection super_rapid_connection;
PBD::ScopedConnectionList marker_connection;
+ PBD::ScopedConnectionList tempo_map_connection;
PBD::ScopedConnectionList session_connection;
samplepos_t _last_update_sample;
@@ -104,10 +106,8 @@ private:
uint32_t _phead_color;
struct JumpRange {
- JumpRange (int l, int r, samplepos_t t, bool p = false)
- : left (l), right (r), to (t), prelight (p) {}
- int left;
- int right;
+ JumpRange (samplepos_t t, bool p = false)
+ : to (t), prelight (p) {}
samplepos_t to;
bool prelight;
};
diff --git a/gtk2_ardour/slot_properties_box.cc b/gtk2_ardour/slot_properties_box.cc
index a1e788deb6..6145030a98 100644
--- a/gtk2_ardour/slot_properties_box.cc
+++ b/gtk2_ardour/slot_properties_box.cc
@@ -140,12 +140,8 @@ SlotPropertyTable::SlotPropertyTable ()
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::None)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::None), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::Stop)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::Stop), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::Again)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::Again), 0)));
- _follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::PrevTrigger), 0)));
- _follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::NextTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ReverseTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 0)));
- _follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 0)));
- _follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 0)));
_follow_left.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 0)));
_follow_left.set_sizing_text (longest_follow);
@@ -153,12 +149,8 @@ SlotPropertyTable::SlotPropertyTable ()
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::None)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::None), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::Stop)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::Stop), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::Again)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::Again), 1)));
- _follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::PrevTrigger), 1)));
- _follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::NextTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ReverseTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::ForwardTrigger), 1)));
- _follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::AnyTrigger), 1)));
- _follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::OtherTrigger), 1)));
_follow_right.AddMenuElem (MenuElem (follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &SlotPropertyTable::set_follow_action), FollowAction (FollowAction::JumpTrigger), 1)));
_follow_right.set_sizing_text (longest_follow);
diff --git a/gtk2_ardour/themes/dark-ardour.colors b/gtk2_ardour/themes/dark-ardour.colors
index 16e5d86782..63f4c0f832 100644
--- a/gtk2_ardour/themes/dark-ardour.colors
+++ b/gtk2_ardour/themes/dark-ardour.colors
@@ -14,7 +14,7 @@
-
+
@@ -119,7 +119,7 @@
-
+
@@ -130,7 +130,7 @@
-
+
@@ -167,11 +167,11 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/gtk2_ardour/trigger_master.cc b/gtk2_ardour/trigger_master.cc
index afbc5f1ec2..6b80db1e03 100644
--- a/gtk2_ardour/trigger_master.cc
+++ b/gtk2_ardour/trigger_master.cc
@@ -344,12 +344,8 @@ TriggerMaster::context_menu ()
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::None)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::None))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Stop)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::Stop))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Again)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::Again))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::PrevTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::NextTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::ForwardTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &TriggerMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
Menu* launch_menu = manage (new Menu);
@@ -726,12 +722,8 @@ CueMaster::context_menu ()
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::None)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::None))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Stop)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::Stop))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::Again)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::Again))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::PrevTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::NextTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::ForwardTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::ReverseTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::ReverseTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::AnyTrigger))));
- fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::OtherTrigger))));
fitems.push_back (MenuElem (TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind (sigc::mem_fun (*this, &CueMaster::set_all_follow_action), FollowAction (FollowAction::JumpTrigger))));
diff --git a/gtk2_ardour/trigger_ui.cc b/gtk2_ardour/trigger_ui.cc
index ad4d52c82f..782864ed87 100644
--- a/gtk2_ardour/trigger_ui.cc
+++ b/gtk2_ardour/trigger_ui.cc
@@ -79,15 +79,10 @@ TriggerUI::TriggerUI ()
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::None)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::Stop)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::Again)));
- follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::QueuedTrigger)));
- follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::NextTrigger)));
- follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::PrevTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::ForwardTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::ReverseTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::FirstTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::LastTrigger)));
- follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::AnyTrigger)));
- follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::OtherTrigger)));
follow_strings.push_back (follow_action_to_string (FollowAction (FollowAction::JumpTrigger)));
for (std::vector::const_iterator i = follow_strings.begin(); i != follow_strings.end(); ++i) {
@@ -604,21 +599,6 @@ TriggerUI::follow_context_menu ()
if (trigger ()->follow_action (0) == FollowAction::Again) {
dynamic_cast (&fitems.back ())->set_active (true);
}
-#if QUEUED_SLOTS_IMPLEMENTED
- fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::QueuedTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::QueuedTrigger))));
- if (trigger ()->follow_action (0) == FollowAction::QueuedTrigger) {
- dynamic_cast (&fitems.back ())->set_active (true);
- }
-#endif
- fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::PrevTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::PrevTrigger))));
- if (trigger ()->follow_action (0) == FollowAction::PrevTrigger) {
- dynamic_cast (&fitems.back ())->set_active (true);
- }
- fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::NextTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::NextTrigger))));
- if (trigger ()->follow_action (0) == FollowAction::NextTrigger) {
- dynamic_cast (&fitems.back ())->set_active (true);
- }
-
fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::ForwardTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::ForwardTrigger))));
if (trigger ()->follow_action (0) == FollowAction::ForwardTrigger) {
dynamic_cast (&fitems.back ())->set_active (true);
@@ -638,15 +618,6 @@ TriggerUI::follow_context_menu ()
dynamic_cast (&fitems.back ())->set_active (true);
}
#endif
- fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::AnyTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::AnyTrigger))));
- if (trigger ()->follow_action (0) == FollowAction::AnyTrigger) {
- dynamic_cast (&fitems.back ())->set_active (true);
- }
- fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::OtherTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::OtherTrigger))));
- if (trigger ()->follow_action (0) == FollowAction::OtherTrigger) {
- dynamic_cast (&fitems.back ())->set_active (true);
- }
-
fitems.push_back (RadioMenuElem (fagroup, TriggerUI::follow_action_to_string(FollowAction (FollowAction::JumpTrigger)), sigc::bind(sigc::mem_fun (*this, &TriggerUI::set_follow_action), FollowAction (FollowAction::JumpTrigger))));
if (trigger ()->follow_action (0) == FollowAction::JumpTrigger) {
dynamic_cast (&fitems.back ())->set_active (true);
@@ -793,12 +764,6 @@ TriggerUI::follow_action_to_string (FollowAction const & fa)
return _("Stop");
case FollowAction::Again:
return _("Again");
- case FollowAction::QueuedTrigger:
- return _("Queued");
- case FollowAction::NextTrigger:
- return _("Next");
- case FollowAction::PrevTrigger:
- return _("Prev");
case FollowAction::ForwardTrigger:
return _("Forward");
case FollowAction::ReverseTrigger:
@@ -807,10 +772,6 @@ TriggerUI::follow_action_to_string (FollowAction const & fa)
return _("First");
case FollowAction::LastTrigger:
return _("Last");
- case FollowAction::AnyTrigger:
- return _("Any");
- case FollowAction::OtherTrigger:
- return _("Other");
case FollowAction::JumpTrigger:
return _("Jump");
}
diff --git a/gtk2_ardour/triggerbox_ui.cc b/gtk2_ardour/triggerbox_ui.cc
index e2f3f08193..a454fd6c70 100644
--- a/gtk2_ardour/triggerbox_ui.cc
+++ b/gtk2_ardour/triggerbox_ui.cc
@@ -210,20 +210,6 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr context, FollowAct
context->arc (size / 2 + size * 0.2, size / 2, 1.5 * scale, 0, 2 * M_PI); // arrow head
context->fill ();
break;
- case FollowAction::NextTrigger:
- context->move_to (size / 2, 3 * scale);
- context->line_to (size / 2, size - 5 * scale);
- context->stroke ();
- context->arc (size / 2, size - 5 * scale, 2 * scale, 0, 2 * M_PI); // arrow head
- context->fill ();
- break;
- case FollowAction::PrevTrigger:
- context->move_to (size / 2, 5 * scale);
- context->line_to (size / 2, size - 3 * scale);
- context->stroke ();
- context->arc (size / 2, 5 * scale, 2 * scale, 0, 2 * M_PI); // arrow head
- context->fill ();
- break;
case FollowAction::ForwardTrigger:
context->move_to (size / 2, 3 * scale);
context->line_to (size / 2, size - 3 * scale);
@@ -259,42 +245,6 @@ TriggerEntry::draw_follow_icon (Cairo::RefPtr context, FollowAct
context->fill ();
break;
- case FollowAction::QueuedTrigger: {
- Glib::RefPtr layout = Pango::Layout::create (context);
- layout->set_font_description (UIConfiguration::instance ().get_SmallMonospaceFont ());
- layout->set_text (icon == FollowAction::AnyTrigger ? "&" : "@");
- int tw, th;
- layout->get_pixel_size (tw, th);
- context->move_to (size / 2, size / 2);
- context->rel_move_to (-tw / 2, -th / 2);
- layout->show_in_cairo_context (context);
- } break;
- case FollowAction::AnyTrigger: {
- for (int i = 0; i < 6; i++) {
- Cairo::Matrix m = context->get_matrix ();
- context->translate (size / 2, size / 2);
- context->rotate (i * M_PI / 3);
- context->move_to (0, 0);
- context->line_to (0, (size / 2) - 4 * scale);
- context->stroke ();
- context->set_matrix (m);
- }
- context->set_identity_matrix ();
- } break;
- case FollowAction::OtherTrigger: {
- context->set_line_width (1.5 * scale);
- set_source_rgba (context, HSV (UIConfiguration::instance ().color ("neutral:midground")).lighter (0.25).color ()); // needs to be brighter to maintain balance
- for (int i = 0; i < 6; i++) {
- Cairo::Matrix m = context->get_matrix ();
- context->translate (size / 2, size / 2);
- context->rotate (i * M_PI / 3);
- context->move_to (0, 2 * scale);
- context->line_to (0, (size / 2) - 4 * scale);
- context->stroke ();
- context->set_matrix (m);
- }
- context->set_identity_matrix ();
- } break;
/* ben: new shape here ? */
case FollowAction::JumpTrigger: {
context->set_line_width (1.5 * scale);
@@ -966,7 +916,13 @@ TriggerBoxUI::slot_at_y (int y) const
bool
TriggerBoxUI::drag_motion (Glib::RefPtr 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 (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);
if (n >= _slots.size ()) {
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index 1a7c913c1c..2def07db90 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -827,15 +827,10 @@ struct FollowAction {
None,
Stop,
Again,
- QueuedTrigger, /* DP-style */
- NextTrigger, /* Live-style, and below */
- PrevTrigger,
ForwardTrigger, /* any "next" skipping empties */
ReverseTrigger, /* any "prev" skipping empties */
FirstTrigger,
LastTrigger,
- AnyTrigger,
- OtherTrigger,
JumpTrigger,
};
diff --git a/libs/ardour/enums.cc b/libs/ardour/enums.cc
index 315b6e77f9..bc12c2ad46 100644
--- a/libs/ardour/enums.cc
+++ b/libs/ardour/enums.cc
@@ -862,15 +862,10 @@ setup_enum_writer ()
REGISTER_CLASS_ENUM (FollowAction, None);
REGISTER_CLASS_ENUM (FollowAction, Stop);
REGISTER_CLASS_ENUM (FollowAction, Again);
- REGISTER_CLASS_ENUM (FollowAction, QueuedTrigger);
- REGISTER_CLASS_ENUM (FollowAction, NextTrigger);
- REGISTER_CLASS_ENUM (FollowAction, PrevTrigger);
REGISTER_CLASS_ENUM (FollowAction, ForwardTrigger);
REGISTER_CLASS_ENUM (FollowAction, ReverseTrigger);
REGISTER_CLASS_ENUM (FollowAction, FirstTrigger);
REGISTER_CLASS_ENUM (FollowAction, LastTrigger);
- REGISTER_CLASS_ENUM (FollowAction, AnyTrigger);
- REGISTER_CLASS_ENUM (FollowAction, OtherTrigger);
REGISTER_CLASS_ENUM (FollowAction, JumpTrigger);
REGISTER (_FollowAction);
diff --git a/libs/ardour/triggerbox.cc b/libs/ardour/triggerbox.cc
index f394651f21..6fc2926156 100644
--- a/libs/ardour/triggerbox.cc
+++ b/libs/ardour/triggerbox.cc
@@ -3042,21 +3042,15 @@ TriggerBox::determine_next_trigger (uint32_t current)
DEBUG_TRACE (DEBUG::Triggers, string_compose ("choose next trigger using follow action %1 given prob %2 and rnd %3\n", fa.to_string(), all_triggers[current]->follow_action_probability(), r));
- switch (fa.type) {
-
- case FollowAction::Stop:
+ if (fa.type == FollowAction::Stop) {
return -1;
+ }
- case FollowAction::QueuedTrigger:
- /* XXX implement me */
- return -1;
- default:
- if (runnable == 1) {
- /* there's only 1 runnable trigger, so the "next" one
- is the same as the current one.
- */
- return current;
- }
+ if (runnable == 1) {
+ /* there's only 1 runnable trigger, so the "next" one
+ is the same as the current one.
+ */
+ return current;
}
/* second switch: handle the "real" follow actions */
@@ -3068,25 +3062,6 @@ TriggerBox::determine_next_trigger (uint32_t current)
case FollowAction::Again:
return current;
-
- case FollowAction::NextTrigger:
- n = current + 1;
- if (n < all_triggers.size()) {
- if (all_triggers[n]->region()) {
- return n;
- }
- }
- break;
-
- case FollowAction::PrevTrigger:
- if (current > 0) {
- n = current - 1;
- if (all_triggers[n]->region()) {
- return n;
- }
- }
- break;
-
case FollowAction::ForwardTrigger:
n = current;
while (true) {
@@ -3142,36 +3117,6 @@ TriggerBox::determine_next_trigger (uint32_t current)
}
break;
- case FollowAction::AnyTrigger:
- while (true) {
- n = _pcg.rand (all_triggers.size());
- if (!all_triggers[n]->region()) {
- continue;
- }
- if (all_triggers[n]->active()) {
- continue;
- }
- break;
- }
- return n;
-
-
- case FollowAction::OtherTrigger:
- while (true) {
- n = _pcg.rand (all_triggers.size());
- if ((uint32_t) n == current) {
- continue;
- }
- if (!all_triggers[n]->region()) {
- continue;
- }
- if (all_triggers[n]->active()) {
- continue;
- }
- break;
- }
- return n;
-
case FollowAction::JumpTrigger:
for (std::size_t n = 0; n < default_triggers_per_box; ++n) {
if (fa.targets.test (n) && all_triggers[n]->region()) {
@@ -3186,7 +3131,6 @@ TriggerBox::determine_next_trigger (uint32_t current)
/* NOTREACHED */
case FollowAction::Stop:
- case FollowAction::QueuedTrigger:
break;
}