track mouse motion in the mapping bar
This does not yet snap to BBT positions
This commit is contained in:
parent
5e01503a56
commit
868d606d16
@ -193,8 +193,10 @@ Editor::initialize_canvas ()
|
|||||||
mapping_cursor->set_fill (false);
|
mapping_cursor->set_fill (false);
|
||||||
mapping_cursor->set_outline (true);
|
mapping_cursor->set_outline (true);
|
||||||
mapping_cursor->set_outline_color (0xff0000ff);
|
mapping_cursor->set_outline_color (0xff0000ff);
|
||||||
mapping_cursor->set_radius (timebar_height);
|
mapping_cursor->set_radius (timebar_height/2);
|
||||||
mapping_cursor->set_arc (360);
|
mapping_cursor->set_arc (360);
|
||||||
|
mapping_cursor->set_ignore_events (true);
|
||||||
|
mapping_cursor->set_center (ArdourCanvas::Duple (35., timebar_height/2.0)); // x is arbitrary at this time
|
||||||
mapping_cursor->hide ();
|
mapping_cursor->hide ();
|
||||||
|
|
||||||
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
range_marker_bar = new ArdourCanvas::Rectangle (range_marker_group, ArdourCanvas::Rect (0.0, timebar_top, ArdourCanvas::COORD_MAX, timebar_btm));
|
||||||
@ -257,7 +259,7 @@ Editor::initialize_canvas ()
|
|||||||
transport_punchout_line->hide();
|
transport_punchout_line->hide();
|
||||||
|
|
||||||
tempo_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), tempo_bar, TempoBarItem, "tempo bar"));
|
tempo_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), tempo_bar, TempoBarItem, "tempo bar"));
|
||||||
mapping_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), tempo_bar, MappingBarItem, "mapping bar"));
|
mapping_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), mapping_bar, MappingBarItem, "mapping bar"));
|
||||||
meter_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), meter_bar, MeterBarItem, "meter bar"));
|
meter_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), meter_bar, MeterBarItem, "meter bar"));
|
||||||
marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), marker_bar, MarkerBarItem, "marker bar"));
|
marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), marker_bar, MarkerBarItem, "marker bar"));
|
||||||
cd_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), cd_marker_bar, CdMarkerBarItem, "cd marker bar"));
|
cd_marker_bar->Event.connect (sigc::bind (sigc::mem_fun (*this, &Editor::canvas_ruler_bar_event), cd_marker_bar, CdMarkerBarItem, "cd marker bar"));
|
||||||
|
@ -1072,18 +1072,18 @@ Editor::canvas_ruler_bar_event (GdkEvent *event, ArdourCanvas::Item* item, ItemT
|
|||||||
/* XXX consolidate with Editor::canvas_ruler_event ? */
|
/* XXX consolidate with Editor::canvas_ruler_event ? */
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case GDK_ENTER_NOTIFY:
|
case GDK_ENTER_NOTIFY:
|
||||||
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
item->set_fill_color (Gtkmm2ext::HSV(UIConfiguration::instance().color_mod (color_name, "marker bar")).lighter(0.20).color());
|
item->set_fill_color (Gtkmm2ext::HSV(UIConfiguration::instance().color_mod (color_name, "marker bar")).lighter(0.20).color());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GDK_LEAVE_NOTIFY:
|
case GDK_LEAVE_NOTIFY:
|
||||||
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
if (event->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
item->set_fill_color (UIConfiguration::instance().color_mod (color_name, "marker bar"));
|
item->set_fill_color (UIConfiguration::instance().color_mod (color_name, "marker bar"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
return typed_event (item, event, type);
|
return typed_event (item, event, type);
|
||||||
|
@ -1987,6 +1987,10 @@ Editor::enter_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_
|
|||||||
choose_canvas_cursor_on_entry (item_type);
|
choose_canvas_cursor_on_entry (item_type);
|
||||||
|
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
|
case MappingBarItem:
|
||||||
|
mapping_cursor->show ();
|
||||||
|
break;
|
||||||
|
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
if (mouse_mode == MouseDraw || mouse_mode == MouseObject || mouse_mode == MouseContent) {
|
if (mouse_mode == MouseDraw || mouse_mode == MouseObject || mouse_mode == MouseContent) {
|
||||||
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
|
cp = static_cast<ControlPoint*>(item->get_data ("control_point"));
|
||||||
@ -2132,6 +2136,10 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (item_type) {
|
switch (item_type) {
|
||||||
|
case MappingBarItem:
|
||||||
|
mapping_cursor->hide ();
|
||||||
|
break;
|
||||||
|
|
||||||
case ControlPointItem:
|
case ControlPointItem:
|
||||||
_verbose_cursor->hide ();
|
_verbose_cursor->hide ();
|
||||||
break;
|
break;
|
||||||
@ -2280,7 +2288,7 @@ Editor::scrub (samplepos_t sample, double current_x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from_autoscroll)
|
Editor::motion_handler (ArdourCanvas::Item* item, GdkEvent* event, bool from_autoscroll)
|
||||||
{
|
{
|
||||||
_last_motion_y = event->motion.y;
|
_last_motion_y = event->motion.y;
|
||||||
|
|
||||||
@ -2334,6 +2342,11 @@ Editor::motion_handler (ArdourCanvas::Item* /*item*/, GdkEvent* event, bool from
|
|||||||
timepos_t t (where);
|
timepos_t t (where);
|
||||||
snap_to_with_modifier (t, event);
|
snap_to_with_modifier (t, event);
|
||||||
set_snapped_cursor_position (t);
|
set_snapped_cursor_position (t);
|
||||||
|
|
||||||
|
if (item == mapping_bar) {
|
||||||
|
double const new_pos = sample_to_pixel_unrounded (where);
|
||||||
|
mapping_cursor->set_center (ArdourCanvas::Duple (new_pos, mapping_cursor->center().y));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!peaks_visible) {
|
if (!peaks_visible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user