mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
more work on midi cue editor automation line colors (when insensitive)
This commit is contained in:
parent
6009abfa75
commit
f81b700395
4 changed files with 33 additions and 17 deletions
|
|
@ -94,6 +94,7 @@ AutomationLine::AutomationLine (const string& name,
|
||||||
:_name (name)
|
:_name (name)
|
||||||
, _height (0)
|
, _height (0)
|
||||||
, _line_color_name ("automation line")
|
, _line_color_name ("automation line")
|
||||||
|
, _insensitive_line_color (0x0)
|
||||||
, _view_index_offset (0)
|
, _view_index_offset (0)
|
||||||
, alist (al)
|
, alist (al)
|
||||||
, _visible (Line)
|
, _visible (Line)
|
||||||
|
|
@ -147,11 +148,7 @@ AutomationLine::set_sensitive (bool yn)
|
||||||
{
|
{
|
||||||
_sensitive = yn;
|
_sensitive = yn;
|
||||||
|
|
||||||
if (yn) {
|
set_line_color (_line_color_name, _line_color_mod);
|
||||||
set_line_color (_line_color_name);
|
|
||||||
} else {
|
|
||||||
set_line_color (UIConfiguration::instance().color ("nonexistent"));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto & cp : control_points) {
|
for (auto & cp : control_points) {
|
||||||
if (yn) {
|
if (yn) {
|
||||||
|
|
@ -299,14 +296,15 @@ void
|
||||||
AutomationLine::set_line_color (string const & color_name, string color_mod)
|
AutomationLine::set_line_color (string const & color_name, string color_mod)
|
||||||
{
|
{
|
||||||
_line_color_name = color_name;
|
_line_color_name = color_name;
|
||||||
|
_line_color_mod = color_mod;
|
||||||
|
|
||||||
if (_sensitive) {
|
if (_sensitive) {
|
||||||
line->set_outline_color (UIConfiguration::instance().color (color_name));
|
line->set_outline_color (UIConfiguration::instance().color (color_name));
|
||||||
} else {
|
} else {
|
||||||
line->set_outline_color (UIConfiguration::instance().color (color_name + " insensitive"));
|
line->set_outline_color (_insensitive_line_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The fill color is used to shade the area under some
|
/* The fill color (and thus the color_mod) is used to shade the area under some
|
||||||
* automation lines
|
* automation lines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -331,16 +329,9 @@ AutomationLine::set_colors ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomationLine::set_line_color (uint32_t color)
|
AutomationLine::set_insensitive_line_color (uint32_t color)
|
||||||
{
|
{
|
||||||
line->set_outline_color (color);
|
_insensitive_line_color = color;
|
||||||
line->set_fill (false);
|
|
||||||
|
|
||||||
if (_control_points_inherit_color) {
|
|
||||||
for (auto & cp : control_points) {
|
|
||||||
cp->set_color ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ public:
|
||||||
guint32 height() const { return _height; }
|
guint32 height() const { return _height; }
|
||||||
|
|
||||||
void set_line_color (std::string const & color, std::string color_mode = std::string());
|
void set_line_color (std::string const & color, std::string color_mode = std::string());
|
||||||
void set_line_color (uint32_t color);
|
void set_insensitive_line_color (uint32_t color);
|
||||||
uint32_t get_line_color() const;
|
uint32_t get_line_color() const;
|
||||||
uint32_t get_line_fill_color() const;
|
uint32_t get_line_fill_color() const;
|
||||||
uint32_t get_line_selected_color() const;
|
uint32_t get_line_selected_color() const;
|
||||||
|
|
@ -195,6 +195,7 @@ protected:
|
||||||
guint32 _height;
|
guint32 _height;
|
||||||
std::string _line_color_name;
|
std::string _line_color_name;
|
||||||
std::string _line_color_mod;
|
std::string _line_color_mod;
|
||||||
|
uint32_t _insensitive_line_color;
|
||||||
uint32_t _view_index_offset;
|
uint32_t _view_index_offset;
|
||||||
std::shared_ptr<ARDOUR::AutomationList> alist;
|
std::shared_ptr<ARDOUR::AutomationList> alist;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,6 +280,28 @@ MidiCueView::swap_automation_channel (int new_channel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gtkmm2ext::Color
|
||||||
|
MidiCueView::line_color_for (Evoral::Parameter const & param)
|
||||||
|
{
|
||||||
|
UIConfiguration& uic (UIConfiguration::instance());
|
||||||
|
|
||||||
|
switch (param.type()) {
|
||||||
|
case MidiCCAutomation:
|
||||||
|
switch (param.id()) {
|
||||||
|
case MIDI_CTL_MSB_EXPRESSION:
|
||||||
|
return uic.color ("pianoroll: insensitive expression line");
|
||||||
|
case MIDI_CTL_MSB_MODWHEEL:
|
||||||
|
return uic.color ("pianoroll: insensitive modulation line");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MidiPitchBenderAutomation:
|
||||||
|
return uic.color ("pianoroll: insensitive bender line");
|
||||||
|
case MidiChannelPressureAutomation:
|
||||||
|
return uic.color ("pianoroll: insensitive pressure line");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0xff0000ff;
|
||||||
|
}
|
||||||
void
|
void
|
||||||
MidiCueView::update_automation_display (Evoral::Parameter const & param, SelectionOperation op)
|
MidiCueView::update_automation_display (Evoral::Parameter const & param, SelectionOperation op)
|
||||||
{
|
{
|
||||||
|
|
@ -349,6 +371,7 @@ MidiCueView::update_automation_display (Evoral::Parameter const & param, Selecti
|
||||||
ac->alist(),
|
ac->alist(),
|
||||||
ac->desc()));
|
ac->desc()));
|
||||||
line->set_sensitive (false);
|
line->set_sensitive (false);
|
||||||
|
line->set_insensitive_line_color (line_color_for (param));
|
||||||
|
|
||||||
AutomationDisplayState cad (ac, line, false);
|
AutomationDisplayState cad (ac, line, false);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,4 +125,5 @@ class MidiCueView : public MidiView
|
||||||
void unset_active_automation ();
|
void unset_active_automation ();
|
||||||
|
|
||||||
bool midi_canvas_group_event (GdkEvent*);
|
bool midi_canvas_group_event (GdkEvent*);
|
||||||
|
Gtkmm2ext::Color line_color_for (Evoral::Parameter const &);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue