From ffaf827d93e56052049fc00234283842564821d5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 23 Sep 2008 02:40:29 +0000 Subject: Eliminate a ton of unnecessary complete redrawing in MIDI stream views: Only resize vertically (don't reaload model) on range changes. Keep track of range in model while loading (writing to model), rather than double display MIDI regions to find out. Don't go crazy and chew CPU blinking around and doing nothing on initial show of MIDI track context menu. Change radio 'full range' and 'contents range' menu items to non-radio actions that just set the range appropriately. Fix crashes on some esoteric case of control data I can't figure out, but fixed anyway, so I guess it all worked out well in the end for everybody. git-svn-id: svn://localhost/ardour2/branches/3.0@3794 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_region_view.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'gtk2_ardour/midi_region_view.h') diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index cb5789ab41..fe2655333c 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -72,6 +72,7 @@ class MidiRegionView : public RegionView { return midi_view()->midi_view(); } void set_height (double); + void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false); void set_frame_color(); @@ -223,13 +224,18 @@ 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; - boost::shared_ptr _model; - std::vector _events; - std::vector< boost::shared_ptr > _pgm_changes; - ArdourCanvas::CanvasNote** _active_notes; - ArdourCanvas::Group* _note_group; - ARDOUR::MidiModel::DeltaCommand* _delta_command; + typedef std::vector Events; + typedef std::vector< boost::shared_ptr > PgmChanges; + + boost::shared_ptr _model; + Events _events; + PgmChanges _pgm_changes; + ArdourCanvas::CanvasNote** _active_notes; + ArdourCanvas::Group* _note_group; + ARDOUR::MidiModel::DeltaCommand* _delta_command; MouseState _mouse_state; int _pressed_button; -- cgit v1.2.3