13
0

Tweak semantics for coloring regions

* Shade muted regions only when they are not selected, nor
  being dragged.
* Selecting and Dragging a region adds alpha, so that
  underlying regions and the grid become visible.
* record-red trumps.
This commit is contained in:
Robin Gareus 2019-09-26 18:57:35 +02:00
parent 55d85caa7e
commit 973e9ad132
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -74,8 +74,6 @@
#include "pbd/i18n.h" #include "pbd/i18n.h"
#define MUTED_ALPHA 48
using namespace std; using namespace std;
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
@ -1564,34 +1562,37 @@ AudioRegionView::set_waveform_colors ()
void void
AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& waves_to_color) AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& waves_to_color)
{ {
Gtkmm2ext::Color fill; Gtkmm2ext::Color fill = fill_color;
Gtkmm2ext::Color outline; Gtkmm2ext::Color outline = fill;
Gtkmm2ext::Color clip = UIConfiguration::instance().color ("clipped waveform"); Gtkmm2ext::Color clip = UIConfiguration::instance().color ("clipped waveform");
Gtkmm2ext::Color zero = UIConfiguration::instance().color ("zero line"); Gtkmm2ext::Color zero = UIConfiguration::instance().color ("zero line");
/* use track/region color to fill wform */
fill = fill_color;
fill = UINT_INTERPOLATE (fill, UIConfiguration::instance().color ("waveform fill"), 0.5);
/* set outline */
outline = fill;
if (_selected) { if (_selected) {
if (_region->muted()) { outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0xC0);
/* hide outline with zero alpha */ fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0xC0);
outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0); } else if (_dragging) {
fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform fill"), MUTED_ALPHA); outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0xC0);
} else { fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 0xC0);
outline = UIConfiguration::instance().color ("selected waveform outline"); } else if (_region->muted()) {
fill = UIConfiguration::instance().color ("selected waveform fill"); outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 80);
} fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 0);
} else { } else if (!_region->opaque()) {
if (_recregion) { outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 70);
outline = UIConfiguration::instance().color ("recording waveform outline"); fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 70);
fill = UIConfiguration::instance().color ("recording waveform fill"); }
} else {
if (_region->muted()) { /* recorded region, override to red */
/* hide outline with zero alpha */ if (_recregion) {
outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0); outline = UIConfiguration::instance().color ("recording waveform outline");
fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), MUTED_ALPHA); fill = UIConfiguration::instance().color ("recording waveform fill");
} else {
outline = UIConfiguration::instance().color ("waveform outline");
fill = UIConfiguration::instance().color ("waveform fill");
}
}
} }
for (vector<ArdourWaveView::WaveView*>::iterator w = waves_to_color.begin(); w != waves_to_color.end(); ++w) { for (vector<ArdourWaveView::WaveView*>::iterator w = waves_to_color.begin(); w != waves_to_color.end(); ++w) {