mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
fix setting sync point crash, reinstate keymouse zoom tentatively
git-svn-id: svn://localhost/trunk/ardour2@284 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
a54169c198
commit
897d071e97
3 changed files with 61 additions and 19 deletions
|
|
@ -870,7 +870,7 @@ Editor::set_frames_per_unit (double fpu)
|
||||||
which will do the same updates.
|
which will do the same updates.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (session) {
|
if (session && !no_zoom_repos_update) {
|
||||||
horizontal_adjustment.set_upper (session->current_end_frame() / frames_per_unit);
|
horizontal_adjustment.set_upper (session->current_end_frame() / frames_per_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,16 +47,67 @@ using namespace Gtk;
|
||||||
bool
|
bool
|
||||||
Editor::track_canvas_scroll (GdkEventScroll* ev)
|
Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||||
{
|
{
|
||||||
|
int x, y;
|
||||||
|
double wx, wy;
|
||||||
|
|
||||||
switch (ev->direction) {
|
switch (ev->direction) {
|
||||||
case GDK_SCROLL_UP:
|
case GDK_SCROLL_UP:
|
||||||
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
|
||||||
|
//if (ev->state == GDK_CONTROL_MASK) {
|
||||||
|
/* XXX
|
||||||
|
the ev->x will be out of step with the canvas
|
||||||
|
if we're in mid zoom, so we have to get the damn mouse
|
||||||
|
pointer again
|
||||||
|
*/
|
||||||
|
track_canvas.get_pointer (x, y);
|
||||||
|
track_canvas.window_to_world (x, y, wx, wy);
|
||||||
|
wx += horizontal_adjustment.get_value();
|
||||||
|
wy += vertical_adjustment.get_value();
|
||||||
|
|
||||||
|
GdkEvent event;
|
||||||
|
event.type = GDK_BUTTON_RELEASE;
|
||||||
|
event.button.x = wx;
|
||||||
|
event.button.y = wy;
|
||||||
|
|
||||||
|
jack_nframes_t where = event_frame (&event, 0, 0);
|
||||||
|
temporal_zoom_to_frame (true, where);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
scroll_tracks_up_line ();
|
scroll_tracks_up_line ();
|
||||||
return true;
|
return true;
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case GDK_SCROLL_DOWN:
|
case GDK_SCROLL_DOWN:
|
||||||
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
|
||||||
|
//if (ev->state == GDK_CONTROL_MASK) {
|
||||||
|
track_canvas.get_pointer (x, y);
|
||||||
|
track_canvas.window_to_world (x, y, wx, wy);
|
||||||
|
wx += horizontal_adjustment.get_value();
|
||||||
|
wy += vertical_adjustment.get_value();
|
||||||
|
|
||||||
|
GdkEvent event;
|
||||||
|
event.type = GDK_BUTTON_RELEASE;
|
||||||
|
event.button.x = wx;
|
||||||
|
event.button.y = wy;
|
||||||
|
|
||||||
|
jack_nframes_t where = event_frame (&event, 0, 0);
|
||||||
|
temporal_zoom_to_frame (false, where);
|
||||||
|
return true;
|
||||||
|
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
|
||||||
|
if (clicked_trackview) {
|
||||||
|
if (!current_stepping_trackview) {
|
||||||
|
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
|
||||||
|
current_stepping_trackview = clicked_trackview;
|
||||||
|
}
|
||||||
|
gettimeofday (&last_track_height_step_timestamp, 0);
|
||||||
|
current_stepping_trackview->step_height (true);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
scroll_tracks_down_line ();
|
scroll_tracks_down_line ();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* no left/right handling yet */
|
/* no left/right handling yet */
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -875,24 +875,15 @@ AudioRegionView::region_sync_changed ()
|
||||||
|
|
||||||
Points points;
|
Points points;
|
||||||
|
|
||||||
points = sync_mark->property_points().get_value();
|
//points = sync_mark->property_points().get_value();
|
||||||
|
|
||||||
double offset = sync_offset / samples_per_unit;
|
double offset = sync_offset / samples_per_unit;
|
||||||
|
points.push_back (Gnome::Art::Point (offset - ((sync_mark_width-1)/2), 1));
|
||||||
points[0].set_x(offset - ((sync_mark_width-1)/2));
|
points.push_back (Gnome::Art::Point (offset + ((sync_mark_width-1)/2), 1));
|
||||||
points[0].set_y(1);
|
points.push_back (Gnome::Art::Point (offset, sync_mark_width - 1));
|
||||||
|
points.push_back (Gnome::Art::Point (offset - ((sync_mark_width-1)/2), 1));
|
||||||
points[1].set_x(offset + (sync_mark_width-1)/2);
|
sync_mark->property_points().set_value (points);
|
||||||
points[1].set_y(1);
|
|
||||||
|
|
||||||
points[2].set_x(offset);
|
|
||||||
points[2].set_y(sync_mark_width - 1);
|
|
||||||
|
|
||||||
points[3].set_x(offset - ((sync_mark_width-1)/2));
|
|
||||||
points[3].set_y(1);
|
|
||||||
|
|
||||||
sync_mark->show();
|
sync_mark->show();
|
||||||
sync_mark->property_points() = points;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue