X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstep_editor.cc;h=11ac6c318775cd8242ed725154e41eba743ae1f6;hb=8cd71108c1d153f84f25c3b9e5153a110826c130;hp=2b5ab0f69009c9488cd57faab6441a3ba3edb21a;hpb=ec1ef5d6b574258d6451aa60749c4241f3c42f5f;p=ardour.git diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc index 2b5ab0f690..11ac6c3187 100644 --- a/gtk2_ardour/step_editor.cc +++ b/gtk2_ardour/step_editor.cc @@ -1,3 +1,22 @@ +/* + Copyright (C) 2012 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + #include "ardour/midi_track.h" #include "ardour/midi_region.h" #include "ardour/tempo.h" @@ -63,7 +82,6 @@ StepEditor::start_step_editing () step_edit_region_view->show_step_edit_cursor (step_edit_beat_pos); step_edit_region_view->set_step_edit_cursor_width (step_editor->note_length()); - step_editor->set_position (WIN_POS_MOUSE); step_editor->present (); } @@ -131,7 +149,7 @@ bool StepEditor::step_editor_hidden (GdkEventAny*) { step_editor_hide (); - return true; + return true; // XXX remember position ?! } void @@ -237,7 +255,9 @@ StepEditor::step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity, Evo assert (step_edit_region); assert (step_edit_region_view); - if (beat_duration == 0.0) { + if (beat_duration == 0.0 && step_editor) { + beat_duration = step_editor->note_length(); + } else if (beat_duration == 0.0) { bool success; beat_duration = _editor.get_grid_type_as_beats (success, step_edit_insert_position);