summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-09-03 12:39:50 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-09-03 12:39:50 +0000
commitb0b584c2a595bfdf6bb4b980bd8d8fc7f3546fc5 (patch)
tree0bbe7220f24b7e7cefadc546d19c409ea357820f /gtk2_ardour/midi_region_view.cc
parentc8932292e19f31cab856096c94788bd3f6c5b5fc (diff)
the basics of step editing, more details to follow
git-svn-id: svn://localhost/ardour2/branches/3.0@5629 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_region_view.cc')
-rw-r--r--gtk2_ardour/midi_region_view.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 317e1f33fe..d3af36ab92 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -500,7 +500,7 @@ MidiRegionView::canvas_event(GdkEvent* ev)
void
MidiRegionView::show_list_editor ()
{
- MidiListEditor* mle = new MidiListEditor (midi_region());
+ MidiListEditor* mle = new MidiListEditor (trackview.session(), midi_region());
mle->show ();
}
@@ -761,6 +761,7 @@ MidiRegionView::display_sysexes()
string text = str.str();
ArdourCanvas::Group* const group = (ArdourCanvas::Group*)get_canvas_group();
+
const double x = trackview.editor().frame_to_pixel(beats_to_frames(time));
double height = midi_stream_view()->contents_height();
@@ -2236,6 +2237,30 @@ MidiRegionView::paste (nframes64_t pos, float times, const MidiCutBuffer& mcb)
}
void
+MidiRegionView::add_note (uint8_t channel, uint8_t number, uint8_t velocity,
+ Evoral::MusicalTime pos, Evoral::MusicalTime len)
+{
+ boost::shared_ptr<NoteType> new_note (new NoteType (channel, pos, len, number, velocity));
+
+ start_delta_command (_("step add"));
+ command_add_note (new_note, true, false);
+ apply_command ();
+
+ /* potentially extend region to hold new note */
+
+
+ nframes64_t end_frame = _region->position() + beats_to_frames (new_note->length());
+ nframes64_t region_end = _region->position() + _region->length() - 1;
+
+ if (end_frame > region_end) {
+ cerr << "Resize region!\n";
+ _region->set_length (end_frame, this);
+ } else {
+ redisplay_model ();
+ }
+}
+
+void
MidiRegionView::goto_next_note ()
{
// nframes64_t pos = -1;