Indicate unlinked send-panners in pan-widget #8024

This commit is contained in:
Robin Gareus 2020-04-24 00:51:29 +02:00
parent 37e6a701bd
commit 777f1ea3be
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 39 additions and 22 deletions

View File

@ -147,8 +147,8 @@ MonoPanner::on_expose_event (GdkEventExpose*)
o = colors.outline;
f = colors.fill;
t = colors.text;
b = colors.background;
pf = colors.pos_fill;
b = _send_mode ? colors.send_bg : colors.background;
pf = (_send_mode && !_panner_shell->is_linked_to_route()) ? colors.send_pan : colors.pos_fill;
po = colors.pos_outline;
if (_panner_shell->bypassed()) {
@ -160,9 +160,6 @@ MonoPanner::on_expose_event (GdkEventExpose*)
t = 0x606060ff;
}
if (_send_mode) {
b = UIConfiguration::instance().color ("send bg");
}
/* background */
context->set_source_rgba (UINT_RGBA_R_FLT(b), UINT_RGBA_G_FLT(b), UINT_RGBA_B_FLT(b), UINT_RGBA_A_FLT(b));
context->rectangle (0, 0, width, height);
@ -488,12 +485,14 @@ MonoPanner::on_key_press_event (GdkEventKey* ev)
void
MonoPanner::set_colors ()
{
colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
colors.outline = UIConfiguration::instance().color ("mono panner outline");
colors.text = UIConfiguration::instance().color ("mono panner text");
colors.background = UIConfiguration::instance().color ("mono panner bg");
colors.fill = UIConfiguration::instance().color_mod ("mono panner fill", "panner fill");
colors.outline = UIConfiguration::instance().color ("mono panner outline");
colors.text = UIConfiguration::instance().color ("mono panner text");
colors.background = UIConfiguration::instance().color ("mono panner bg");
colors.pos_outline = UIConfiguration::instance().color ("mono panner position outline");
colors.pos_fill = UIConfiguration::instance().color_mod ("mono panner position fill", "mono panner position fill");
colors.pos_fill = UIConfiguration::instance().color_mod ("mono panner position fill", "mono panner position fill");
colors.send_bg = UIConfiguration::instance().color ("send bg");
colors.send_pan = UIConfiguration::instance().color ("send pan");
}
void

View File

@ -84,6 +84,8 @@ private:
uint32_t background;
uint32_t pos_outline;
uint32_t pos_fill;
uint32_t send_bg;
uint32_t send_pan;
};
bool _dragging;

View File

@ -133,6 +133,9 @@ Panner2d::set_colors ()
colors.signal_fill = 0x4884a9bf; // 0.282, 0.517, 0.662, 0.75
colors.speaker_fill = 0x4884a9ff; // 0.282, 0.517, 0.662, 1.0
colors.text = 0x84c5e1e6; // 0.517, 0.772, 0.882, 0.9
colors.send_bg = UIConfiguration::instance().color ("send bg");
colors.send_pan = UIConfiguration::instance().color ("send pan");
}
void
@ -475,10 +478,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_rectangle (cr, event->area.x, event->area.y, event->area.width, event->area.height);
uint32_t bg = colors.background;
if (_send_mode) {
bg = UIConfiguration::instance().color ("send bg");
}
uint32_t bg = _send_mode ? colors.send_bg : colors.background;
if (!panner_shell->bypassed()) {
CSSRGBA(bg);
@ -598,7 +598,11 @@ Panner2d::on_expose_event (GdkEventExpose *event)
cairo_new_path (cr);
cairo_arc (cr, c.x, c.y, arc_radius, 0, 2.0 * M_PI);
CSSRGBA(colors.signal_fill);
if (_send_mode && !panner_shell->is_linked_to_route()) {
CSSRGBA(colors.send_pan);
} else {
CSSRGBA(colors.signal_fill);
}
cairo_fill_preserve (cr);
CSSRGBA(colors.signal_outline);
cairo_stroke (cr);

View File

@ -116,6 +116,8 @@ class Panner2d : public Gtk::DrawingArea
uint32_t signal_fill;
uint32_t speaker_fill;
uint32_t text;
uint32_t send_bg;
uint32_t send_pan;
};
static ColorScheme colors;

View File

@ -57,7 +57,10 @@ using namespace ARDOUR_UI_UTILS;
using PBD::Controllable;
StereoPanner::ColorScheme StereoPanner::colors[3];
bool StereoPanner::have_colors = false;
uint32_t StereoPanner::colors_send_bg;
uint32_t StereoPanner::colors_send_pan;
bool StereoPanner::have_colors = false;
Pango::AttrList StereoPanner::panner_font_attributes;
bool StereoPanner::have_font = false;
@ -174,6 +177,10 @@ StereoPanner::on_expose_event (GdkEventExpose*)
b = colors[state].background;
r = colors[state].rule;
if (_send_mode) {
b = colors_send_bg;
}
if (_panner_shell->bypassed()) {
b = 0x20202040;
f = 0x404040ff;
@ -182,12 +189,6 @@ StereoPanner::on_expose_event (GdkEventExpose*)
r = 0x606060ff;
}
if (_send_mode) {
b = UIConfiguration::instance().color ("send bg");
// b = rgba_from_style("SendStripBase",
// UINT_RGBA_R(b), UINT_RGBA_G(b), UINT_RGBA_B(b), 255,
// "fg");
}
/* background */
context->set_source_rgba (UINT_RGBA_R_FLT(b), UINT_RGBA_G_FLT(b), UINT_RGBA_B_FLT(b), UINT_RGBA_A_FLT(b));
@ -292,6 +293,10 @@ StereoPanner::on_expose_event (GdkEventExpose*)
context->rel_line_to (0.0, -pos_box_size); /* upper left */
context->close_path ();
if (_send_mode && !_panner_shell->is_linked_to_route()) {
f = colors_send_pan;
}
context->set_source_rgba (UINT_RGBA_R_FLT(o), UINT_RGBA_G_FLT(o), UINT_RGBA_B_FLT(o), UINT_RGBA_A_FLT(o));
context->stroke_preserve ();
context->set_source_rgba (UINT_RGBA_R_FLT(f), UINT_RGBA_G_FLT(f), UINT_RGBA_B_FLT(f), UINT_RGBA_A_FLT(f));
@ -692,6 +697,9 @@ StereoPanner::set_colors ()
colors[Inverted].text = UIConfiguration::instance().color ("stereo panner inverted text");
colors[Inverted].background = UIConfiguration::instance().color ("stereo panner inverted bg");
colors[Inverted].rule = UIConfiguration::instance().color ("stereo panner rule");
colors_send_bg = UIConfiguration::instance().color ("send bg");
colors_send_pan = UIConfiguration::instance().color ("send pan");
}
void

View File

@ -106,6 +106,8 @@ private:
static bool have_font;
static ColorScheme colors[3];
static uint32_t colors_send_bg;
static uint32_t colors_send_pan;
static void set_colors ();
static bool have_colors;
void color_handler ();