2016-07-10 10:49:39 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
* Copyright (C) 2016-2018 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
#include <cairomm/region.h>
|
2016-07-10 10:49:39 -04:00
|
|
|
#include <pangomm/layout.h>
|
|
|
|
|
|
|
|
#include "pbd/compose.h"
|
|
|
|
#include "pbd/convert.h"
|
|
|
|
#include "pbd/debug.h"
|
|
|
|
#include "pbd/failed_constructor.h"
|
|
|
|
#include "pbd/file_utils.h"
|
|
|
|
#include "pbd/search_path.h"
|
|
|
|
#include "pbd/enumwriter.h"
|
|
|
|
|
|
|
|
#include "midi++/parser.h"
|
2017-09-24 12:57:27 -04:00
|
|
|
|
2017-09-24 12:03:54 -04:00
|
|
|
#include "temporal/time.h"
|
|
|
|
#include "temporal/bbt_time.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
|
|
|
|
#include "ardour/async_midi_port.h"
|
|
|
|
#include "ardour/audioengine.h"
|
|
|
|
#include "ardour/debug.h"
|
|
|
|
#include "ardour/filesystem_paths.h"
|
|
|
|
#include "ardour/midiport_manager.h"
|
|
|
|
#include "ardour/midi_track.h"
|
|
|
|
#include "ardour/midi_port.h"
|
2020-10-17 21:10:19 -04:00
|
|
|
#include "ardour/selection.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/tempo.h"
|
2016-09-21 20:25:36 -04:00
|
|
|
#include "ardour/utils.h"
|
2016-07-11 14:41:57 -04:00
|
|
|
#include "ardour/vca_manager.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2017-07-17 12:34:35 -04:00
|
|
|
#include "gtkmm2ext/colors.h"
|
2016-09-22 15:24:02 -04:00
|
|
|
#include "canvas/line.h"
|
2016-09-23 16:24:45 -04:00
|
|
|
#include "canvas/rectangle.h"
|
|
|
|
#include "canvas/text.h"
|
2016-07-11 10:02:35 -04:00
|
|
|
|
2016-07-12 07:46:30 -04:00
|
|
|
#include "gtkmm2ext/gui_thread.h"
|
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
#include "canvas.h"
|
2016-07-11 10:02:35 -04:00
|
|
|
#include "knob.h"
|
2016-09-25 19:29:30 -04:00
|
|
|
#include "level_meter.h"
|
|
|
|
#include "mix.h"
|
2016-07-11 10:02:35 -04:00
|
|
|
#include "push2.h"
|
|
|
|
#include "utils.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-07-15 00:06:10 -04:00
|
|
|
#include "pbd/i18n.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-28 17:24:14 -04:00
|
|
|
#ifdef __APPLE__
|
|
|
|
#define Rect ArdourCanvas::Rect
|
|
|
|
#endif
|
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace PBD;
|
|
|
|
using namespace Glib;
|
|
|
|
using namespace ArdourSurface;
|
2017-07-17 12:34:35 -04:00
|
|
|
using namespace Gtkmm2ext;
|
2016-09-16 09:39:28 -04:00
|
|
|
using namespace ArdourCanvas;
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-27 15:31:17 -04:00
|
|
|
MixLayout::MixLayout (Push2& p, Session & s, std::string const & name)
|
|
|
|
: Push2Layout (p, s, name)
|
2021-06-18 16:33:32 -04:00
|
|
|
, _bank_start (0)
|
|
|
|
, _vpot_mode (Volume)
|
2016-07-10 10:49:39 -04:00
|
|
|
{
|
2016-09-22 15:24:02 -04:00
|
|
|
/* background */
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_bg = new ArdourCanvas::Rectangle (this);
|
|
|
|
_bg->set (Rect (0, 0, display_width(), display_height()));
|
|
|
|
_bg->set_fill_color (_p2.get_color (Push2::DarkBackground));
|
2016-09-22 15:24:02 -04:00
|
|
|
|
|
|
|
/* upper line */
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_upper_line = new Line (this);
|
|
|
|
_upper_line->set (Duple (0, 22.5), Duple (display_width(), 22.5));
|
|
|
|
_upper_line->set_outline_color (_p2.get_color (Push2::LightBackground));
|
2016-09-16 09:39:28 -04:00
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
Pango::FontDescription fd2 ("Sans 10");
|
2016-09-25 19:29:30 -04:00
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
for (int n = 0; n < 8; ++n) {
|
2016-09-19 17:11:22 -04:00
|
|
|
|
|
|
|
/* background for text labels for knob function */
|
|
|
|
|
2016-09-29 07:56:10 -04:00
|
|
|
ArdourCanvas::Rectangle* r = new ArdourCanvas::Rectangle (this);
|
2016-09-19 17:11:22 -04:00
|
|
|
Coord x0 = 10 + (n*Push2Canvas::inter_button_spacing()) - 5;
|
|
|
|
r->set (Rect (x0, 2, x0 + Push2Canvas::inter_button_spacing(), 2 + 21));
|
2021-06-18 16:33:32 -04:00
|
|
|
_upper_backgrounds.push_back (r);
|
2016-09-22 15:24:02 -04:00
|
|
|
|
2016-09-29 07:56:10 -04:00
|
|
|
r = new ArdourCanvas::Rectangle (this);
|
2016-09-22 15:24:02 -04:00
|
|
|
r->set (Rect (x0, 137, x0 + Push2Canvas::inter_button_spacing(), 137 + 21));
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_backgrounds.push_back (r);
|
2016-09-19 17:11:22 -04:00
|
|
|
|
|
|
|
/* text labels for knob function*/
|
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
Text* t = new Text (this);
|
|
|
|
t->set_font_description (fd2);
|
2021-06-18 16:33:32 -04:00
|
|
|
t->set_color (_p2.get_color (Push2::ParameterName));
|
2016-09-19 17:11:22 -04:00
|
|
|
t->set_position (Duple (10 + (n*Push2Canvas::inter_button_spacing()), 5));
|
2016-07-11 10:02:35 -04:00
|
|
|
|
2021-06-18 20:31:35 -04:00
|
|
|
std::string txt;
|
2016-07-11 10:02:35 -04:00
|
|
|
switch (n) {
|
|
|
|
case 0:
|
|
|
|
txt = _("Volumes");
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
txt = _("Pans");
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
txt = _("Pan Widths");
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
txt = _("A Sends");
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
txt = _("B Sends");
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
txt = _("C Sends");
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
txt = _("D Sends");
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
txt = _("E Sends");
|
|
|
|
break;
|
|
|
|
}
|
2016-09-16 09:39:28 -04:00
|
|
|
t->set (txt);
|
2021-06-18 16:33:32 -04:00
|
|
|
_upper_text.push_back (t);
|
2016-07-11 10:02:35 -04:00
|
|
|
|
2016-09-25 19:29:30 -04:00
|
|
|
/* GainMeters */
|
2016-09-16 09:39:28 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
gain_meter[n] = new GainMeter (this, _p2);
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[n]->set_position (Duple (40 + (n * Push2Canvas::inter_button_spacing()), 95));
|
2016-09-19 17:11:22 -04:00
|
|
|
|
|
|
|
/* stripable names */
|
|
|
|
|
|
|
|
t = new Text (this);
|
|
|
|
t->set_font_description (fd2);
|
2021-06-18 16:33:32 -04:00
|
|
|
t->set_color (_p2.get_color (Push2::ParameterName));
|
2016-09-19 17:11:22 -04:00
|
|
|
t->set_position (Duple (10 + (n*Push2Canvas::inter_button_spacing()), 140));
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_text.push_back (t);
|
2016-09-19 17:11:22 -04:00
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_mode_button = _p2.button_by_id (Push2::Upper1);
|
2016-07-11 14:41:57 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_session.RouteAdded.connect (_session_connections, invalidator(*this), boost::bind (&MixLayout::stripables_added, this), &_p2);
|
|
|
|
_session.vca_manager().VCAAdded.connect (_session_connections, invalidator (*this), boost::bind (&MixLayout::stripables_added, this), &_p2);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
MixLayout::~MixLayout ()
|
|
|
|
{
|
2016-09-16 09:39:28 -04:00
|
|
|
// Item destructor deletes all children
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-09-16 09:39:28 -04:00
|
|
|
MixLayout::show ()
|
2016-07-11 13:13:04 -04:00
|
|
|
{
|
2016-09-22 15:24:02 -04:00
|
|
|
Push2::ButtonID upper_buttons[] = { Push2::Upper1, Push2::Upper2, Push2::Upper3, Push2::Upper4,
|
|
|
|
Push2::Upper5, Push2::Upper6, Push2::Upper7, Push2::Upper8 };
|
2016-09-16 09:39:28 -04:00
|
|
|
|
2016-09-22 15:24:02 -04:00
|
|
|
|
|
|
|
for (size_t n = 0; n < sizeof (upper_buttons) / sizeof (upper_buttons[0]); ++n) {
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Push2::Button> b = _p2.button_by_id (upper_buttons[n]);
|
2016-09-22 15:24:02 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (b != _mode_button) {
|
2016-09-22 15:24:02 -04:00
|
|
|
b->set_color (Push2::LED::DarkGray);
|
|
|
|
} else {
|
|
|
|
b->set_color (Push2::LED::White);
|
|
|
|
}
|
|
|
|
b->set_state (Push2::LED::OneShot24th);
|
2021-06-18 16:33:32 -04:00
|
|
|
_p2.write (b->state_msg());
|
2016-09-22 15:24:02 -04:00
|
|
|
}
|
2016-07-11 13:13:04 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
switch_bank (_bank_start);
|
2016-09-22 15:24:02 -04:00
|
|
|
|
|
|
|
Container::show ();
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
void
|
|
|
|
MixLayout::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) const
|
2016-07-10 10:49:39 -04:00
|
|
|
{
|
2016-09-22 15:24:02 -04:00
|
|
|
Container::render (area, context);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_upper (uint32_t n)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Push2::Button> b;
|
2016-07-11 13:13:04 -04:00
|
|
|
switch (n) {
|
|
|
|
case 0:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Volume;
|
|
|
|
b = _p2.button_by_id (Push2::Upper1);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 1:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = PanAzimuth;
|
|
|
|
b = _p2.button_by_id (Push2::Upper2);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 2:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = PanWidth;
|
|
|
|
b = _p2.button_by_id (Push2::Upper3);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Send1;
|
|
|
|
b = _p2.button_by_id (Push2::Upper4);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 4:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Send2;
|
|
|
|
b = _p2.button_by_id (Push2::Upper5);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 5:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Send3;
|
|
|
|
b = _p2.button_by_id (Push2::Upper6);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 6:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Send4;
|
|
|
|
b = _p2.button_by_id (Push2::Upper7);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case 7:
|
2021-06-18 16:33:32 -04:00
|
|
|
_vpot_mode = Send5;
|
|
|
|
b = _p2.button_by_id (Push2::Upper8);
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (b != _mode_button) {
|
|
|
|
_mode_button->set_color (Push2::LED::Black);
|
|
|
|
_mode_button->set_state (Push2::LED::OneShot24th);
|
|
|
|
_p2.write (_mode_button->state_msg());
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_mode_button = b;
|
2016-07-11 13:13:04 -04:00
|
|
|
|
|
|
|
show_vpot_mode ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::show_vpot_mode ()
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_mode_button->set_color (Push2::LED::White);
|
|
|
|
_mode_button->set_state (Push2::LED::OneShot24th);
|
|
|
|
_p2.write (_mode_button->state_msg());
|
2016-07-11 13:13:04 -04:00
|
|
|
|
2016-09-19 17:11:22 -04:00
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
_upper_backgrounds[s]->hide ();
|
|
|
|
_upper_text[s]->set_color (_p2.get_color (Push2::ParameterName));
|
2016-09-19 17:11:22 -04:00
|
|
|
}
|
|
|
|
|
2016-09-22 15:24:02 -04:00
|
|
|
uint32_t n = 0;
|
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AutomationControl> ac;
|
2021-06-18 16:33:32 -04:00
|
|
|
switch (_vpot_mode) {
|
2016-07-11 13:13:04 -04:00
|
|
|
case Volume:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->gain_control());
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<PeakMeter> pm = _stripable[s]->peak_meter();
|
2016-09-25 19:29:30 -04:00
|
|
|
if (pm) {
|
|
|
|
gain_meter[s]->meter->set_meter (pm.get());
|
|
|
|
} else {
|
|
|
|
gain_meter[s]->meter->set_meter (0);
|
|
|
|
}
|
2016-07-11 13:13:04 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->meter->set_meter (0);
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->show ();
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 0;
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case PanAzimuth:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->pan_azimuth_control());
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->add_flag (Push2Knob::ArcToZero);
|
2016-07-11 13:13:04 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 13:13:04 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 1;
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
|
|
|
case PanWidth:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->pan_width_control());
|
2016-07-11 13:13:04 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 2;
|
2016-07-11 13:13:04 -04:00
|
|
|
break;
|
2016-07-11 14:41:57 -04:00
|
|
|
case Send1:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->send_level_controllable (0));
|
2016-07-11 14:41:57 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 3;
|
2016-07-11 14:41:57 -04:00
|
|
|
break;
|
|
|
|
case Send2:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->send_level_controllable (1));
|
2016-07-11 14:41:57 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 4;
|
2016-07-11 14:41:57 -04:00
|
|
|
break;
|
|
|
|
case Send3:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->send_level_controllable (2));
|
2016-07-11 14:41:57 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 5;
|
2016-07-11 14:41:57 -04:00
|
|
|
break;
|
|
|
|
case Send4:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->send_level_controllable (3));
|
2016-07-11 14:41:57 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 6;
|
2016-07-11 14:41:57 -04:00
|
|
|
break;
|
|
|
|
case Send5:
|
|
|
|
for (int s = 0; s < 8; ++s) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[s]) {
|
|
|
|
gain_meter[s]->knob->set_controllable (_stripable[s]->send_level_controllable (4));
|
2016-07-11 14:41:57 -04:00
|
|
|
} else {
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[s]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
gain_meter[s]->knob->remove_flag (Push2Knob::ArcToZero);
|
|
|
|
gain_meter[s]->meter->hide ();
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
n = 7;
|
2016-07-11 14:41:57 -04:00
|
|
|
break;
|
2016-07-11 13:13:04 -04:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2016-09-22 15:24:02 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_upper_backgrounds[n]->set_fill_color (_p2.get_color (Push2::ParameterName));
|
|
|
|
_upper_backgrounds[n]->set_outline_color (_p2.get_color (Push2::ParameterName));
|
|
|
|
_upper_backgrounds[n]->show ();
|
|
|
|
_upper_text[n]->set_color (contrasting_text_color (_p2.get_color (Push2::ParameterName)));
|
2016-07-11 13:13:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_mute ()
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = _session.selection().first_selected_stripable();
|
2016-07-11 13:13:04 -04:00
|
|
|
if (s) {
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AutomationControl> ac = s->mute_control();
|
2016-07-11 13:13:04 -04:00
|
|
|
if (ac) {
|
|
|
|
ac->set_value (!ac->get_value(), PBD::Controllable::UseGroup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_solo ()
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s = _session.selection().first_selected_stripable();
|
2016-07-11 13:13:04 -04:00
|
|
|
if (s) {
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AutomationControl> ac = s->solo_control();
|
2016-07-11 13:13:04 -04:00
|
|
|
if (ac) {
|
2021-06-18 16:33:32 -04:00
|
|
|
_session.set_control (ac, !ac->get_value(), PBD::Controllable::UseGroup);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_lower (uint32_t n)
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
if (!_stripable[n]) {
|
2016-07-10 10:49:39 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[n], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::strip_vpot (int n, int delta)
|
|
|
|
{
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Controllable> ac = gain_meter[n]->knob->controllable();
|
2016-07-11 13:13:04 -04:00
|
|
|
|
|
|
|
if (ac) {
|
2021-06-18 20:31:35 -04:00
|
|
|
ac->set_value (
|
|
|
|
ac->interface_to_internal (
|
|
|
|
std::min (ac->upper (),
|
|
|
|
std::max (ac->lower (),
|
|
|
|
ac->internal_to_interface (ac->get_value ()) +
|
|
|
|
(delta / 256.0)))),
|
|
|
|
PBD::Controllable::UseGroup);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::strip_vpot_touch (int n, bool touching)
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[n]) {
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AutomationControl> ac = _stripable[n]->gain_control();
|
2016-07-10 10:49:39 -04:00
|
|
|
if (ac) {
|
2021-06-18 16:33:32 -04:00
|
|
|
const timepos_t now (_session.audible_sample());
|
2016-07-10 10:49:39 -04:00
|
|
|
if (touching) {
|
2020-09-21 16:28:23 -04:00
|
|
|
ac->start_touch (now);
|
2016-07-10 10:49:39 -04:00
|
|
|
} else {
|
2020-09-21 16:28:23 -04:00
|
|
|
ac->stop_touch (now);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-09-19 17:11:22 -04:00
|
|
|
MixLayout::stripable_property_change (PropertyChange const& what_changed, uint32_t which)
|
2016-07-10 10:49:39 -04:00
|
|
|
{
|
2016-09-23 14:52:23 -04:00
|
|
|
if (what_changed.contains (Properties::color)) {
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_backgrounds[which]->set_fill_color (_stripable[which]->presentation_info().color());
|
2016-09-23 14:52:23 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[which]->is_selected()) {
|
|
|
|
_lower_text[which]->set_fill_color (contrasting_text_color (_stripable[which]->presentation_info().color()));
|
2016-09-23 14:52:23 -04:00
|
|
|
/* might not be a MIDI track, in which case this will
|
|
|
|
do nothing
|
|
|
|
*/
|
2021-06-18 16:33:32 -04:00
|
|
|
_p2.update_selection_color ();
|
2016-09-23 14:52:23 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-19 17:11:22 -04:00
|
|
|
if (what_changed.contains (Properties::hidden)) {
|
2021-06-18 16:33:32 -04:00
|
|
|
switch_bank (_bank_start);
|
2016-09-19 17:11:22 -04:00
|
|
|
}
|
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
if (what_changed.contains (Properties::selected)) {
|
2016-09-19 17:11:22 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (!_stripable[which]) {
|
2016-07-10 10:49:39 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[which]->is_selected()) {
|
2016-09-19 17:11:22 -04:00
|
|
|
show_selection (which);
|
2016-09-16 09:39:28 -04:00
|
|
|
} else {
|
2016-09-19 17:11:22 -04:00
|
|
|
hide_selection (which);
|
2016-09-16 09:39:28 -04:00
|
|
|
}
|
|
|
|
}
|
2016-09-19 17:11:22 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::show_selection (uint32_t n)
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_backgrounds[n]->show ();
|
|
|
|
_lower_backgrounds[n]->set_fill_color (_stripable[n]->presentation_info().color());
|
|
|
|
_lower_text[n]->set_color (contrasting_text_color (_lower_backgrounds[n]->fill_color()));
|
2016-09-19 17:11:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::hide_selection (uint32_t n)
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_backgrounds[n]->hide ();
|
|
|
|
if (_stripable[n]) {
|
|
|
|
_lower_text[n]->set_color (_stripable[n]->presentation_info().color());
|
2016-09-19 17:11:22 -04:00
|
|
|
}
|
2016-09-16 09:39:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::solo_changed (uint32_t n)
|
|
|
|
{
|
|
|
|
solo_mute_changed (n);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::mute_changed (uint32_t n)
|
|
|
|
{
|
|
|
|
solo_mute_changed (n);
|
|
|
|
}
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
void
|
|
|
|
MixLayout::solo_mute_changed (uint32_t n)
|
|
|
|
{
|
2021-06-18 20:31:35 -04:00
|
|
|
std::string shortname = short_version (_stripable[n]->name(), 10);
|
|
|
|
std::string text;
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<AutomationControl> ac;
|
2021-06-18 16:33:32 -04:00
|
|
|
ac = _stripable[n]->solo_control();
|
2016-09-16 09:39:28 -04:00
|
|
|
if (ac && ac->get_value()) {
|
|
|
|
text += "* ";
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<MuteControl> mc;
|
2021-06-18 16:33:32 -04:00
|
|
|
mc = _stripable[n]->mute_control ();
|
2016-09-16 09:39:28 -04:00
|
|
|
if (mc) {
|
|
|
|
if (mc->muted_by_self_or_masters()) {
|
|
|
|
text += "! ";
|
|
|
|
} else if (mc->muted_by_others_soloing()) {
|
|
|
|
text += "- "; // it would be nice to use Unicode mute"\uD83D\uDD07 ";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
text += shortname;
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_text[n]->set (text);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::switch_bank (uint32_t base)
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_stripable_connections.drop_connections ();
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-07-11 14:41:57 -04:00
|
|
|
/* work backwards so we can tell if we should actually switch banks */
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Stripable> s[8];
|
2016-09-19 17:11:22 -04:00
|
|
|
uint32_t different = 0;
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
for (int n = 0; n < 8; ++n) {
|
2021-06-18 16:33:32 -04:00
|
|
|
s[n] = _session.get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
|
|
|
|
if (s[n] != _stripable[n]) {
|
2016-09-19 17:11:22 -04:00
|
|
|
different++;
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
|
|
|
}
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-19 17:11:22 -04:00
|
|
|
if (!s[0]) {
|
|
|
|
/* not even the first stripable exists, do nothing */
|
2016-10-17 15:58:30 -04:00
|
|
|
for (int n = 0; n < 8; ++n) {
|
2021-06-18 16:33:32 -04:00
|
|
|
_stripable[n].reset ();
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[n]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-10-17 15:58:30 -04:00
|
|
|
gain_meter[n]->meter->set_meter (0);
|
|
|
|
}
|
2016-07-10 10:49:39 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-07-11 14:41:57 -04:00
|
|
|
for (int n = 0; n < 8; ++n) {
|
2021-06-18 16:33:32 -04:00
|
|
|
_stripable[n] = s[n];
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-07-11 14:41:57 -04:00
|
|
|
/* at least one stripable in this bank */
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_bank_start = base;
|
2016-07-10 10:49:39 -04:00
|
|
|
|
|
|
|
for (int n = 0; n < 8; ++n) {
|
2016-09-22 15:24:02 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (!_stripable[n]) {
|
|
|
|
_lower_text[n]->hide ();
|
2016-09-19 17:11:22 -04:00
|
|
|
hide_selection (n);
|
2023-02-16 18:33:28 -05:00
|
|
|
gain_meter[n]->knob->set_controllable (std::shared_ptr<AutomationControl>());
|
2016-10-17 15:58:30 -04:00
|
|
|
gain_meter[n]->meter->set_meter (0);
|
2016-09-22 15:24:02 -04:00
|
|
|
} else {
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_lower_text[n]->show ();
|
2016-09-16 09:39:28 -04:00
|
|
|
|
2016-09-22 15:24:02 -04:00
|
|
|
/* stripable goes away? refill the bank, starting at the same point */
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
_stripable[n]->DropReferences.connect (_stripable_connections, invalidator (*this), boost::bind (&MixLayout::switch_bank, this, _bank_start), &_p2);
|
|
|
|
_stripable[n]->presentation_info().PropertyChanged.connect (_stripable_connections, invalidator (*this), boost::bind (&MixLayout::stripable_property_change, this, _1, n), &_p2);
|
|
|
|
_stripable[n]->solo_control()->Changed.connect (_stripable_connections, invalidator (*this), boost::bind (&MixLayout::solo_changed, this, n), &_p2);
|
|
|
|
_stripable[n]->mute_control()->Changed.connect (_stripable_connections, invalidator (*this), boost::bind (&MixLayout::mute_changed, this, n), &_p2);
|
2016-09-16 09:39:28 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[n]->is_selected()) {
|
2016-09-22 15:24:02 -04:00
|
|
|
show_selection (n);
|
|
|
|
} else {
|
|
|
|
hide_selection (n);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* this will set lower text to the correct value (basically
|
|
|
|
the stripable name)
|
|
|
|
*/
|
|
|
|
|
|
|
|
solo_mute_changed (n);
|
2016-09-19 17:11:22 -04:00
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
gain_meter[n]->knob->set_text_color (_stripable[n]->presentation_info().color());
|
|
|
|
gain_meter[n]->knob->set_arc_start_color (_stripable[n]->presentation_info().color());
|
|
|
|
gain_meter[n]->knob->set_arc_end_color (_stripable[n]->presentation_info().color());
|
2016-09-22 15:24:02 -04:00
|
|
|
}
|
2016-09-19 17:11:22 -04:00
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<Push2::Button> b;
|
2016-07-11 10:02:35 -04:00
|
|
|
|
|
|
|
switch (n) {
|
|
|
|
case 0:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower1);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 1:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower2);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 2:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower3);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 3:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower4);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 4:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower5);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 5:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower6);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 6:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower7);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
case 7:
|
2021-06-18 16:33:32 -04:00
|
|
|
b = _p2.button_by_id (Push2::Lower8);
|
2016-07-11 10:02:35 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[n]) {
|
|
|
|
b->set_color (_p2.get_color_index (_stripable[n]->presentation_info().color()));
|
2016-09-22 15:24:02 -04:00
|
|
|
} else {
|
|
|
|
b->set_color (Push2::LED::Black);
|
|
|
|
}
|
|
|
|
|
2016-07-11 10:02:35 -04:00
|
|
|
b->set_state (Push2::LED::OneShot24th);
|
2021-06-18 16:33:32 -04:00
|
|
|
_p2.write (b->state_msg());
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
show_vpot_mode ();
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_right ()
|
|
|
|
{
|
2021-06-18 20:31:35 -04:00
|
|
|
switch_bank (std::max (0, _bank_start + 8));
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_left ()
|
|
|
|
{
|
2021-06-18 20:31:35 -04:00
|
|
|
switch_bank (std::max (0, _bank_start - 8));
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
2016-07-11 10:02:35 -04:00
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
void
|
|
|
|
MixLayout::button_select_press ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_select_release ()
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
if (!(_p2.modifier_state() & Push2::ModSelect)) {
|
2016-07-10 10:49:39 -04:00
|
|
|
/* somebody else used us as a modifier */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int selected = -1;
|
|
|
|
|
|
|
|
for (int n = 0; n < 8; ++n) {
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[n]) {
|
|
|
|
if (_stripable[n]->is_selected()) {
|
2016-07-10 10:49:39 -04:00
|
|
|
selected = n;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (selected < 0) {
|
|
|
|
|
|
|
|
/* no visible track selected, select first (if any) */
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_stripable[0]) {
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[0], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_p2.modifier_state() & Push2::ModShift) {
|
2016-07-10 10:49:39 -04:00
|
|
|
/* select prev */
|
|
|
|
|
|
|
|
if (selected == 0) {
|
|
|
|
/* current selected is leftmost ... cancel selection,
|
|
|
|
switch banks by one, and select leftmost
|
|
|
|
*/
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_bank_start != 0) {
|
|
|
|
_session.selection().clear_stripables ();
|
|
|
|
switch_bank (_bank_start - 1);
|
|
|
|
if (_stripable[0]) {
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[0], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* select prev, if any */
|
|
|
|
int n = selected - 1;
|
2021-06-18 16:33:32 -04:00
|
|
|
while (n >= 0 && !_stripable[n]) {
|
2016-07-10 10:49:39 -04:00
|
|
|
--n;
|
|
|
|
}
|
|
|
|
if (n >= 0) {
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[n], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* select next */
|
|
|
|
|
|
|
|
if (selected == 7) {
|
|
|
|
/* current selected is rightmost ... cancel selection,
|
|
|
|
switch banks by one, and select righmost
|
|
|
|
*/
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[selected], SelectionToggle);
|
2021-06-18 16:33:32 -04:00
|
|
|
switch_bank (_bank_start + 1);
|
|
|
|
if (_stripable[7]) {
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[7], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* select next, if any */
|
|
|
|
int n = selected + 1;
|
2021-06-18 16:33:32 -04:00
|
|
|
while (n < 8 && !_stripable[n]) {
|
2016-07-10 10:49:39 -04:00
|
|
|
++n;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (n != 8) {
|
2024-08-02 13:46:08 -04:00
|
|
|
_session.selection().select_stripable_and_maybe_group (_stripable[n], SelectionSet);
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-07-11 14:41:57 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::stripables_added ()
|
|
|
|
{
|
|
|
|
/* reload current bank */
|
2021-06-18 16:33:32 -04:00
|
|
|
switch_bank (_bank_start);
|
2016-07-11 14:41:57 -04:00
|
|
|
}
|
2016-09-21 16:25:44 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_down ()
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_p2.scroll_dn_1_track ();
|
2016-09-21 16:25:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::button_up ()
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
_p2.scroll_up_1_track ();
|
2016-09-21 16:25:44 -04:00
|
|
|
}
|
2016-09-25 19:29:30 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
MixLayout::update_meters ()
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
if (_vpot_mode != Volume) {
|
2016-09-25 19:29:30 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (uint32_t n = 0; n < 8; ++n) {
|
|
|
|
gain_meter[n]->meter->update_meters ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MixLayout::GainMeter::GainMeter (Item* parent, Push2& p2)
|
|
|
|
: Container (parent)
|
|
|
|
{
|
2018-09-02 13:23:36 -04:00
|
|
|
/* knob and meter become owned by their parent on the canvas */
|
|
|
|
|
2016-09-25 19:29:30 -04:00
|
|
|
knob = new Push2Knob (p2, this);
|
|
|
|
knob->set_radius (25);
|
|
|
|
/* leave position at (0,0) */
|
|
|
|
|
|
|
|
meter = new LevelMeter (p2, this, 90, ArdourCanvas::Meter::Vertical);
|
|
|
|
meter->set_position (Duple (40, -60));
|
|
|
|
}
|
2018-09-02 13:23:36 -04:00
|
|
|
|