make shift-scrollwheel work in any TimeAxisView
git-svn-id: svn://localhost/ardour2/trunk@1230 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8adae13ad3
commit
434f3e6296
|
@ -2284,18 +2284,11 @@ Editor::get_state ()
|
|||
TimeAxisView *
|
||||
Editor::trackview_by_y_position (double y)
|
||||
{
|
||||
TrackViewList::iterator iter;
|
||||
TimeAxisView *tv;
|
||||
for (TrackViewList::iterator iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
||||
|
||||
for (iter = track_views.begin(); iter != track_views.end(); ++iter) {
|
||||
TimeAxisView *tv;
|
||||
|
||||
tv = *iter;
|
||||
|
||||
if (tv->hidden()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tv->y_position <= y && y < ((tv->y_position + tv->height + track_spacing))) {
|
||||
if ((tv = (*iter)->covers_y_position (y)) != 0) {
|
||||
return tv;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
|
||||
if (!current_stepping_trackview) {
|
||||
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
|
||||
if (!(current_stepping_trackview = dynamic_cast<AudioTimeAxisView*> (trackview_by_y_position (ev->y)))) {
|
||||
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
|||
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
|
||||
if (!current_stepping_trackview) {
|
||||
step_timeout = Glib::signal_timeout().connect (mem_fun(*this, &Editor::track_height_step_timeout), 500);
|
||||
if (!(current_stepping_trackview = dynamic_cast<AudioTimeAxisView*> (trackview_by_y_position (ev->y)))) {
|
||||
if (!(current_stepping_trackview = trackview_by_y_position (ev->y))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2705,6 +2705,8 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
void
|
||||
Editor::start_region_copy_grab (ArdourCanvas::Item* item, GdkEvent* event)
|
||||
{
|
||||
cerr << "start region copy grab, selected regions = " << selection->regions.size() << endl;
|
||||
|
||||
if (selection->regions.empty() || clicked_regionview == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1067,3 +1067,25 @@ TimeAxisView::color_handler (ColorID id, uint32_t val)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TimeAxisView*
|
||||
TimeAxisView::covers_y_position (double y)
|
||||
{
|
||||
if (hidden()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (y_position <= y && y < (y_position + height)) {
|
||||
return this;
|
||||
}
|
||||
|
||||
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
||||
TimeAxisView* tv;
|
||||
|
||||
if ((tv = (*i)->covers_y_position (y)) != 0) {
|
||||
return tv;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -159,6 +159,14 @@ class TimeAxisView : public virtual AxisView
|
|||
virtual void set_height (TrackHeight h);
|
||||
void reset_height();
|
||||
|
||||
/**
|
||||
* Returns a TimeAxisView* if this object covers y, or one of its children does.
|
||||
* If the covering object is a child axis, then the child is returned.
|
||||
* Returns 0 otherwise.
|
||||
*/
|
||||
|
||||
TimeAxisView* covers_y_position (double y);
|
||||
|
||||
/**
|
||||
* Steps through the defined heights for this TrackView.
|
||||
* Sets bigger to true to step up in size, set to fals eot step smaller.
|
||||
|
|
Loading…
Reference in New Issue
Block a user