temporarily remove buggy MouseRange-on-Piano-Roll event handlers
[ardour.git] / gtk2_ardour / piano_roll_header.cc
index e784242ff1247319ab2bf0e56f641d466b262ccb..54cc8026015744446b5df42c6b641f8a7645bb68 100644 (file)
@@ -174,16 +174,16 @@ render_dga(Cairo::RefPtr<Cairo::Context> cr, int /*note*/, double x[], double y[
 void
 PianoRollHeader::get_path(PianoRollHeader::ItemType note_type, int note, double x[], double y[])
 {
-       double y_pos = floor(_view.note_to_y(note)) - 0.5f;
+       double y_pos = floor(_view.note_to_y(note)) + 1.5f;
        double note_height;
-       double other_y1 = floor(_view.note_to_y(note+1)) + floor(_note_height / 2.0f) + 0.5f;
-       double other_y2 = floor(_view.note_to_y(note-1)) + floor(_note_height / 2.0f) - 1.0f;
+       double other_y1 = floor(_view.note_to_y(note+1)) + floor(_note_height / 2.0f) + 2.5f;
+       double other_y2 = floor(_view.note_to_y(note-1)) + floor(_note_height / 2.0f) + 1.0f;
        double width = get_width();
 
        if (note == 0) {
-               note_height = floor(_view.contents_height()) - y_pos;
+               note_height = floor(_view.contents_height()) - y_pos + 2.;
        } else {
-               note_height = floor(_view.note_to_y(note - 1)) - y_pos;
+               note_height = floor(_view.note_to_y(note - 1)) - y_pos + 2.;
        }
 
        switch (note_type) {
@@ -467,7 +467,7 @@ PianoRollHeader::on_motion_notify_event (GdkEventMotion* ev)
 
                int note = _view.y_to_note(ev->y);
 
-               if (editor().current_mouse_mode() == Editing::MouseRange) {
+               if ( false /*editor().current_mouse_mode() == Editing::MouseRange*/ ) {   //ToDo:  fix this.  this mode is buggy, and of questionable utility anyway
                        
                        /* select note range */
 
@@ -513,17 +513,15 @@ bool
 PianoRollHeader::on_button_press_event (GdkEventButton* ev)
 {
        int note = _view.y_to_note(ev->y);
-
-       if (ev->button == 2 && ev->type == GDK_BUTTON_PRESS) {
-               if (Keyboard::no_modifiers_active (ev->state)) {
-                       SetNoteSelection (note); // EMIT SIGNAL
-                       return true;
-               }
-               return false;
-       }
-       
-       if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS && note >= 0 && note < 128) {
-               
+       bool tertiary = Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier);
+
+       if (ev->button == 2 && Keyboard::no_modifiers_active (ev->state)) {
+               SetNoteSelection (note); // EMIT SIGNAL
+               return true;
+       } else if (tertiary && (ev->button == 1 || ev->button == 2)) {
+               ExtendNoteSelection (note); // EMIT SIGNAL
+               return true;
+       } else if (ev->button == 1 && note >= 0 && note < 128) {
                add_modal_grab();
                _dragging = true;
                
@@ -546,7 +544,7 @@ PianoRollHeader::on_button_release_event (GdkEventButton* ev)
 {
        int note = _view.y_to_note(ev->y);
 
-       if (editor().current_mouse_mode() == Editing::MouseRange) {
+       if (false /*editor().current_mouse_mode() == Editing::MouseRange*/ ) {  //Todo:  this mode is buggy, and of questionable utility anyway
 
                if (Keyboard::no_modifiers_active (ev->state)) {
                        AddNoteSelection (note); // EMIT SIGNAL