diff options
author | Robin Gareus <robin@gareus.org> | 2019-09-26 18:57:35 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-09-26 18:57:35 +0200 |
commit | 973e9ad132b4a5665079ba0371e26365b9ea9247 (patch) | |
tree | 7d42ea1c05da00221b3e5a101f379f9c01624060 /gtk2_ardour/audio_region_view.cc | |
parent | 55d85caa7e1a4aaf02a7901ee0f1b4db84cfd32e (diff) |
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.
Diffstat (limited to 'gtk2_ardour/audio_region_view.cc')
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 8c546a6936..a74cf0ed4b 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -74,8 +74,6 @@ #include "pbd/i18n.h" -#define MUTED_ALPHA 48 - using namespace std; using namespace ARDOUR; using namespace PBD; @@ -1564,34 +1562,37 @@ AudioRegionView::set_waveform_colors () void AudioRegionView::set_some_waveform_colors (vector<ArdourWaveView::WaveView*>& waves_to_color) { - Gtkmm2ext::Color fill; - Gtkmm2ext::Color outline; + Gtkmm2ext::Color fill = fill_color; + Gtkmm2ext::Color outline = fill; + Gtkmm2ext::Color clip = UIConfiguration::instance().color ("clipped waveform"); 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 (_region->muted()) { - /* hide outline with zero alpha */ - outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0); - fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform fill"), MUTED_ALPHA); - } else { - outline = UIConfiguration::instance().color ("selected waveform outline"); - fill = UIConfiguration::instance().color ("selected waveform fill"); - } - } else { - if (_recregion) { - outline = UIConfiguration::instance().color ("recording waveform outline"); - fill = UIConfiguration::instance().color ("recording waveform fill"); - } else { - if (_region->muted()) { - /* hide outline with zero alpha */ - outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0); - fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), MUTED_ALPHA); - } else { - outline = UIConfiguration::instance().color ("waveform outline"); - fill = UIConfiguration::instance().color ("waveform fill"); - } - } + outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0xC0); + fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("selected waveform outline"), 0xC0); + } else if (_dragging) { + outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform outline"), 0xC0); + fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 0xC0); + } else if (_region->muted()) { + outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 80); + fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 0); + } else if (!_region->opaque()) { + outline = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 70); + fill = UINT_RGBA_CHANGE_A(UIConfiguration::instance().color ("waveform fill"), 70); + } + + /* recorded region, override to red */ + if (_recregion) { + outline = UIConfiguration::instance().color ("recording waveform outline"); + fill = UIConfiguration::instance().color ("recording waveform fill"); } for (vector<ArdourWaveView::WaveView*>::iterator w = waves_to_color.begin(); w != waves_to_color.end(); ++w) { |