summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_streamview.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-14 15:01:53 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-14 15:01:53 +0000
commita46af0460b0fdcc145c4dd282fa4fe071d4971fc (patch)
tree81a1a2f4c779958df0f19d976e6cfd003afea5eb /gtk2_ardour/midi_streamview.cc
parent7a25fa1beb76b7148d4f96de5629d8b639aac9e7 (diff)
Create a new layer if required on record to a track in stacked mode. Fixes #3391.
git-svn-id: svn://localhost/ardour2/branches/3.0@8026 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_streamview.cc')
-rw-r--r--gtk2_ardour/midi_streamview.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc
index ef625f0a1c..e47d83ae83 100644
--- a/gtk2_ardour/midi_streamview.cc
+++ b/gtk2_ardour/midi_streamview.cc
@@ -201,7 +201,7 @@ MidiStreamView::display_region(MidiRegionView* region_view, bool load_model)
source->model()->highest_note());
// Display region contents
- region_view->set_height(height);
+ region_view->set_height (child_height());
region_view->display_model(source->model());
}
@@ -294,7 +294,7 @@ void
MidiStreamView::update_contents_height ()
{
StreamView::update_contents_height();
- _note_lines->property_y2() = height;
+ _note_lines->property_y2() = child_height ();
apply_note_range (lowest_note(), highest_note(), true);
}
@@ -312,7 +312,7 @@ MidiStreamView::draw_note_lines()
_note_lines->clear();
- if(height < 140){
+ if (child_height() < 140){
return;
}
@@ -364,13 +364,13 @@ MidiStreamView::apply_note_range(uint8_t lowest, uint8_t highest, bool to_region
_highest_note = highest;
_lowest_note = lowest;
- int range = _highest_note - _lowest_note;
- int pixels_per_note = floor (height/range);
+ int const range = _highest_note - _lowest_note;
+ int const pixels_per_note = floor (child_height () / range);
/* do not grow note height beyond 10 pixels */
if (pixels_per_note > 10) {
- int available_note_range = floor ((height)/10);
+ int const available_note_range = floor (child_height() / 10);
int additional_notes = available_note_range - range;
/* distribute additional notes to higher and lower ranges, clamp at 0 and 127 */
@@ -469,6 +469,8 @@ MidiStreamView::setup_rec_box ()
// rec regions are destroyed in setup_rec_box
/* we add the region later */
+
+ setup_new_rec_layer_time (region);
}
/* start a new rec box */
@@ -611,3 +613,4 @@ MidiStreamView::update_rec_box ()
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rec_regions.back().second);
mrv->extend_active_notes ();
}
+