Hack round a maybe delightful (for some values of delightful) and certainly evil...
authorCarl Hetherington <carl@carlh.net>
Fri, 4 Mar 2011 03:55:14 +0000 (03:55 +0000)
committerCarl Hetherington <carl@carlh.net>
Fri, 4 Mar 2011 03:55:14 +0000 (03:55 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9064 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_streamview.cc

index 723b52220210e0b3e28e972af24e6a5632135a94..f3b418fc99fede4afecd42f3b9a967ccce40ce63 100644 (file)
@@ -452,6 +452,20 @@ MidiStreamView::setup_rec_box ()
                                
                                plist.add (ARDOUR::Properties::start, start);
                                plist.add (ARDOUR::Properties::length, 1);
+                               /* Just above we're setting this nascent region's length to 1.  I think this
+                                  is so that the RegionView gets created with a non-zero width, as apparently
+                                  creating a RegionView with a zero width causes it never to be displayed
+                                  (there is a warning in TimeAxisViewItem::init about this).  However, we
+                                  must also set length_beats to something non-zero, otherwise the frame length
+                                  of 1 causes length_beats to be set to some small quantity << 1.  Then
+                                  when the position is set up below, this length_beats is used to recompute
+                                  length using Tempo::framepos_plus_bbt, which is slightly innacurate for small
+                                  beats values (see comment in Tempo::framepos_plus_bbt) [mostly because
+                                  it converts floating point beats to bars, beats and integer ticks].  The upshot
+                                  of which being that length gets set back to 0, meaning no region view is ever
+                                  seen, meaning no MIDI notes during record (#3820).
+                               */
+                               plist.add (ARDOUR::Properties::length_beats, 1);
                                plist.add (ARDOUR::Properties::name, string());
                                plist.add (ARDOUR::Properties::layer, 0);