When inserting new notes with the pencil tool, make them the length of the grid subvidision. Bug #3132.

git-svn-id: svn://localhost/ardour2/branches/3.0@7109 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington
2010-05-16 23:43:14 +00:00
parent f1114dedee
commit 54edd7b466
2 changed files with 9 additions and 6 deletions

View File

@@ -76,7 +76,6 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
: RegionView (parent, tv, r, spu, basic_color)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _default_note_length(1.0)
, _current_range_min(0)
, _current_range_max(0)
, _model_name(string())
@@ -101,7 +100,6 @@ MidiRegionView::MidiRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &
: RegionView (parent, tv, r, spu, basic_color, false, visibility)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _default_note_length(1.0)
, _model_name(string())
, _custom_device_mode(string())
, _active_notes(0)
@@ -125,7 +123,6 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other)
, RegionView (other)
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _default_note_length(1.0)
, _model_name(string())
, _custom_device_mode(string())
, _active_notes(0)
@@ -152,7 +149,6 @@ MidiRegionView::MidiRegionView (const MidiRegionView& other, boost::shared_ptr<M
: RegionView (other, boost::shared_ptr<Region> (region))
, _force_channel(-1)
, _last_channel_selection(0xFFFF)
, _default_note_length(1.0)
, _model_name(string())
, _custom_device_mode(string())
, _active_notes(0)
@@ -493,8 +489,16 @@ MidiRegionView::canvas_event(GdkEvent* ev)
clear_selection();
break;
case MouseRange:
create_note_at(event_x, event_y, _default_note_length);
{
bool success;
Evoral::MusicalTime beats = trackview.editor().get_grid_type_as_beats (success, trackview.editor().pixel_to_frame (event_x));
if (!success) {
beats = 1;
}
create_note_at (event_x, event_y, beats);
break;
}
default:
break;
}

View File

@@ -347,7 +347,6 @@ class MidiRegionView : public RegionView
int8_t _force_channel;
uint16_t _last_channel_selection;
double _default_note_length;
uint8_t _current_range_min;
uint8_t _current_range_max;