31 #include <unordered_map>
33 #include <sigc++/signal.h>
57 struct PatchPrimaryKey;
85 MidiView (std::shared_ptr<ARDOUR::MidiTrack> mt,
89 uint32_t basic_color);
121 virtual void set_region (std::shared_ptr<ARDOUR::MidiRegion>);
122 virtual void set_track (std::shared_ptr<ARDOUR::MidiTrack>);
123 virtual void set_model (std::shared_ptr<ARDOUR::MidiModel>);
185 std::shared_ptr<ARDOUR::MidiModel>
model()
const {
return _model; }
224 void select_notes (std::list<Evoral::event_id_t>,
bool allow_audition);
357 void init (std::shared_ptr<ARDOUR::MidiTrack>);
477 std::string
get_note_name (std::shared_ptr<NoteType> note, uint8_t note_value)
const;
486 typedef std::unordered_map<ARDOUR::MidiModel::PatchChangePtr, std::shared_ptr<PatchChange> >
PatchChanges;
487 typedef std::unordered_map<ARDOUR::MidiModel::constSysExPtr, std::shared_ptr<SysEx> >
SysExes;
493 std::shared_ptr<ARDOUR::MidiModel>
_model;
std::shared_ptr< PatchChange< Temporal::Beats > > PatchChangePtr
std::multiset< NotePtr, EarlierNoteComparator > Notes
std::shared_ptr< Event< Temporal::Beats > > SysExPtr
uint8_t y_to_note(double y) const
double note_to_y(uint8_t note) const
uint8_t contents_note_range() const
void edit_patch_change(PatchChange *)
void duplicate_selection()
void update_drag_selection(Temporal::timepos_t const &start, Temporal::timepos_t const &end, double y0, double y1, bool extend)
std::string get_note_name(std::shared_ptr< NoteType > note, uint8_t note_value) const
void decrease_note_velocity()
std::shared_ptr< ARDOUR::MidiRegion > midi_region() const
std::set< std::shared_ptr< NoteType > > _marked_for_selection
bool set_velocity_for_notes(std::vector< NoteBase * > ¬es, int velocity)
void display_patch_changes()
void trim_front_starting()
void extend_active_notes()
void update_resizing(NoteBase *primary, bool at_front, double delta_x, bool relative, double snap_delta, bool with_snap)
Temporal::Beats get_draw_length_beats(Temporal::timepos_t const &pos) const
std::shared_ptr< ARDOUR::MidiModel > _model
void nudge_notes_earlier()
void delete_note(std::shared_ptr< NoteType >)
virtual void ghost_sync_selection(NoteBase *)
PBD::ScopedConnection track_going_away_connection
ArdourCanvas::Container * _note_group
void note_diff_add_change(NoteBase *ev, ARDOUR::MidiModel::NoteDiffCommand::Property, uint8_t val)
void extend_note_selection()
virtual bool button_press(GdkEventButton *)
NoteBase * add_note(const std::shared_ptr< NoteType > note, bool visible)
void transpose_down_tone_smush()
void decrease_note_velocity_smush()
Temporal::Beats earliest_in_selection()
void change_note_length(NoteBase *, ARDOUR::MidiModel::TimeType)
std::vector< NoteResizeData * > _resize_data
void get_events(Events &e, Evoral::Sequence< Temporal::Beats >::NoteOperator op, uint8_t val, int chan_mask=0)
virtual bool note_in_region_range(const std::shared_ptr< NoteType > note, bool &visible) const
void remove_from_selection(NoteBase *)
virtual void select_self(bool add)
virtual bool canvas_group_event(GdkEvent *ev)
Temporal::Beats _step_edit_cursor_position
void transpose_down_octave_smush()
NoteBase * channel_selector_scoped_note()
void end_note_splitting()
void start_playing_midi_chord(std::vector< std::shared_ptr< NoteType > > notes)
std::shared_ptr< SysEx > find_canvas_sys_ex(ARDOUR::MidiModel::SysExPtr s)
void show_verbose_cursor(std::string const &, double, double) const
void step_patch(PatchChange &patch, bool bank, int delta)
virtual bool key_release(GdkEventKey *)
MidiView(MidiView const &other)
void move_note_ends_later()
void increase_note_velocity_smush()
void nudge_notes_later_fine()
MidiListEditor * _list_editor
void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false)
void increase_note_velocity_fine_together()
void increase_note_velocity_fine()
bool paste(Temporal::timepos_t const &pos, const ::Selection &selection, PasteContext &ctx)
void decrease_note_velocity_fine_smush_together()
void change_note_lengths(bool, bool, Temporal::Beats beats, bool start, bool end)
void goto_previous_note(bool add_to_selection)
bool _select_all_notes_after_add
void extend_active_notes(Temporal::timecnt_t const &)
virtual void update_hit(Hit *)
void decrease_note_velocity_smush_together()
virtual bool motion(GdkEventMotion *)
void note_selected(NoteBase *ev, bool add, bool extend=false)
void change_note_velocity(NoteBase *ev, int8_t vel, bool relative=false)
void change_patch_change(ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange< Temporal::Beats > const &)
void add_select_previous_note()
Temporal::timecnt_t snap_pixel_to_time(double x, bool ensure_snap=false)
void unique_select(NoteBase *ev)
void move_note_ends_later_fine()
void change_patch_change(PatchChange &old_patch, const MIDI::Name::PatchPrimaryKey &new_patch)
void decrease_note_velocity_fine_together()
void sync_velocity_drag(double factor)
uint8_t y_to_note(double y) const
void sysex_entered(SysEx *p)
void update_patch_changes()
void move_copies(Temporal::timecnt_t const &dx_qn, double dy, double cumulative_dy)
void move_note_starts_earlier_fine()
MidiViewBackground & midi_context() const
void update_ghost_note(double, double, uint32_t state)
void show_verbose_cursor(std::shared_ptr< NoteType >) const
void note_left(NoteBase *ev)
void step_sustain(Temporal::Beats beats)
std::shared_ptr< ARDOUR::MidiTrack > _midi_track
uint8_t get_velocity_for_add(ARDOUR::MidiModel::TimeType time) const
void decrease_note_velocity_together()
virtual bool enter_notify(GdkEventCrossing *)
void transpose_down_tone()
EditingContext & _editing_context
bool end_boundary_event(GdkEvent *)
void sync_ghost_selection(NoteBase *)
NoteBase * copy_selection(NoteBase *primary)
void start_note_splitting()
void paste_internal(Temporal::timepos_t const &pos, unsigned paste_count, float times, const MidiCutBuffer &)
virtual bool scroll(GdkEventScroll *)
std::unordered_map< std::shared_ptr< NoteType >, NoteBase * > Events
void change_channel(uint8_t channel)
MidiView(std::shared_ptr< ARDOUR::MidiTrack > mt, ArdourCanvas::Item &parent, EditingContext &ec, MidiViewBackground &bg, uint32_t basic_color)
ARDOUR::ChannelMode get_channel_mode() const
void invert_note_selection()
void note_diff_add_note(const std::shared_ptr< NoteType > note, bool selected, bool show_velocity=false)
void sysex_left(SysEx *p)
ArdourCanvas::Rectangle * _end_boundary_rect
void redisplay(bool view_only)
void note_diff_remove_note(NoteBase *ev)
void move_step_edit_cursor(Temporal::Beats pos)
void add_select_next_note()
virtual void ghosts_model_changed()
void begin_resizing(bool at_front)
void maybe_select_by_position(GdkEventButton *ev, double x, double y)
virtual void set_track(std::shared_ptr< ARDOUR::MidiTrack >)
virtual void ghost_remove_note(NoteBase *)
Evoral::Sequence< Temporal::Beats >::Notes Notes
virtual void set_visibility_note_range(MidiViewBackground::VisibleNoteRange, bool)
std::set< Evoral::event_id_t > _pending_note_selection
void add_canvas_patch_change(ARDOUR::MidiModel::PatchChangePtr patch)
void start_note_diff_command(std::string name="midi edit")
void clip_capture_update_sustained(Note *, double &, double &, double &, double &)
double get_end_position_pixels()
virtual bool leave_notify(GdkEventCrossing *)
NoteBase * find_canvas_note(Evoral::event_id_t id)
virtual void leave_internal()
bool note_canvas_event(GdkEvent *ev)
virtual void reset_width_dependent_items(double pixel_width)
virtual void begin_drag_edit(std::string const &why)
void cut_copy_clear(Editing::CutCopyOp)
bool start_boundary_event(GdkEvent *)
void data_recorded(std::weak_ptr< ARDOUR::MidiSource >)
std::shared_ptr< ARDOUR::MidiTrack > midi_track() const
void note_deselected(NoteBase *ev)
virtual void mouse_mode_changed()
void move_note_starts_later_fine()
void set_note_range(uint8_t low, uint8_t high)
virtual void region_resized(const PBD::PropertyChange &)
MidiCutBuffer * selection_as_cut_buffer() const
void change_velocities(bool up, bool fine, bool allow_smush, bool all_together)
void patch_left(PatchChange *)
virtual GhostRegion * add_ghost(TimeAxisView &)
void goto_next_note(bool add_to_selection)
double get_position_pixels()
bool set_velocities_for_notes(std::vector< NoteBase * > ¬es, std::vector< int > &velocities)
MidiViewBackground & _midi_context
void hide_verbose_cursor()
void select_range(Temporal::timepos_t const &start, Temporal::timepos_t const &end)
void create_note_at(Temporal::timepos_t const &t, double y, Temporal::Beats length, uint32_t state, bool shift_snap)
MouseState mouse_state() const
virtual bool button_release(GdkEventButton *)
void increase_note_velocity_fine_smush()
void update_vertical_drag_selection(double last_y, double y, bool extend)
ArdourCanvas::Rectangle * _step_edit_cursor
virtual ArdourCanvas::Item * drag_group() const =0
Events::iterator _optimization_iterator
Gtkmm2ext::Color _patch_change_outline
virtual void clear_ghost_events()
void select_previous_note()
void delete_patch_change(PatchChange *)
void quantize_selected_notes()
void create_ghost_note(double, double, uint32_t state)
Temporal::timecnt_t active_note_end
double note_height() const
void nudge_notes(bool forward, bool fine)
void move_note_starts_later()
MIDI::Name::PatchPrimaryKey patch_change_to_patch_key(ARDOUR::MidiModel::PatchChangePtr)
PatchChanges _patch_changes
std::shared_ptr< ARDOUR::MidiModel > model() const
void increase_note_velocity_smush_together()
virtual void ghost_add_note(NoteBase *)
void note_mouse_position(float xfraction, float yfraction, bool can_set_cursor=true)
virtual bool note_in_region_time_range(const std::shared_ptr< NoteType > note) const
virtual std::string get_modifier_name() const
double snap_to_pixel(double x, bool ensure_snap=false)
virtual double height() const
void delete_sysex(SysEx *)
void move_note_ends_earlier()
void clear_note_selection()
std::shared_ptr< PatchChange > find_canvas_patch_change(ARDOUR::MidiModel::PatchChangePtr p)
void decrease_note_velocity_fine()
void move_note_ends_earlier_fine()
void set_step_edit_cursor_width(Temporal::Beats beats)
void start_playing_midi_note(std::shared_ptr< NoteType > note)
void instrument_settings_changed()
double note_to_y(uint8_t note) const
std::vector< SplitInfo > split_info
void clip_data_recorded(samplecnt_t)
void set_extensible(bool yn)
void set_flags(XMLNode *)
ArdourCanvas::Rectangle * _start_boundary_rect
void play_midi_note(std::shared_ptr< NoteType > note)
virtual void set_height(double)
void hide_step_edit_cursor()
void transpose_down_octave()
void note_diff_add_change(NoteBase *ev, ARDOUR::MidiModel::NoteDiffCommand::Property, Temporal::Beats val)
Temporal::Beats _step_edit_cursor_width
void region_update_sustained(Note *, double &, double &, double &, double &)
ARDOUR::MidiModel::NoteDiffCommand * _note_diff_command
PBD::ScopedConnectionList connections_requiring_model
void transpose_up_octave_smush()
void move_selection(Temporal::timecnt_t const &dx, double dy, double cumulative_dy)
void select_matching_notes(uint8_t notenum, uint16_t channel_mask, bool add, bool extend)
Temporal::Beats get_grid_beats(Temporal::timepos_t const &pos) const
bool _mouse_changed_selection
void toggle_matching_notes(uint8_t notenum, uint16_t channel_mask)
void apply_note_diff(bool as_subcommand=false, bool was_copy=false)
void move_note_starts_earlier()
void increase_note_velocity_together()
samplecnt_t _last_display_zoom
std::unordered_map< ARDOUR::MidiModel::constSysExPtr, std::shared_ptr< SysEx > > SysExes
Selection const & selection() const
virtual bool key_press(GdkEventKey *)
void show_verbose_cursor_for_new_note_value(std::shared_ptr< NoteType > current_note, uint8_t new_note) const
void move_patch_change(PatchChange &, Temporal::Beats)
void change_note_time(NoteBase *ev, ARDOUR::MidiModel::TimeType, bool relative=false)
void set_velocity(NoteBase *primary, int velocity)
void get_patch_key_at(Temporal::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey &key) const
void display_model(std::shared_ptr< ARDOUR::MidiModel > model)
void show_step_edit_cursor(Temporal::Beats pos)
Gtkmm2ext::Color _patch_change_fill
void add_patch_change(Temporal::timecnt_t const &, Evoral::PatchChange< Temporal::Beats > const &)
std::unordered_map< ARDOUR::MidiModel::PatchChangePtr, std::shared_ptr< PatchChange > > PatchChanges
Evoral::Note< Temporal::Beats > NoteType
uint16_t get_selected_channels() const
void change_note_channel(NoteBase *, int8_t, bool relative=false)
EditingContext & editing_context() const
void update_note(NoteBase *)
void add_to_selection(NoteBase *)
void select_notes(std::list< Evoral::event_id_t >, bool allow_audition)
virtual void set_samples_per_pixel(double)
NoteBase * _channel_selection_scoped_note
void trim_note(NoteBase *ev, ARDOUR::MidiModel::TimeType start_delta, ARDOUR::MidiModel::TimeType end_delta)
virtual bool display_is_enabled() const
virtual void ghosts_view_changed()
void note_deleted(NoteBase *)
std::set< std::shared_ptr< NoteType > > _marked_for_velocity
void init(std::shared_ptr< ARDOUR::MidiTrack >)
virtual void unselect_self()
void finish_resizing(NoteBase *primary, bool at_front, double delat_x, bool relative, double snap_delta, bool with_snap)
virtual double contents_height() const
virtual void update_sustained(Note *)
void increase_note_velocity_fine_smush_together()
virtual uint32_t get_fill_color() const
void transpose(bool up, bool fine, bool allow_smush)
virtual void set_region(std::shared_ptr< ARDOUR::MidiRegion >)
virtual void select_self_uniquely()
virtual void add_control_points_to_selection(Temporal::timepos_t const &, Temporal::timepos_t const &, double y0, double y1)
void note_entered(NoteBase *ev)
NoteBase * find_canvas_note(std::shared_ptr< NoteType >)
void clear_selection_internal()
void decrease_note_velocity_fine_smush()
void set_channel_selector_scoped_note(NoteBase *note)
void nudge_notes_earlier_fine()
uint8_t get_channel_for_add(ARDOUR::MidiModel::TimeType time) const
void display_patch_changes_on_channel(uint8_t, bool)
void join_notes_on_channel(int channel)
void transpose_up_octave()
virtual void set_model(std::shared_ptr< ARDOUR::MidiModel >)
PBD::ScopedConnectionList region_connections
std::vector< NoteBase * > CopyDragEvents
virtual void enter_internal(uint32_t state)
CopyDragEvents _copy_drag_events
void midi_channel_mode_changed()
std::shared_ptr< CursorContext > _press_cursor_ctx
void remove_canvas_patch_change(PatchChange *pc)
void note_dropped(NoteBase *ev, Temporal::timecnt_t const &d_qn, int8_t d_note, bool copy)
void step_add_note(uint8_t channel, uint8_t number, uint8_t velocity, Temporal::Beats pos, Temporal::Beats len)
void transpose_up_tone_smush()
uint8_t change_note_note(NoteBase *ev, int8_t note, bool relative=false)
void patch_entered(PatchChange *)
void selection_as_notelist(Notes &selected, bool allow_all_if_none_selected=false)
void increase_note_velocity()
std::set< NoteBase * > Selection
std::shared_ptr< ARDOUR::MidiRegion > _midi_region
GtkImageIconNameData name
PBD::PropertyDescriptor< bool > selected
PBD::PropertyDescriptor< timecnt_t > length
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
void add(const Gtk::StockItem &item)
int pixel_width(const std::string &str, const Pango::FontDescription &font)
ArdourCanvas::Rectangle * resize_rect
SplitInfo(Temporal::Beats const &t, Temporal::Beats const &l, int n, int c, int v, int ov)