+ void create_note_at(double x, double y, double duration);
+
+ void display_model(boost::shared_ptr<ARDOUR::MidiModel> model);
+
+ void start_delta_command(string name = "midi edit");
+ void command_add_note(const boost::shared_ptr<NoteType> note, bool selected);
+ void command_remove_note(ArdourCanvas::CanvasNoteEvent* ev);
+
+ void apply_command();
+ void abort_command();
+
+ void note_entered(ArdourCanvas::CanvasNoteEvent* ev);
+ void unique_select(ArdourCanvas::CanvasNoteEvent* ev);
+ void note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add);
+ void note_deselected(ArdourCanvas::CanvasNoteEvent* ev, bool add);
+ void delete_selection();
+ size_t selection_size() { return _selection.size(); }
+
+ void move_selection(double dx, double dy);
+ void note_dropped(ArdourCanvas::CanvasNoteEvent* ev, double dt, uint8_t dnote);
+
+ /** Get the region position in pixels.
+ * This function is needed to subtract the region start in pixels
+ * from world coordinates submitted by the mouse
+ */
+ double get_position_pixels();
+
+ /** Begin resizing of some notes.
+ * Called by CanvasMidiNote when resizing starts.
+ * @param note_end which end of the note, NOTE_ON or NOTE_OFF
+ */
+ void begin_resizing(ArdourCanvas::CanvasNote::NoteEnd note_end);
+
+ /** Update resizing notes while user drags.
+ * @param note_end which end of the note, NOTE_ON or NOTE_OFF
+ * @param x the difference in mouse motion, ie the motion difference if relative=true
+ * or the absolute mouse position (track-relative) if relative is false
+ * @param relative true if relative resizing is taking place, false if absolute resizing
+ */
+ void update_resizing(ArdourCanvas::CanvasNote::NoteEnd note_end, double x, bool relative);
+
+ /** Finish resizing notes when the user releases the mouse button.
+ * @param note_end which end of the note, NOTE_ON or NOTE_OFF
+ * @param event_x the absolute mouse position (track-relative)
+ * @param relative true if relative resizing is taking place, false if absolute resizing
+ */
+ void commit_resizing(ArdourCanvas::CanvasNote::NoteEnd note_end, double event_x, bool relative);
+
+ /** Adjust the velocity on a note, and the selection if applicable.
+ * @param velocity the relative or absolute velocity
+ * @param relative whether velocity is relative or absolute
+ */
+ void change_velocity(ArdourCanvas::CanvasNoteEvent* ev, int8_t velocity, bool relative=false);
+
+ /** Change the channel of the selection.
+ * @param channel - the channel number of the new channel, zero-based
+ */
+ void change_channel(uint8_t channel);
+
+ enum MouseState { None, Pressed, SelectTouchDragging, SelectRectDragging, AddDragging, EraseTouchDragging };
+ MouseState mouse_state() const { return _mouse_state; }
+
+ struct NoteResizeData {
+ ArdourCanvas::CanvasNote *canvas_note;
+ ArdourCanvas::SimpleRect *resize_rect;
+ double current_x;
+ };
+
+ /** Snap a region relative pixel coordinate to pixel units.
+ * for pixel units (double) instead of nframes64_t
+ * @param x a pixel coordinate relative to region start
+ * @return the snapped pixel coordinate relative to region start
+ */
+ double snap_to_pixel(double x);
+
+ /** Snap a region relative pixel coordinate to frame units.
+ * @param x a pixel coordinate relative to region start
+ * @return the snapped nframes64_t coordinate relative to region start
+ */
+ nframes64_t snap_to_frame(double x);
+
+ /** Snap a region relative frame coordinate to frame units.
+ * @param x a pixel coordinate relative to region start
+ * @return the snapped nframes64_t coordinate relative to region start
+ */
+ nframes64_t snap_to_frame(nframes64_t x);
+