Display correct value for verbose control point cursor for Midi CC (int) and plugin automation (map to parameter range).
Use double throughout for automation control point y coordinate instead of casting to this and that losing precision. Fix crash bug in route automation menu. git-svn-id: svn://localhost/ardour2/trunk@2107 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a1052b0eca
commit
b57510a3a9
|
@ -764,7 +764,7 @@ AutomationLine::determine_visible_control_points (ALPoints& points)
|
|||
}
|
||||
|
||||
string
|
||||
AutomationLine::get_verbose_cursor_string (float fraction)
|
||||
AutomationLine::get_verbose_cursor_string (double fraction)
|
||||
{
|
||||
char buf[32];
|
||||
|
||||
|
@ -775,7 +775,11 @@ AutomationLine::get_verbose_cursor_string (float fraction)
|
|||
snprintf (buf, sizeof (buf), "%.1fdB", coefficient_to_dB (slider_position_to_gain (fraction)));
|
||||
}
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "%.2f", fraction);
|
||||
view_to_model_y(fraction);
|
||||
if (alist->parameter().type() == MidiCCAutomation)
|
||||
snprintf (buf, sizeof (buf), "%d", (int)fraction);
|
||||
else
|
||||
snprintf (buf, sizeof (buf), "%.2f", fraction);
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
@ -1306,6 +1310,8 @@ AutomationLine::view_to_model_y (double& y)
|
|||
y = 1.0 - y;
|
||||
} else if (alist->parameter().type() == MidiCCAutomation) {
|
||||
y = (int)(y * 127.0);
|
||||
} else if (alist->parameter().type() == PluginAutomation) {
|
||||
y = y * (double)(alist->get_max_y()- alist->get_min_y()) + alist->get_min_y();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
|
|||
void show_selection();
|
||||
void hide_selection ();
|
||||
|
||||
virtual string get_verbose_cursor_string (float);
|
||||
virtual string get_verbose_cursor_string (double);
|
||||
virtual void view_to_model_y (double&);
|
||||
virtual void model_to_view_y (double&);
|
||||
|
||||
|
|
|
@ -2374,7 +2374,7 @@ Editor::start_control_point_grab (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
|
||||
control_point->line.start_drag (control_point, drag_info.grab_frame, 0);
|
||||
|
||||
float fraction = 1.0 - ((control_point->get_y() - control_point->line.y_position()) / control_point->line.height());
|
||||
double fraction = 1.0 - ((control_point->get_y() - control_point->line.y_position()) / (double)control_point->line.height());
|
||||
set_verbose_canvas_cursor (control_point->line.get_verbose_cursor_string (fraction),
|
||||
drag_info.current_pointer_x + 20, drag_info.current_pointer_y + 20);
|
||||
|
||||
|
@ -2412,7 +2412,7 @@ Editor::control_point_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent*
|
|||
snap_to (cx_frames);
|
||||
}
|
||||
|
||||
float const fraction = 1.0 - ((cy - cp->line.y_position()) / cp->line.height());
|
||||
const double fraction = 1.0 - ((cy - cp->line.y_position()) / (double)cp->line.height());
|
||||
|
||||
bool push;
|
||||
|
||||
|
@ -2503,7 +2503,7 @@ Editor::start_line_grab (AutomationLine* line, GdkEvent* event)
|
|||
|
||||
start_grab (event, fader_cursor);
|
||||
|
||||
double const fraction = 1.0 - ((cy - line->y_position()) / line->height());
|
||||
const double fraction = 1.0 - ((cy - line->y_position()) / (double)line->height());
|
||||
|
||||
line->start_drag (0, drag_info.grab_frame, fraction);
|
||||
|
||||
|
@ -2521,7 +2521,7 @@ Editor::line_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
|
||||
line->parent_group().w2i (cx, cy);
|
||||
|
||||
double const fraction = 1.0 - ((cy - line->y_position()) / line->height());
|
||||
const double fraction = 1.0 - ((cy - line->y_position()) / (double)line->height());
|
||||
|
||||
bool push;
|
||||
|
||||
|
|
|
@ -1905,7 +1905,7 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
|
|||
redraw = true;
|
||||
}
|
||||
|
||||
if (showit != pan->view->marked_for_display()) {
|
||||
if (pan->view && showit != pan->view->marked_for_display()) {
|
||||
|
||||
if (showit) {
|
||||
pan->view->set_marked_for_display (true);
|
||||
|
|
Loading…
Reference in New Issue
Block a user