+void
+Mixer_UI::move_stripable_into_view (boost::shared_ptr<ARDOUR::Stripable> s)
+{
+ if (!scroller.get_hscrollbar()) {
+ return;
+ }
+ if (s->presentation_info().special () || s->presentation_info().flag_match (PresentationInfo::VCA)) {
+ return;
+ }
+#ifdef MIXBUS
+ if (s->mixbus ()) {
+ return;
+ }
+#endif
+ bool found = false;
+ int x0 = 0;
+ Gtk::Allocation alloc;
+ for (list<MixerStrip *>::const_iterator i = strips.begin(); i != strips.end(); ++i) {
+ if ((*i)->route() == s) {
+ int y;
+ found = true;
+ (*i)->translate_coordinates (strip_packer, 0, 0, x0, y);
+ alloc = (*i)->get_allocation ();
+ break;
+ }
+ }
+ if (!found) {
+ return;
+ }
+
+ Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
+
+ if (x0 < adj->get_value()) {
+ adj->set_value (max (adj->get_lower(), min (adj->get_upper(), (double) x0)));
+ } else if (x0 + alloc.get_width() >= adj->get_value() + adj->get_page_size()) {
+ int x1 = x0 + alloc.get_width() - adj->get_page_size();
+ adj->set_value (max (adj->get_lower(), min (adj->get_upper(), (double) x1)));
+ }
+}
+