diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 17:39:28 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-05-28 17:39:28 +0000 |
commit | 8932625869f181bc16833c9e9d253970656c180d (patch) | |
tree | 8558c8bb21baf4130cf39a3cc82f7dc50fb50dec | |
parent | 3e966771d042455a50a01e786af2af7b6f407395 (diff) |
change color of note velocity text (and don't set it or justification repeatedly); make pianoroll button2 clicks select correctly rather than always being additive; hide note velocity text as soon as the mouse moves. the color change will require remvoing ~/.config/ardour2/ardour3_ui.conf to become effective
git-svn-id: svn://localhost/ardour2/branches/3.0@7187 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour3_ui_default.conf | 2 | ||||
-rw-r--r-- | gtk2_ardour/canvas-note-event.cc | 7 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas_events.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 16 |
4 files changed, 18 insertions, 8 deletions
diff --git a/gtk2_ardour/ardour3_ui_default.conf b/gtk2_ardour/ardour3_ui_default.conf index 509b3851c7..ae31665797 100644 --- a/gtk2_ardour/ardour3_ui_default.conf +++ b/gtk2_ardour/ardour3_ui_default.conf @@ -59,7 +59,7 @@ <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 velocity text" value="000000ff"/> + <Option name="midi note velocity text" value="f4f214bc"/> <Option name="midi program change fill" value="0000ffa0"/> <Option name="midi program change outline" value="a7a7d4ff"/> <Option name="midi sysex fill" value="f1e139a0"/> diff --git a/gtk2_ardour/canvas-note-event.cc b/gtk2_ardour/canvas-note-event.cc index 03130dd173..cd3fcffa8b 100644 --- a/gtk2_ardour/canvas-note-event.cc +++ b/gtk2_ardour/canvas-note-event.cc @@ -85,14 +85,15 @@ CanvasNoteEvent::show_velocity() { if (!_text) { _text = new NoEventText (*(_item->property_parent())); + _text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiNoteVelocityText.get(); + _text->property_justification() = Gtk::JUSTIFY_CENTER; } + _text->property_x() = (x1() + x2()) /2; _text->property_y() = (y1() + y2()) /2; ostringstream velo(ios::ate); velo << int(_note->velocity()); _text->property_text() = velo.str(); - _text->property_justification() = Gtk::JUSTIFY_CENTER; - _text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiNoteVelocityText.get(); _text->show(); _text->raise_to_top(); } @@ -221,8 +222,6 @@ CanvasNoteEvent::base_color() bool CanvasNoteEvent::on_event(GdkEvent* ev) { - cerr << "CNE: on_event type " << ev->type << endl; - if (!_region.get_time_axis_view().editor().internal_editing()) { return false; } diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 3fa29437ca..8d3d4cf55a 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -953,7 +953,6 @@ Editor::canvas_note_event (GdkEvent *event, ArdourCanvas::Item* item) return false; } - cerr << "Forward note event item on to editor\n"; return typed_event (item, event, NoteItem); } diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 32c23438ad..3232ca4072 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -291,7 +291,6 @@ MidiRegionView::enter_notify (GdkEventCrossing* ev) bool MidiRegionView::leave_notify (GdkEventCrossing* ev) { - _mouse_state = None; trackview.editor().hide_verbose_canvas_cursor (); delete _ghost_note; _ghost_note = 0; @@ -403,7 +402,13 @@ MidiRegionView::motion (GdkEventMotion* ev) if (_ghost_note) { update_ghost_note (ev->x, ev->y); } + + /* any motion immediately hides velocity text that may have been visible */ + for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { + (*i)->hide_velocity (); + } + switch (_mouse_state) { case Pressed: // Maybe start a drag, if we've moved a bit @@ -1678,6 +1683,10 @@ MidiRegionView::select_matching_notes (uint8_t notenum, uint16_t channel_mask, b MidiModel::Notes& notes (_model->notes()); _optimization_iterator = _events.begin(); + if (!add) { + clear_selection (); + } + if (extend && _selection.empty()) { extend = false; } @@ -2512,7 +2521,10 @@ MidiRegionView::note_entered(ArdourCanvas::CanvasNoteEvent* ev) void MidiRegionView::note_left (ArdourCanvas::CanvasNoteEvent* note) { - note->hide_velocity (); + for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { + (*i)->hide_velocity (); + } + trackview.editor().hide_verbose_canvas_cursor (); } |