diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-06-17 01:29:00 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:29 -0500 |
commit | 93dd5414d698b8f8d952ccee7ccbe98804671edb (patch) | |
tree | 606d5dbef1b70512ec75799cff65c6b11e0f9294 /libs/surfaces/push2/buttons.cc | |
parent | c6faede00c211b60a894ec0614cb90d363d17a12 (diff) |
beginning of stripable control; solo+mute mostly operational
Diffstat (limited to 'libs/surfaces/push2/buttons.cc')
-rw-r--r-- | libs/surfaces/push2/buttons.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index b2312c4052..b009b148ff 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -1,8 +1,29 @@ +/* + Copyright (C) 2016 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ardour/mute_control.h" #include "ardour/session.h" +#include "ardour/solo_control.h" #include "push2.h" using namespace ArdourSurface; +using namespace ARDOUR; void Push2::button_play () @@ -106,3 +127,41 @@ Push2::button_shift_release () modifier_state = ModifierState (modifier_state & ~ModShift); } +void +Push2::button_browse () +{ + switch_bank (max (0, bank_start - 8)); +} + +void +Push2::button_clip () +{ + switch_bank (max (0, bank_start + 8)); +} + +void +Push2::button_upper (uint32_t n) +{ + if (!stripable[n]) { + return; + } + + boost::shared_ptr<SoloControl> sc = stripable[n]->solo_control (); + if (sc) { + sc->set_value (!sc->get_value(), PBD::Controllable::UseGroup); + } +} + +void +Push2::button_lower (uint32_t n) +{ + if (!stripable[n]) { + return; + } + + boost::shared_ptr<MuteControl> mc = stripable[n]->mute_control (); + + if (mc) { + mc->set_value (!mc->get_value(), PBD::Controllable::UseGroup); + } +} |