mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-29 00:13:10 +01:00
change the way MIDI note colors are defined (2 3-point color ranges, one for selected, one for unselected); change default scroll action on selected midi notes to "fine" adjustment rather than "coarse" (now alt-scroll)
git-svn-id: svn://localhost/ardour2/branches/3.0@7302 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
806a22fefe
commit
db55b149eb
6 changed files with 68 additions and 39 deletions
|
|
@ -51,14 +51,20 @@
|
|||
<Option name="meter fill max" value="00fd5dff"/>
|
||||
<Option name="meter fill mid" value="73f9baff"/>
|
||||
<Option name="meter fill min" value="0000ffff"/>
|
||||
<Option name="midi meter fill min" value="effaa100"/>
|
||||
<Option name="midi meter fill clip" value="f83913ff"/>
|
||||
<Option name="midi meter fill mid" value="8fc78e00"/>
|
||||
<Option name="midi meter fill max" value="00f45600"/>
|
||||
<Option name="meter marker" value="f2425bff"/>
|
||||
<Option name="midi bus base" value="00000000"/>
|
||||
<Option name="midi frame base" value="393d3766"/>
|
||||
<Option name="midi note inactive channel" value="bfbfbf88"/>
|
||||
<Option name="midi note meter color max" value="ee3333aa"/>
|
||||
<Option name="midi note meter color mid" value="eeee33aa"/>
|
||||
<Option name="midi note meter color min" value="33ee33aa"/>
|
||||
<Option name="midi note selected" value="ff0000ff"/>
|
||||
<Option name="midi note color min" value="eef9a0ff"/>
|
||||
<Option name="midi note color mid" value="8ec78dff"/>
|
||||
<Option name="midi note color max" value="00f456ff"/>
|
||||
<Option name="selected midi note color min" value="f3c0c0ff"/>
|
||||
<Option name="selected midi note color mid" value="ff6b6bff"/>
|
||||
<Option name="selected midi note color max" value="ff0000ff"/>
|
||||
<Option name="midi note selected" value="ff3a48ff"/>
|
||||
<Option name="midi note velocity text" value="f4f214bc"/>
|
||||
<Option name="midi program change fill" value="0000ffa0"/>
|
||||
<Option name="midi program change outline" value="a7a7d4ff"/>
|
||||
|
|
|
|||
|
|
@ -172,17 +172,17 @@ CanvasNoteEvent::set_selected(bool selected)
|
|||
{
|
||||
if (!_note) {
|
||||
return;
|
||||
} else if (selected) {
|
||||
set_fill_color(UINT_INTERPOLATE(base_color(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5));
|
||||
set_outline_color(calculate_outline(
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get()));
|
||||
}
|
||||
|
||||
_selected = selected;
|
||||
set_fill_color (base_color ());
|
||||
|
||||
if (_selected) {
|
||||
set_outline_color(calculate_outline(ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get()));
|
||||
} else {
|
||||
set_fill_color(base_color());
|
||||
set_outline_color(calculate_outline(base_color()));
|
||||
}
|
||||
|
||||
_selected = selected;
|
||||
}
|
||||
|
||||
#define SCALE_USHORT_TO_UINT8_T(x) ((x) / 257)
|
||||
|
|
@ -201,19 +201,21 @@ CanvasNoteEvent::base_color()
|
|||
case TrackColor:
|
||||
{
|
||||
Gdk::Color color = _region.midi_stream_view()->get_region_color();
|
||||
return RGBA_TO_UINT(
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_red()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_green()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
|
||||
opacity);
|
||||
return UINT_INTERPOLATE (RGBA_TO_UINT(
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_red()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_green()),
|
||||
SCALE_USHORT_TO_UINT8_T(color.get_blue()),
|
||||
opacity),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
|
||||
}
|
||||
|
||||
case ChannelColors:
|
||||
return UINT_RGBA_CHANGE_A(CanvasNoteEvent::midi_channel_colors[_note->channel()],
|
||||
opacity);
|
||||
return UINT_INTERPOLATE (UINT_RGBA_CHANGE_A (CanvasNoteEvent::midi_channel_colors[_note->channel()],
|
||||
opacity),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteSelected.get(), 0.5);
|
||||
|
||||
default:
|
||||
return meter_style_fill_color(_note->velocity());
|
||||
return meter_style_fill_color(_note->velocity(), selected());
|
||||
};
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -103,18 +103,32 @@ class CanvasNoteEvent : virtual public sigc::trackable
|
|||
const boost::shared_ptr<NoteType> note() const { return _note; }
|
||||
MidiRegionView& region_view() const { return _region; }
|
||||
|
||||
inline static uint32_t meter_style_fill_color(uint8_t vel) {
|
||||
if (vel < 64) {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorBase.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorMid.get(),
|
||||
inline static uint32_t meter_style_fill_color(uint8_t vel, bool selected) {
|
||||
if (selected) {
|
||||
if (vel < 64) {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_SelectedMidiNoteColorBase.get(),
|
||||
ARDOUR_UI::config()->canvasvar_SelectedMidiNoteColorMid.get(),
|
||||
(vel / (double)63.0));
|
||||
} else {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorMid.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorTop.get(),
|
||||
} else {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_SelectedMidiNoteColorMid.get(),
|
||||
ARDOUR_UI::config()->canvasvar_SelectedMidiNoteColorTop.get(),
|
||||
((vel-64) / (double)63.0));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (vel < 64) {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteColorBase.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteColorMid.get(),
|
||||
(vel / (double)63.0));
|
||||
} else {
|
||||
return UINT_INTERPOLATE(
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteColorMid.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MidiNoteColorTop.get(),
|
||||
((vel-64) / (double)63.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// calculate outline colors from fill colors of notes
|
||||
|
|
|
|||
|
|
@ -49,13 +49,20 @@ CANVAS_VARIABLE(canvasvar_MeterColorBase, "meter fill min")
|
|||
CANVAS_VARIABLE(canvasvar_MeterColorClip, "meter fill clip")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColorMid, "meter fill mid")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColorTop, "meter fill max")
|
||||
CANVAS_VARIABLE(canvasvar_MidiMeterColorBase, "midi meter fill min")
|
||||
CANVAS_VARIABLE(canvasvar_MidiMeterColorClip, "midi meter fill clip")
|
||||
CANVAS_VARIABLE(canvasvar_MidiMeterColorMid, "midi meter fill mid")
|
||||
CANVAS_VARIABLE(canvasvar_MidiMeterColorTop, "midi meter fill max")
|
||||
CANVAS_VARIABLE(canvasvar_MeterMarker, "meter marker")
|
||||
CANVAS_VARIABLE(canvasvar_MidiBusBase, "midi bus base")
|
||||
CANVAS_VARIABLE(canvasvar_MidiFrameBase, "midi frame base")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteInactiveChannel, "midi note inactive channel")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteMeterColorBase, "midi note meter color min")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteMeterColorMid, "midi note meter color mid")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteMeterColorTop, "midi note meter color max")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteColorBase, "midi note color min")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteColorMid, "midi note color mid")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteColorTop, "midi note color max")
|
||||
CANVAS_VARIABLE(canvasvar_SelectedMidiNoteColorBase, "selected midi note color min")
|
||||
CANVAS_VARIABLE(canvasvar_SelectedMidiNoteColorMid, "selected midi note color mid")
|
||||
CANVAS_VARIABLE(canvasvar_SelectedMidiNoteColorTop, "selected midi note color max")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteSelected, "midi note selected")
|
||||
CANVAS_VARIABLE(canvasvar_MidiNoteVelocityText, "midi note velocity text")
|
||||
CANVAS_VARIABLE(canvasvar_MidiProgramChangeFill, "midi program change fill")
|
||||
|
|
|
|||
|
|
@ -185,9 +185,9 @@ LevelMeter::setup_meters (int len, int initial_width)
|
|||
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
|
||||
uint32_t b, m, t, c;
|
||||
if (n < nmidi) {
|
||||
b = ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorBase.get();
|
||||
m = ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorMid.get();
|
||||
t = ARDOUR_UI::config()->canvasvar_MidiNoteMeterColorTop.get();
|
||||
b = ARDOUR_UI::config()->canvasvar_MidiMeterColorBase.get();
|
||||
m = ARDOUR_UI::config()->canvasvar_MidiMeterColorMid.get();
|
||||
t = ARDOUR_UI::config()->canvasvar_MidiMeterColorTop.get();
|
||||
c = ARDOUR_UI::config()->canvasvar_MeterColorClip.get();
|
||||
} else {
|
||||
b = ARDOUR_UI::config()->canvasvar_MeterColorBase.get();
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ MidiRegionView::scroll (GdkEventScroll* ev)
|
|||
|
||||
trackview.editor().hide_verbose_canvas_cursor ();
|
||||
|
||||
bool fine = Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier);
|
||||
bool fine = !Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier);
|
||||
|
||||
if (ev->direction == GDK_SCROLL_UP) {
|
||||
change_velocities (true, fine, false);
|
||||
|
|
@ -2068,7 +2068,7 @@ MidiRegionView::begin_resizing (bool /*at_front*/)
|
|||
|
||||
// calculate color based on note velocity
|
||||
resize_rect->property_fill_color_rgba() = UINT_INTERPOLATE(
|
||||
CanvasNoteEvent::meter_style_fill_color(note->note()->velocity()),
|
||||
CanvasNoteEvent::meter_style_fill_color(note->note()->velocity(), note->selected()),
|
||||
fill_color,
|
||||
0.85);
|
||||
|
||||
|
|
@ -2227,7 +2227,7 @@ MidiRegionView::change_note_velocity(CanvasNoteEvent* event, int8_t velocity, bo
|
|||
new_velocity = velocity;
|
||||
}
|
||||
|
||||
// event->show_velocity ();
|
||||
event->set_selected (event->selected()); // change color
|
||||
|
||||
diff_add_change (event, MidiModel::DiffCommand::Velocity, new_velocity);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue