summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_time_axis.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-23 02:40:29 +0000
committerDavid Robillard <d@drobilla.net>2008-09-23 02:40:29 +0000
commitffaf827d93e56052049fc00234283842564821d5 (patch)
treeb3994950fe34c53f7c4381c384e4fa0c75370d27 /gtk2_ardour/midi_time_axis.cc
parent234d56a8c4da8b3bad47f6f75aa53d1067b1aad9 (diff)
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
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r--gtk2_ardour/midi_time_axis.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 7ef924dada..b0cc49f388 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -83,8 +83,9 @@ using namespace Editing;
MidiTimeAxisView::MidiTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
- : AxisView(sess) // FIXME: won't compile without this, why??
+ : AxisView(sess) // virtually inherited
, RouteTimeAxisView(ed, sess, rt, canvas)
+ , _ignore_signals(false)
, _range_scroomer(0)
, _piano_roll_header(0)
, _note_mode(Sustained)
@@ -200,18 +201,14 @@ MidiTimeAxisView::append_extra_display_menu_items ()
MenuList& range_items = range_menu->items();
range_menu->set_name ("ArdourContextMenu");
- RadioMenuItem::Group range_group;
-
- range_items.push_back (RadioMenuElem (range_group, _("Show Full Range"), bind (
+ range_items.push_back (MenuElem (_("Show Full Range"), bind (
mem_fun(*this, &MidiTimeAxisView::set_note_range),
MidiStreamView::FullRange)));
- range_items.push_back (RadioMenuElem (range_group, _("Fit Contents"), bind (
+ range_items.push_back (MenuElem (_("Fit Contents"), bind (
mem_fun(*this, &MidiTimeAxisView::set_note_range),
MidiStreamView::ContentsRange)));
- ((Gtk::CheckMenuItem&)range_items.back()).set_active(true);
-
items.push_back (MenuElem (_("Note range"), *range_menu));
}
@@ -273,10 +270,8 @@ MidiTimeAxisView::set_note_mode(NoteMode mode)
void
MidiTimeAxisView::set_note_range(MidiStreamView::VisibleNoteRange range)
{
- //if (midi_view()->note_range() != range) {
+ if (!_ignore_signals)
midi_view()->set_note_range(range);
- midi_view()->redisplay_diskstream();
- //}
}