mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-21 14:16:31 +01:00
a slew of unconnected mostly minor tweaks to get Push2 support back to where it was...
... prior to using the canvas for the video screen
This commit is contained in:
parent
b835486170
commit
216ce7bcb8
7 changed files with 256 additions and 54 deletions
|
|
@ -165,8 +165,8 @@ public:
|
||||||
void raise (int);
|
void raise (int);
|
||||||
void lower_to_bottom ();
|
void lower_to_bottom ();
|
||||||
|
|
||||||
void hide ();
|
virtual void hide ();
|
||||||
void show ();
|
virtual void show ();
|
||||||
|
|
||||||
/** @return true if this item is visible (ie it will be rendered),
|
/** @return true if this item is visible (ie it will be rendered),
|
||||||
* otherwise false
|
* otherwise false
|
||||||
|
|
|
||||||
|
|
@ -582,3 +582,144 @@ Push2::button_mix_press ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string
|
||||||
|
Push2::button_name_by_id (ButtonID id)
|
||||||
|
{
|
||||||
|
switch (id) {
|
||||||
|
case TapTempo:
|
||||||
|
return "TapTempo";
|
||||||
|
case Metronome:
|
||||||
|
return "Metronome";
|
||||||
|
case Upper1:
|
||||||
|
return "Upper1";
|
||||||
|
case Upper2:
|
||||||
|
return "Upper2";
|
||||||
|
case Upper3:
|
||||||
|
return "Upper3";
|
||||||
|
case Upper4:
|
||||||
|
return "Upper4";
|
||||||
|
case Upper5:
|
||||||
|
return "Upper5";
|
||||||
|
case Upper6:
|
||||||
|
return "Upper6";
|
||||||
|
case Upper7:
|
||||||
|
return "Upper7";
|
||||||
|
case Upper8:
|
||||||
|
return "Upper8";
|
||||||
|
case Setup:
|
||||||
|
return "Setup";
|
||||||
|
case User:
|
||||||
|
return "User";
|
||||||
|
case Delete:
|
||||||
|
return "Delete";
|
||||||
|
case AddDevice:
|
||||||
|
return "AddDevice";
|
||||||
|
case Device:
|
||||||
|
return "Device";
|
||||||
|
case Mix:
|
||||||
|
return "Mix";
|
||||||
|
case Undo:
|
||||||
|
return "Undo";
|
||||||
|
case AddTrack:
|
||||||
|
return "AddTrack";
|
||||||
|
case Browse:
|
||||||
|
return "Browse";
|
||||||
|
case Clip:
|
||||||
|
return "Clip";
|
||||||
|
case Mute:
|
||||||
|
return "Mute";
|
||||||
|
case Solo:
|
||||||
|
return "Solo";
|
||||||
|
case Stop:
|
||||||
|
return "Stop";
|
||||||
|
case Lower1:
|
||||||
|
return "Lower1";
|
||||||
|
case Lower2:
|
||||||
|
return "Lower2";
|
||||||
|
case Lower3:
|
||||||
|
return "Lower3";
|
||||||
|
case Lower4:
|
||||||
|
return "Lower4";
|
||||||
|
case Lower5:
|
||||||
|
return "Lower5";
|
||||||
|
case Lower6:
|
||||||
|
return "Lower6";
|
||||||
|
case Lower7:
|
||||||
|
return "Lower7";
|
||||||
|
case Lower8:
|
||||||
|
return "Lower8";
|
||||||
|
case Master:
|
||||||
|
return "Master";
|
||||||
|
case Convert:
|
||||||
|
return "Convert";
|
||||||
|
case DoubleLoop:
|
||||||
|
return "DoubleLoop";
|
||||||
|
case Quantize:
|
||||||
|
return "Quantize";
|
||||||
|
case Duplicate:
|
||||||
|
return "Duplicate";
|
||||||
|
case New:
|
||||||
|
return "New";
|
||||||
|
case FixedLength:
|
||||||
|
return "FixedLength";
|
||||||
|
case Automate:
|
||||||
|
return "Automate";
|
||||||
|
case RecordEnable:
|
||||||
|
return "RecordEnable";
|
||||||
|
case Play:
|
||||||
|
return "Play";
|
||||||
|
case Fwd32ndT:
|
||||||
|
return "Fwd32ndT";
|
||||||
|
case Fwd32nd:
|
||||||
|
return "Fwd32nd";
|
||||||
|
case Fwd16thT:
|
||||||
|
return "Fwd16thT";
|
||||||
|
case Fwd16th:
|
||||||
|
return "Fwd16th";
|
||||||
|
case Fwd8thT:
|
||||||
|
return "Fwd8thT";
|
||||||
|
case Fwd8th:
|
||||||
|
return "Fwd8th";
|
||||||
|
case Fwd4trT:
|
||||||
|
return "Fwd4trT";
|
||||||
|
case Fwd4tr:
|
||||||
|
return "Fwd4tr";
|
||||||
|
case Up:
|
||||||
|
return "Up";
|
||||||
|
case Right:
|
||||||
|
return "Right";
|
||||||
|
case Down:
|
||||||
|
return "Down";
|
||||||
|
case Left:
|
||||||
|
return "Left";
|
||||||
|
case Repeat:
|
||||||
|
return "Repeat";
|
||||||
|
case Accent:
|
||||||
|
return "Accent";
|
||||||
|
case Scale:
|
||||||
|
return "Scale";
|
||||||
|
case Layout:
|
||||||
|
return "Layout";
|
||||||
|
case Note:
|
||||||
|
return "Note";
|
||||||
|
case Session:
|
||||||
|
return "Session";
|
||||||
|
case OctaveUp:
|
||||||
|
return "OctaveUp";
|
||||||
|
case PageRight:
|
||||||
|
return "PageRight";
|
||||||
|
case OctaveDown:
|
||||||
|
return "OctaveDown";
|
||||||
|
case PageLeft:
|
||||||
|
return "PageLeft";
|
||||||
|
case Shift:
|
||||||
|
return "Shift";
|
||||||
|
case Select:
|
||||||
|
return "Select";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "???";
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ Push2Canvas::request_redraw (Rect const & r)
|
||||||
cr.x = r.x0;
|
cr.x = r.x0;
|
||||||
cr.y = r.y0;
|
cr.y = r.y0;
|
||||||
cr.width = r.width();
|
cr.width = r.width();
|
||||||
cr.width = r.height();
|
cr.height = r.height();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::Push2, string_compose ("invalidate rect %1\n", r));
|
DEBUG_TRACE (DEBUG::Push2, string_compose ("invalidate rect %1\n", r));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,10 +72,20 @@ MixLayout::MixLayout (Push2& p, Session& s)
|
||||||
|
|
||||||
Pango::FontDescription fd2 ("Sans 10");
|
Pango::FontDescription fd2 ("Sans 10");
|
||||||
for (int n = 0; n < 8; ++n) {
|
for (int n = 0; n < 8; ++n) {
|
||||||
|
|
||||||
|
/* background for text labels for knob function */
|
||||||
|
|
||||||
|
Rectangle* r = new Rectangle (this);
|
||||||
|
Coord x0 = 10 + (n*Push2Canvas::inter_button_spacing()) - 5;
|
||||||
|
r->set (Rect (x0, 2, x0 + Push2Canvas::inter_button_spacing(), 2 + 21));
|
||||||
|
backgrounds.push_back (r);
|
||||||
|
|
||||||
|
/* text labels for knob function*/
|
||||||
|
|
||||||
Text* t = new Text (this);
|
Text* t = new Text (this);
|
||||||
upper_text.push_back (t);
|
|
||||||
t->set_font_description (fd2);
|
t->set_font_description (fd2);
|
||||||
t->set_color (p2.get_color (Push2::ParameterName));
|
t->set_color (p2.get_color (Push2::ParameterName));
|
||||||
|
t->set_position (Duple (10 + (n*Push2Canvas::inter_button_spacing()), 5));
|
||||||
|
|
||||||
string txt;
|
string txt;
|
||||||
switch (n) {
|
switch (n) {
|
||||||
|
|
@ -105,19 +115,22 @@ MixLayout::MixLayout (Push2& p, Session& s)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
t->set (txt);
|
t->set (txt);
|
||||||
|
upper_text.push_back (t);
|
||||||
|
|
||||||
t = new Text (this);
|
/* knobs */
|
||||||
lower_text.push_back (t);
|
|
||||||
t->set_font_description (fd2);
|
|
||||||
t->set_color (p2.get_color (Push2::ParameterName));
|
|
||||||
|
|
||||||
Rectangle* r = new Rectangle (this);
|
|
||||||
r->set (Rect (10 + (n*Push2Canvas::inter_button_spacing()) - 5, 2, Push2Canvas::inter_button_spacing(), 21));
|
|
||||||
backgrounds.push_back (r);
|
|
||||||
|
|
||||||
knobs[n] = new Push2Knob (p2, this);
|
knobs[n] = new Push2Knob (p2, this);
|
||||||
knobs[n]->set_position (Duple (60 + (n*Push2Canvas::inter_button_spacing()), 95));
|
knobs[n]->set_position (Duple (60 + (n*Push2Canvas::inter_button_spacing()), 95));
|
||||||
knobs[n]->set_radius (25);
|
knobs[n]->set_radius (25);
|
||||||
|
|
||||||
|
/* stripable names */
|
||||||
|
|
||||||
|
t = new Text (this);
|
||||||
|
t->set_font_description (fd2);
|
||||||
|
t->set_color (p2.get_color (Push2::ParameterName));
|
||||||
|
t->set_position (Duple (10 + (n*Push2Canvas::inter_button_spacing()), 140));
|
||||||
|
lower_text.push_back (t);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mode_button = p2.button_by_id (Push2::Upper1);
|
mode_button = p2.button_by_id (Push2::Upper1);
|
||||||
|
|
@ -134,7 +147,7 @@ MixLayout::~MixLayout ()
|
||||||
void
|
void
|
||||||
MixLayout::show ()
|
MixLayout::show ()
|
||||||
{
|
{
|
||||||
Item::show ();
|
Container::show ();
|
||||||
|
|
||||||
mode_button->set_color (Push2::LED::White);
|
mode_button->set_color (Push2::LED::White);
|
||||||
mode_button->set_state (Push2::LED::OneShot24th);
|
mode_button->set_state (Push2::LED::OneShot24th);
|
||||||
|
|
@ -148,15 +161,21 @@ MixLayout::render (Rect const& area, Cairo::RefPtr<Cairo::Context> context) cons
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Push2, string_compose ("mix render %1\n", area));
|
DEBUG_TRACE (DEBUG::Push2, string_compose ("mix render %1\n", area));
|
||||||
|
|
||||||
|
/* draw background */
|
||||||
|
|
||||||
set_source_rgb (context, p2.get_color (Push2::DarkBackground));
|
set_source_rgb (context, p2.get_color (Push2::DarkBackground));
|
||||||
context->rectangle (0, 0, display_width(), display_height());
|
context->rectangle (0, 0, display_width(), display_height());
|
||||||
context->fill ();
|
context->fill ();
|
||||||
|
|
||||||
|
/* draw line across top (below labels) */
|
||||||
|
|
||||||
context->move_to (0, 22.5);
|
context->move_to (0, 22.5);
|
||||||
context->line_to (display_width(), 22.5);
|
context->line_to (display_width(), 22.5);
|
||||||
context->set_line_width (1.0);
|
context->set_line_width (1.0);
|
||||||
context->stroke ();
|
context->stroke ();
|
||||||
|
|
||||||
|
/* show the kids ... */
|
||||||
|
|
||||||
render_children (area, context);
|
render_children (area, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,6 +236,11 @@ MixLayout::show_vpot_mode ()
|
||||||
mode_button->set_state (Push2::LED::OneShot24th);
|
mode_button->set_state (Push2::LED::OneShot24th);
|
||||||
p2.write (mode_button->state_msg());
|
p2.write (mode_button->state_msg());
|
||||||
|
|
||||||
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
backgrounds[s]->hide ();
|
||||||
|
upper_text[s]->set_color (p2.get_color (Push2::ParameterName));
|
||||||
|
}
|
||||||
|
|
||||||
boost::shared_ptr<AutomationControl> ac;
|
boost::shared_ptr<AutomationControl> ac;
|
||||||
switch (vpot_mode) {
|
switch (vpot_mode) {
|
||||||
case Volume:
|
case Volume:
|
||||||
|
|
@ -228,6 +252,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[0]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[0]->show ();
|
||||||
|
upper_text[0]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case PanAzimuth:
|
case PanAzimuth:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -239,6 +266,9 @@ MixLayout::show_vpot_mode ()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
backgrounds[1]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[1]->show ();
|
||||||
|
upper_text[1]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case PanWidth:
|
case PanWidth:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -250,6 +280,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[2]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[2]->show ();
|
||||||
|
upper_text[2]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case Send1:
|
case Send1:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -261,6 +294,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[3]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[3]->show ();
|
||||||
|
upper_text[3]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case Send2:
|
case Send2:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -272,6 +308,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[4]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[4]->show ();
|
||||||
|
upper_text[4]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case Send3:
|
case Send3:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -283,6 +322,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[5]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[5]->show ();
|
||||||
|
upper_text[5]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case Send4:
|
case Send4:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -294,6 +336,9 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[6]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[6]->show ();
|
||||||
|
upper_text[6]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
case Send5:
|
case Send5:
|
||||||
for (int s = 0; s < 8; ++s) {
|
for (int s = 0; s < 8; ++s) {
|
||||||
|
|
@ -305,12 +350,13 @@ MixLayout::show_vpot_mode ()
|
||||||
}
|
}
|
||||||
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
knobs[s]->remove_flag (Push2Knob::ArcToZero);
|
||||||
}
|
}
|
||||||
|
backgrounds[7]->set_fill_color (p2.get_color (Push2::ParameterName));
|
||||||
|
backgrounds[7]->show ();
|
||||||
|
upper_text[7]->set_color (contrasting_text_color (p2.get_color (Push2::ParameterName)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dirty = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -373,25 +419,44 @@ MixLayout::strip_vpot_touch (int n, bool touching)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MixLayout::stripable_property_change (PropertyChange const& what_changed, int which)
|
MixLayout::stripable_property_change (PropertyChange const& what_changed, uint32_t which)
|
||||||
{
|
{
|
||||||
|
if (what_changed.contains (Properties::hidden)) {
|
||||||
|
switch_bank (bank_start);
|
||||||
|
}
|
||||||
|
|
||||||
if (what_changed.contains (Properties::selected)) {
|
if (what_changed.contains (Properties::selected)) {
|
||||||
|
|
||||||
if (!stripable[which]) {
|
if (!stripable[which]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stripable[which]->presentation_info().selected()) {
|
if (stripable[which]->presentation_info().selected()) {
|
||||||
selection_bg->show ();
|
show_selection (which);
|
||||||
selection_bg->set_fill_color (stripable[which]->presentation_info().color());
|
|
||||||
selection_bg->set (Rect (10 + (which*Push2Canvas::inter_button_spacing()) - 5, 137,
|
|
||||||
10 + (which*Push2Canvas::inter_button_spacing()) - 5 + Push2Canvas::inter_button_spacing(),
|
|
||||||
137 + 21));
|
|
||||||
lower_text[which]->set_color (ArdourCanvas::contrasting_text_color (selection_bg->fill_color()));
|
|
||||||
} else {
|
} else {
|
||||||
selection_bg->hide ();
|
hide_selection (which);
|
||||||
lower_text[which]->set_color (stripable[which]->presentation_info().color());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MixLayout::show_selection (uint32_t n)
|
||||||
|
{
|
||||||
|
selection_bg->show ();
|
||||||
|
selection_bg->set_fill_color (stripable[n]->presentation_info().color());
|
||||||
|
const Coord x0 = 10 + (n * Push2Canvas::inter_button_spacing()) - 5;
|
||||||
|
selection_bg->set (Rect (x0, 137, x0 + Push2Canvas::inter_button_spacing(), 137 + 21));
|
||||||
|
lower_text[n]->set_color (ArdourCanvas::contrasting_text_color (selection_bg->fill_color()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MixLayout::hide_selection (uint32_t n)
|
||||||
|
{
|
||||||
|
selection_bg->hide ();
|
||||||
|
if (stripable[n]) {
|
||||||
|
lower_text[n]->set_color (stripable[n]->presentation_info().color());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -437,28 +502,24 @@ MixLayout::switch_bank (uint32_t base)
|
||||||
/* work backwards so we can tell if we should actually switch banks */
|
/* work backwards so we can tell if we should actually switch banks */
|
||||||
|
|
||||||
boost::shared_ptr<Stripable> s[8];
|
boost::shared_ptr<Stripable> s[8];
|
||||||
uint32_t old_empty = 0;
|
uint32_t different = 0;
|
||||||
uint32_t new_empty = 0;
|
|
||||||
|
|
||||||
for (int n = 0; n < 8; ++n) {
|
for (int n = 0; n < 8; ++n) {
|
||||||
if (!stripable[n]) {
|
|
||||||
old_empty++;
|
|
||||||
}
|
|
||||||
s[n] = session.get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
|
s[n] = session.get_remote_nth_stripable (base+n, PresentationInfo::Flag (PresentationInfo::Route|PresentationInfo::VCA));
|
||||||
if (!s[n]) {
|
if (s[n] != stripable[n]) {
|
||||||
new_empty++;
|
different++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((new_empty != 0) && (new_empty >= old_empty)) {
|
if (!different) {
|
||||||
/* some missing strips; new bank the same or more empty stripables than the old one, do
|
/* some missing strips; new bank the same or more empty stripables than the old one, do
|
||||||
nothing since we had already reached the end.
|
nothing since we had already reached the end.
|
||||||
*/
|
*/
|
||||||
for (int n = 0; n < 8; ++n) {
|
return;
|
||||||
upper_text[n]->hide ();
|
}
|
||||||
lower_text[n]->hide ();
|
|
||||||
backgrounds[n]->hide ();
|
if (!s[0]) {
|
||||||
}
|
/* not even the first stripable exists, do nothing */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -472,16 +533,12 @@ MixLayout::switch_bank (uint32_t base)
|
||||||
|
|
||||||
for (int n = 0; n < 8; ++n) {
|
for (int n = 0; n < 8; ++n) {
|
||||||
if (!stripable[n]) {
|
if (!stripable[n]) {
|
||||||
upper_text[n]->hide ();
|
|
||||||
lower_text[n]->hide ();
|
lower_text[n]->hide ();
|
||||||
backgrounds[n]->hide ();
|
hide_selection (n);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
upper_text[n]->show ();
|
|
||||||
lower_text[n]->show ();
|
lower_text[n]->show ();
|
||||||
backgrounds[n]->show ();
|
|
||||||
backgrounds[n]->set_fill_color (stripable[n]->presentation_info().color());
|
|
||||||
|
|
||||||
/* stripable goes away? refill the bank, starting at the same point */
|
/* stripable goes away? refill the bank, starting at the same point */
|
||||||
|
|
||||||
|
|
@ -490,6 +547,16 @@ MixLayout::switch_bank (uint32_t base)
|
||||||
stripable[n]->solo_control()->Changed.connect (stripable_connections, invalidator (*this), boost::bind (&MixLayout::solo_changed, this, 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);
|
stripable[n]->mute_control()->Changed.connect (stripable_connections, invalidator (*this), boost::bind (&MixLayout::mute_changed, this, n), &p2);
|
||||||
|
|
||||||
|
if (stripable[n]->presentation_info().selected()) {
|
||||||
|
show_selection (n);
|
||||||
|
} else {
|
||||||
|
hide_selection (n);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this will set lower text to the correct value (basically
|
||||||
|
the stripable name)
|
||||||
|
*/
|
||||||
|
|
||||||
solo_mute_changed (n);
|
solo_mute_changed (n);
|
||||||
|
|
||||||
Push2::Button* b;
|
Push2::Button* b;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ class MixLayout : public Push2Layout
|
||||||
void strip_vpot_touch (int, bool);
|
void strip_vpot_touch (int, bool);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable bool _dirty;
|
|
||||||
std::vector<ArdourCanvas::Text*> upper_text;
|
std::vector<ArdourCanvas::Text*> upper_text;
|
||||||
std::vector<ArdourCanvas::Text*> lower_text;
|
std::vector<ArdourCanvas::Text*> lower_text;
|
||||||
std::vector<ArdourCanvas::Rectangle*> backgrounds;
|
std::vector<ArdourCanvas::Rectangle*> backgrounds;
|
||||||
|
|
@ -73,7 +72,7 @@ class MixLayout : public Push2Layout
|
||||||
PBD::ScopedConnectionList session_connections;
|
PBD::ScopedConnectionList session_connections;
|
||||||
void stripables_added ();
|
void stripables_added ();
|
||||||
|
|
||||||
void stripable_property_change (PBD::PropertyChange const& what_changed, int which);
|
void stripable_property_change (PBD::PropertyChange const& what_changed, uint32_t which);
|
||||||
|
|
||||||
void switch_bank (uint32_t base);
|
void switch_bank (uint32_t base);
|
||||||
|
|
||||||
|
|
@ -91,6 +90,8 @@ class MixLayout : public Push2Layout
|
||||||
void solo_changed (uint32_t n);
|
void solo_changed (uint32_t n);
|
||||||
void mute_changed (uint32_t n);
|
void mute_changed (uint32_t n);
|
||||||
void solo_mute_changed (uint32_t n);
|
void solo_mute_changed (uint32_t n);
|
||||||
|
void show_selection (uint32_t n);
|
||||||
|
void hide_selection (uint32_t n);
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace */
|
} /* namespace */
|
||||||
|
|
|
||||||
|
|
@ -729,7 +729,7 @@ Push2::handle_midi_controller_message (MIDI::Parser&, MIDI::EventTwoBytes* ev)
|
||||||
void
|
void
|
||||||
Push2::handle_midi_note_on_message (MIDI::Parser& parser, MIDI::EventTwoBytes* ev)
|
Push2::handle_midi_note_on_message (MIDI::Parser& parser, MIDI::EventTwoBytes* ev)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Push2, string_compose ("Note On %1 (velocity %2)\n", (int) ev->note_number, (int) ev->velocity));
|
// DEBUG_TRACE (DEBUG::Push2, string_compose ("Note On %1 (velocity %2)\n", (int) ev->note_number, (int) ev->velocity));
|
||||||
|
|
||||||
if (ev->velocity == 0) {
|
if (ev->velocity == 0) {
|
||||||
handle_midi_note_off_message (parser, ev);
|
handle_midi_note_off_message (parser, ev);
|
||||||
|
|
@ -811,7 +811,7 @@ Push2::handle_midi_note_on_message (MIDI::Parser& parser, MIDI::EventTwoBytes* e
|
||||||
void
|
void
|
||||||
Push2::handle_midi_note_off_message (MIDI::Parser&, MIDI::EventTwoBytes* ev)
|
Push2::handle_midi_note_off_message (MIDI::Parser&, MIDI::EventTwoBytes* ev)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Push2, string_compose ("Note Off %1 (velocity %2)\n", (int) ev->note_number, (int) ev->velocity));
|
// DEBUG_TRACE (DEBUG::Push2, string_compose ("Note Off %1 (velocity %2)\n", (int) ev->note_number, (int) ev->velocity));
|
||||||
|
|
||||||
if (ev->note_number < 11) {
|
if (ev->note_number < 11) {
|
||||||
/* theoretically related to encoder touch start/end, but
|
/* theoretically related to encoder touch start/end, but
|
||||||
|
|
@ -1446,12 +1446,6 @@ Push2::stripable_selection_change (StripableNotificationListPtr selected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_pad_target) {
|
|
||||||
cerr << "new midi pad target " << new_pad_target->name() << endl;
|
|
||||||
} else {
|
|
||||||
cerr << "no midi pad target\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (current_midi_track == new_pad_target) {
|
if (current_midi_track == new_pad_target) {
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
return;
|
return;
|
||||||
|
|
@ -1465,7 +1459,6 @@ Push2::stripable_selection_change (StripableNotificationListPtr selected)
|
||||||
/* disconnect from pad port, if appropriate */
|
/* disconnect from pad port, if appropriate */
|
||||||
|
|
||||||
if (current_midi_track && pad_port) {
|
if (current_midi_track && pad_port) {
|
||||||
cerr << "Disconnect pads from " << current_midi_track->name() << endl;
|
|
||||||
current_midi_track->input()->disconnect (current_midi_track->input()->nth(0), pad_port->name(), this);
|
current_midi_track->input()->disconnect (current_midi_track->input()->nth(0), pad_port->name(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1474,7 +1467,6 @@ Push2::stripable_selection_change (StripableNotificationListPtr selected)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (new_pad_target && pad_port) {
|
if (new_pad_target && pad_port) {
|
||||||
cerr << "Reconnect pads to " << new_pad_target->name() << endl;
|
|
||||||
new_pad_target->input()->connect (new_pad_target->input()->nth (0), pad_port->name(), this);
|
new_pad_target->input()->connect (new_pad_target->input()->nth (0), pad_port->name(), this);
|
||||||
current_pad_target = new_pad_target;
|
current_pad_target = new_pad_target;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,7 @@ class Push2 : public ARDOUR::ControlProtocol
|
||||||
ModifierState modifier_state() const { return _modifier_state; }
|
ModifierState modifier_state() const { return _modifier_state; }
|
||||||
|
|
||||||
Button* button_by_id (ButtonID);
|
Button* button_by_id (ButtonID);
|
||||||
|
static std::string button_name_by_id (ButtonID);
|
||||||
|
|
||||||
void write (const MidiByteArray&);
|
void write (const MidiByteArray&);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue