diff options
author | David Robillard <d@drobilla.net> | 2007-08-06 06:09:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-06 06:09:41 +0000 |
commit | 684ef0eb7a1ca371a1e93fdceb271aa9d40a7dae (patch) | |
tree | 0339b5326231a7f8d138b8d0200c10d633b04d4a /gtk2_ardour/midi_streamview.cc | |
parent | f68caf23ddd0bfe5c189b94f0f57b194c1e2d912 (diff) |
Fix note range toggling (ie actually change visible range when menu option selected). Still some issue with initial value...
Don't raise tempo lines to top on editor canvas, they steal events. Same problem on time canvas, but harder to solve...
git-svn-id: svn://localhost/ardour2/trunk@2255 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_streamview.cc')
-rw-r--r-- | gtk2_ardour/midi_streamview.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 2008c56a49..c81cce65d6 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -57,7 +57,7 @@ MidiStreamView::MidiStreamView (MidiTimeAxisView& tv) : StreamView (tv) , _range(ContentsRange) , _lowest_note(60) - , _highest_note(71) + , _highest_note(60) { if (tv.is_track()) stream_base_color = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get(); @@ -189,6 +189,14 @@ MidiStreamView::redisplay_diskstream () if (_trackview.is_midi_track()) { _trackview.get_diskstream()->playlist()->foreach_region (static_cast<StreamView*>(this), &StreamView::add_region_view); } + + /* Always display at least one octave */ + if (_highest_note == 127) { + if (_lowest_note > (127 - 11)) + _lowest_note = 127 - 11; + } else if (_highest_note < _lowest_note + 11) { + _highest_note = _lowest_note + 11; + } for (i = region_views.begin(); i != region_views.end(); ) { tmp = i; @@ -238,6 +246,21 @@ MidiStreamView::draw_note_separators() } } } + + +void +MidiStreamView::set_note_range(VisibleNoteRange r) +{ + _range = r; + if (r == FullRange) { + _lowest_note = 0; + _highest_note = 127; + } else { + _lowest_note = 60; + _highest_note = 60; + } + redisplay_diskstream(); +} void |