X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fsurfaces%2Fpush2%2Fpush2.cc;h=77088587b43a7790ec8de33b85fd557c7fb85441;hb=0006f28511e6e763d4d5bc87d3b060a5df887f43;hp=fb33a916cb03178d61b564ce6bc3561e28082349;hpb=7594e7644ab2c3f7b697d518c5747d542b9edbdf;p=ardour.git diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index fb33a916cb..77088587b4 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -241,6 +241,7 @@ Push2::open () error << _("Cannot construct Canvas for display") << endmsg; libusb_release_interface (handle, 0x00); libusb_close (handle); + handle = 0; return -1; } @@ -366,7 +367,7 @@ Push2::init_buttons (bool startup) */ ButtonID buttons[] = { Mute, Solo, Master, Up, Right, Left, Down, Note, Session, Mix, AddTrack, Delete, Undo, - Metronome, Shift, Select, Play, RecordEnable, Automate, Repeat, Note, Session, DoubleLoop, + Metronome, Shift, Select, Play, RecordEnable, Automate, Repeat, Note, Session, Quantize, Duplicate, Browse, PageRight, PageLeft, OctaveUp, OctaveDown, Layout, Scale }; @@ -480,6 +481,11 @@ Push2::vblank () } } + if (_current_layout) { + _current_layout->update_meters (); + _current_layout->update_clocks (); + } + _canvas->vblank(); return true; @@ -1094,7 +1100,11 @@ Push2::other_vpot (int n, int delta) click_gain = session->click_gain(); if (click_gain) { boost::shared_ptr ac = click_gain->gain_control(); - ac->set_value (ac->interface_to_internal (ac->internal_to_interface (ac->get_value()) + (delta/128.0)), PBD::Controllable::UseGroup); + if (ac) { + ac->set_value (ac->interface_to_internal ( + min (ac->upper(), max (ac->lower(), ac->internal_to_interface (ac->get_value()) + (delta/256.0)))), + PBD::Controllable::UseGroup); + } } break; case 2: @@ -1102,7 +1112,9 @@ Push2::other_vpot (int n, int delta) if (master) { boost::shared_ptr ac = master->gain_control(); if (ac) { - ac->set_value (ac->interface_to_internal (ac->internal_to_interface (ac->get_value()) + (delta/128.0)), PBD::Controllable::UseGroup); + ac->set_value (ac->interface_to_internal ( + min (ac->upper(), max (ac->lower(), ac->internal_to_interface (ac->get_value()) + (delta/256.0)))), + PBD::Controllable::UseGroup); } } break;