summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-10-05 00:27:26 +0000
committerCarl Hetherington <carl@carlh.net>2010-10-05 00:27:26 +0000
commit822234876169480a271ec4a67bd01aee791681f0 (patch)
treee77f6b5787774c9eb810435dcaa69ac68321aa42 /gtk2_ardour
parent22ffdfa6ad9dd20132ba653a1c85f11a359d4633 (diff)
Improve GUI display during MIDI record in various ways.
git-svn-id: svn://localhost/ardour2/branches/3.0@7875 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/midi_streamview.cc18
-rw-r--r--gtk2_ardour/midi_streamview.h22
2 files changed, 19 insertions, 21 deletions
diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc
index fe1f778414..1604d4757d 100644
--- a/gtk2_ardour/midi_streamview.cc
+++ b/gtk2_ardour/midi_streamview.cc
@@ -459,7 +459,6 @@ MidiStreamView::setup_rec_box ()
(RegionFactory::create (sources, plist, false)));
assert(region);
- region->suspend_property_changes ();
region->set_position (_trackview.session()->transport_frame(), this);
rec_regions.push_back (make_pair(region, (RegionView*)0));
@@ -553,8 +552,9 @@ MidiStreamView::setup_rec_box ()
}
}
+/** @param start Start position to update in session frames */
void
-MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t start, nframes_t dur)
+MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, framepos_t const start, nframes_t dur)
{
ENSURE_GUI_THREAD (*this, &MidiStreamView::update_rec_regions, data, start, dur)
@@ -602,13 +602,8 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
((MidiRegionView*)iter->second)->begin_write();
}
- /* also update rect */
- ArdourCanvas::SimpleRect * rect = rec_rects[n].rectangle;
- gdouble xend = _trackview.editor().frame_to_pixel (region->position() + region->length());
- rect->property_x2() = xend;
-
- ARDOUR::BeatsFramesConverter tconv(_trackview.session()->tempo_map(), region->position());
- const MidiModel::TimeType start_beats = tconv.from(start);
+ ARDOUR::BeatsFramesConverter tconv(_trackview.session()->tempo_map(), region->position() - region->start());
+ const MidiModel::TimeType start_beats = tconv.from (start - tconv.origin_b ());
/* draw events */
MidiRegionView* mrv = (MidiRegionView*)iter->second;
@@ -693,8 +688,11 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t
}
}
+/** @param start Start of the range in session frames.
+ * @param cnd Number of frames in the range.
+ */
void
-MidiStreamView::rec_data_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<Source> weak_src)
+MidiStreamView::rec_data_range_ready (framepos_t start, nframes_t cnt, boost::weak_ptr<Source> weak_src)
{
// this is called from the butler thread for now
diff --git a/gtk2_ardour/midi_streamview.h b/gtk2_ardour/midi_streamview.h
index 2ef4697b37..e4fdd57718 100644
--- a/gtk2_ardour/midi_streamview.h
+++ b/gtk2_ardour/midi_streamview.h
@@ -102,19 +102,19 @@ class MidiStreamView : public StreamView
void setup_rec_box ();
void rec_data_range_ready (
- nframes_t start,
- nframes_t dur,
- boost::weak_ptr<ARDOUR::Source> src);
-
+ ARDOUR::framepos_t start,
+ nframes_t dur,
+ boost::weak_ptr<ARDOUR::Source> src);
+
void update_rec_regions (
- boost::shared_ptr<ARDOUR::MidiModel> data,
- nframes_t start,
- nframes_t dur);
-
+ boost::shared_ptr<ARDOUR::MidiModel> data,
+ ARDOUR::framepos_t const start,
+ nframes_t dur);
+
RegionView* add_region_view_internal (
- boost::shared_ptr<ARDOUR::Region>,
- bool wait_for_waves,
- bool recording = false);
+ boost::shared_ptr<ARDOUR::Region>,
+ bool wait_for_waves,
+ bool recording = false);
void display_region(MidiRegionView* region_view, bool load_model);
void display_track (boost::shared_ptr<ARDOUR::Track> tr);