Ardour  9.0-pre0-582-g084a23a80d
editing_context.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2007 Doug McLain <doug@nostar.net>
3  * Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2005 Karsten Wiese <fzuuzf@googlemail.com>
5  * Copyright (C) 2006-2009 Sampo Savolainen <v2@iki.fi>
6  * Copyright (C) 2006-2015 David Robillard <d@drobilla.net>
7  * Copyright (C) 2006-2017 Tim Mayberry <mojofunk@gmail.com>
8  * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
9  * Copyright (C) 2008-2011 Sakari Bergen <sakari.bergen@beatwaves.net>
10  * Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com>
11  * Copyright (C) 2013-2015 Colin Fletcher <colin.m.fletcher@googlemail.com>
12  * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
13  * Copyright (C) 2014-2017 Nick Mainsbridge <mainsbridge@gmail.com>
14  * Copyright (C) 2014-2019 Ben Loftis <ben@harrisonconsoles.com>
15  * Copyright (C) 2015-2019 Damien Zammit <damien@zamaudio.com>
16  * Copyright (C) 2015 AndrĂ© Nusser <andre.nusser@googlemail.com>
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * (at your option) any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License along
29  * with this program; if not, write to the Free Software Foundation, Inc.,
30  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31  */
32 
33 #pragma once
34 
35 #include "pbd/signals.h"
36 
37 #include "temporal/timeline.h"
38 
39 #include "ardour/midi_operator.h"
40 #include "ardour/session_handle.h"
41 #include "ardour/types.h"
42 
43 #include "widgets/ardour_button.h"
45 #include "widgets/ardour_spacer.h"
46 
47 #include "axis_provider.h"
48 #include "editing.h"
49 #include "editor_items.h"
50 #include "selection.h"
51 
54 
55 namespace Temporal {
56  class TempoMap;
57 }
58 
59 class XMLNode;
60 
61 class ControlPoint;
62 class CursorContext;
63 class DragManager;
64 class EditorCursor;
65 class EditNoteDialog;
66 class MidiRegionView;
67 class MidiView;
68 class MouseCursors;
69 class VerboseCursor;
70 class TrackViewList;
71 class Selection;
72 class SelectionMemento;
73 class SelectableOwner;
74 
76 {
77  public:
78  EditingContext (std::string const &);
80 
81  std::string editor_name() const { return _name; }
82 
84 
86 
87 
88  struct TempoMapScope {
89  TempoMapScope (EditingContext& context, std::shared_ptr<Temporal::TempoMap> map)
90  : ec (context)
91  {
93  }
96  }
98  std::shared_ptr<Temporal::TempoMap const> old_map;
99  };
100 
101  DragManager* drags () const {
102  return _drags;
103  }
104 
105  bool drag_active () const;
107 
108  virtual std::list<SelectableOwner*> selectable_owners() = 0;
109 
110  virtual ArdourCanvas::Duple upper_left() const { return ArdourCanvas::Duple (0, 0); }
111 
112  virtual void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, std::list<SelectableOwner*> const &, ARDOUR::SelectionOperation, bool) = 0;
113  virtual void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<std::shared_ptr<Evoral::Note<Temporal::Beats> > > > >&) const = 0;
114  virtual void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const = 0;
116  virtual TrackViewList axis_views_from_routes (std::shared_ptr<ARDOUR::RouteList>) const = 0;
117 
119  virtual ArdourMarker* find_marker_from_location_id (PBD::ID const&, bool) const = 0;
122 
123 
126 
127  virtual void maybe_autoscroll (bool, bool, bool from_headers) = 0;
128  virtual void stop_canvas_autoscroll () = 0;
129  virtual bool autoscroll_active() const = 0;
130 
131  virtual void redisplay_grid (bool immediate_redraw) = 0;
133 
136 
141  void set_follow_playhead (bool yn, bool catch_up = true);
142 
145 
147  bool follow_playhead () const { return _follow_playhead; }
148 
150  bool use_context_click = false,
151  bool from_outside_canvas = false) {
152  return _get_preferred_edit_position (eio, use_context_click, from_outside_canvas);
153  }
154 
155  virtual void instant_save() = 0;
156 
157  virtual void begin_selection_op_history () = 0;
158  virtual void begin_reversible_selection_op (std::string cmd_name) = 0;
159  virtual void commit_reversible_selection_op () = 0;
160  virtual void abort_reversible_selection_op () = 0;
161  virtual void undo_selection_op () = 0;
162  virtual void redo_selection_op () = 0;
163 
164  /* Some EditingContexts may defer to the Session, which IS-A
165  * HistoryOwner (Editor does this).
166  *
167  * Others may themselves have the IS-A HistoryOwner inheritance, and so
168  * they just proxy back to their base class (CueEditor does this).
169  */
170 
171  virtual PBD::HistoryOwner& history() = 0;
172 
173  virtual void add_command (PBD::Command *) = 0;
174  virtual void begin_reversible_command (std::string cmd_name) = 0;
175  virtual void begin_reversible_command (GQuark) = 0;
176  virtual void abort_reversible_command () = 0;
177  virtual void commit_reversible_command () = 0;
178 
180 
182 
183  void temporal_zoom_step (bool zoom_out);
184  void temporal_zoom_step_scale (bool zoom_out, double scale);
185  void temporal_zoom_step_mouse_focus (bool zoom_out);
186  void temporal_zoom_step_mouse_focus_scale (bool zoom_out, double scale);
187 
191  void temporal_zoom_to_sample (bool coarser, samplepos_t sample);
192 
193  double timeline_origin() const { return _timeline_origin; }
194 
195  /* NOTE: these functions assume that the "pixel" coordinate is
196  in canvas coordinates. These coordinates already take into
197  account any scrolling offsets.
198  */
199 
201 
202  /* pixel can be less than zero when motion events are
203  processed. Since the pixel value is in canvas units (since
204  it comes from an event delivered to the canvas), we've
205  already run the window->canvas transform, that means that
206  the location *really* is "off to the right" and thus really
207  is "before the start".
208  */
209 
210  if (pixel >= _timeline_origin) {
211  return (pixel - _timeline_origin) * samples_per_pixel;
212  } else {
213  return 0;
214  }
215  }
216 
217  /* It makes no sense to ever call these functions to convert to or from a
218  * non-timeline relative pixel position, so they all assume that is
219  * what they are being asked to do.
220  */
221 
222  samplepos_t pixel_to_sample (double pixel) const {
223  return pixel * samples_per_pixel;
224  }
225 
226  double sample_to_pixel (samplepos_t sample) const {
227  return round (sample / (double) samples_per_pixel);
228  }
229 
230  double sample_to_pixel_unrounded (samplepos_t sample) const {
231  return (sample / (double) samples_per_pixel);
232  }
233 
234  double time_to_pixel (Temporal::timepos_t const & pos) const;
235  double time_to_pixel_unrounded (Temporal::timepos_t const & pos) const;
236 
238 
239  /* deprecated, prefer time_delta_to_pixel
240  * first taking the duation and then rounding leads to different results:
241  * duration_to_pixels (start.distance(end)) != time_to_pixel (end) - time_to_pixel (start)
242  */
243  double duration_to_pixels (Temporal::timecnt_t const & pos) const;
245 
246  samplecnt_t pixel_duration_to_samples (double pixels) const {
247  return pixels * samples_per_pixel;
248  }
249 
250  /* These two convert between timeline-relative x-axis pixel positions and
251  * global canvas ones.
252  */
253 
254  double timeline_to_canvas (double p) const { return p + _timeline_origin; }
255  double canvas_to_timeline (double p) const { return p - _timeline_origin; }
256 
262  Temporal::timepos_t canvas_event_time (GdkEvent const*, double* px = 0, double* py = 0) const;
263 
267  samplepos_t canvas_event_sample (GdkEvent const * event, double* pcx = nullptr, double* pcy = nullptr) const;
268 
269  virtual bool canvas_note_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
271  virtual bool canvas_velocity_event (GdkEvent* event, ArdourCanvas::Item*) = 0;
273  virtual bool canvas_cue_start_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
274  virtual bool canvas_cue_end_event (GdkEvent* event, ArdourCanvas::Item*) { return true; }
275 
278 
280  int32_t get_grid_music_divisions (Editing::GridType gt, uint32_t event_state) const;
281 
284  bool grid_musical () const;
285 
291 
295 
297  int draw_velocity () const;
298  int draw_channel () const;
299 
301 
302  virtual void snap_to (Temporal::timepos_t & first,
305  bool ensure_snap = false) const;
306 
308  GdkEvent const* ev,
311  bool ensure_snap = false) const;
312 
314  Temporal::RoundMode direction,
315  ARDOUR::SnapPref gpref) const;
316 
317  virtual double get_y_origin () const = 0;
318 
320  void reset_y_origin (double);
322  virtual void set_samples_per_pixel (samplecnt_t) = 0;
323  virtual void on_samples_per_pixel_changed () {}
324 
325  virtual void cycle_zoom_focus ();
326  virtual void set_zoom_focus (Editing::ZoomFocus) = 0;
328  sigc::signal<void> ZoomFocusChanged;
329 
330  virtual void reposition_and_zoom (samplepos_t, double) = 0;
331 
332  sigc::signal<void> ZoomChanged;
333 
334  virtual Selection& get_selection() const { return *selection; }
335  virtual Selection& get_cut_buffer () const { return *cut_buffer; }
336 
338 
344  virtual void set_mouse_mode (Editing::MouseMode, bool force = false);
348  virtual void step_mouse_mode (bool next) = 0;
354 
356  virtual bool internal_editing() const = 0;
357 
358  virtual bool get_smart_mode() const { return false; }
359 
362 
363  struct CursorRAII {
365  : ec (e), old_cursor (ec.get_canvas_cursor ()) { ec.set_canvas_cursor (new_cursor); }
367 
370  };
371 
372  virtual Gdk::Cursor* get_canvas_cursor () const;
373  static MouseCursors const* cursors () {
374  return _cursors;
375  }
376  virtual VerboseCursor* verbose_cursor () const {
377  return _verbose_cursor;
378  }
379 
380  virtual void set_snapped_cursor_position (Temporal::timepos_t const & pos) = 0;
381 
382  static sigc::signal<void> DropDownKeys;
383 
386 
387  /* MIDI actions, proxied to selected MidiRegionView(s) */
391  virtual void midi_action (void (MidiView::*method)());
392  std::vector<MidiView*> filter_to_unique_midi_region_views (RegionSelection const & ms) const;
393 
396  void legatize_region (bool shrink_only);
398 
401 
403 
408  virtual bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*) { return false; }
409 
411 
412  void set_horizontal_position (double);
413  double horizontal_position () const;
414 
415  virtual samplecnt_t current_page_samples() const = 0;
416 
418  virtual ArdourCanvas::GtkCanvas* get_canvas() const = 0;
419 
421 
423  void pre_render ();
424 
426 
427  virtual Gdk::Cursor* which_track_cursor () const = 0;
428  virtual Gdk::Cursor* which_mode_cursor () const = 0;
429  virtual Gdk::Cursor* which_trim_cursor (bool left_side) const = 0;
430  virtual Gdk::Cursor* which_canvas_cursor (ItemType type) const = 0;
431 
435  void undo (uint32_t n = 1) { do_undo (n); }
436 
440  void redo (uint32_t n = 1) { do_redo (n); }
441 
442  virtual void history_changed() = 0;
444 
447 
449 
453  samplepos_t window_event_sample (GdkEvent const*, double* px = 0, double* py = 0) const;
454 
455  /* returns false if mouse pointer is not in track or marker canvas
456  */
457  bool mouse_sample (samplepos_t&, bool& in_track_canvas) const;
458 
459  protected:
460  std::string _name;
462 
463  static Glib::RefPtr<Gtk::ActionGroup> _midi_actions;
464  static Glib::RefPtr<Gtk::ActionGroup> _common_actions;
465 
470 
471  static std::vector<std::string> grid_type_strings;
472 
473  Glib::RefPtr<Gtk::RadioAction> grid_type_action (Editing::GridType);
474  Glib::RefPtr<Gtk::RadioAction> snap_mode_action (Editing::SnapMode);
475 
476  static Glib::RefPtr<Gtk::RadioAction> draw_length_action (Editing::GridType);
477  static Glib::RefPtr<Gtk::RadioAction> draw_velocity_action (int);
478  static Glib::RefPtr<Gtk::RadioAction> draw_channel_action (int);
479 
482 
484  static int _draw_velocity;
485  static int _draw_channel;
486 
487  static void draw_channel_chosen (int);
488  static void draw_velocity_chosen (int);
490 
491  static void draw_channel_action_method (int);
492  static void draw_velocity_action_method (int);
494 
495  static sigc::signal<void> DrawLengthChanged;
496  static sigc::signal<void> DrawVelocityChanged;
497  static sigc::signal<void> DrawChannelChanged;
498 
502 
504 
507 
512 
517 
524 
526  virtual void note_mode_clicked() {}
527  virtual void follow_playhead_clicked ();
528  virtual void full_zoom_clicked() {};
529  virtual void set_visible_channel (int) {}
530 
532 
535 
537  virtual void update_tempo_based_rulers () {};
538  virtual void show_rulers_for_grid () {};
539 
541 
542  /* playhead and edit cursor */
543 
546 
549 
550  /* selection process */
551 
555 
556  std::list<XMLNode*> before; /* used in *_reversible_command */
557 
559 
561 
565 
567  Temporal::RoundMode direction,
568  ARDOUR::SnapPref gpref,
570 
572  Temporal::RoundMode direction,
573  ARDOUR::SnapPref gpref) const = 0;
574 
575  virtual void snap_to_internal (Temporal::timepos_t& first,
578  bool ensure_snap = false) const = 0;
579 
581  virtual double visible_canvas_width() const = 0;
582 
595  };
596 
598  uint32_t bbt_bars;
600 
601  uint32_t count_bars (Temporal::Beats const & start, Temporal::Beats const & end) const;
603 
607 
609 
610  friend struct TempoMapScope;
611  virtual std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>);
612  virtual void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>) { /* no-op by default */ }
613 
620  virtual bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false) = 0;
625 
628 
631 
633 
636 
638  void legatize_regions (const RegionSelection& rs, bool shrink_only);
641 
643  friend class EditorSummary;
646 
654 
655  Glib::RefPtr<Gtk::ActionGroup> editor_actions;
656  virtual void register_actions() = 0;
658 
659  Glib::RefPtr<Gtk::Action> get_mouse_mode_action (Editing::MouseMode m) const;
662  virtual void add_mouse_mode_actions (Glib::RefPtr<Gtk::ActionGroup>) {}
663 
667 
670 
671  void pack_draw_box ();
672  void pack_snap_box ();
673 
675 
677 
678  void set_common_editing_state (XMLNode const & node);
679  void get_common_editing_state (XMLNode& node) const;
680 
681  struct VisualChange {
682  enum Type {
683  TimeOrigin = 0x1,
684  ZoomLevel = 0x2,
685  YOrigin = 0x4,
686  VideoTimeline = 0x8
687  };
688 
692  double y_origin;
693 
697 
699  void add (Type t) {
700  pending = Type (pending | t);
701  }
702  };
703 
706 
707  static int _idle_visual_changer (void* arg);
710  virtual void visual_changer (const VisualChange&) = 0;
711 
712  sigc::connection autoscroll_connection;
715  uint32_t autoscroll_cnt;
717 
719  virtual void parameter_changed (std::string);
720  virtual void ui_parameter_changed (std::string);
721 
729 
731 
732  virtual void set_entered_track (TimeAxisView*) {};
733 
734  virtual std::pair<Temporal::timepos_t,Temporal::timepos_t> max_zoom_extent() const = 0;
735 
737  bool use_context_click,
738  bool from_outside_canvas) = 0;
739 
741  virtual void escape () {}
742 
743  virtual void do_undo (uint32_t n) = 0;
744  virtual void do_redo (uint32_t n) = 0;
745 
746  static Glib::RefPtr<Gtk::Action> undo_action;
747  static Glib::RefPtr<Gtk::Action> redo_action;
748  static Glib::RefPtr<Gtk::Action> alternate_redo_action;
749  static Glib::RefPtr<Gtk::Action> alternate_alternate_redo_action;
750 
751  /* protected helper functions to help with registering actions */
752 
753  static Glib::RefPtr<Gtk::Action> reg_sens (Glib::RefPtr<Gtk::ActionGroup> group, char const* name, char const* label, sigc::slot<void> slot);
754  static void toggle_reg_sens (Glib::RefPtr<Gtk::ActionGroup> group, char const* name, char const* label, sigc::slot<void> slot);
755  static void radio_reg_sens (Glib::RefPtr<Gtk::ActionGroup> action_group, Gtk::RadioAction::Group& radio_group, char const* name, char const* label, sigc::slot<void> slot);
756 
758 
759 };
virtual samplecnt_t current_page_samples() const =0
void set_draw_channel_to(int)
virtual void abort_reversible_command()=0
VisualChange pending_visual_change
virtual Gdk::Cursor * which_canvas_cursor(ItemType type) const =0
PBD::Signal< void()> MouseModeChanged
virtual std::list< SelectableOwner * > selectable_owners()=0
ArdourWidgets::ArdourDropdown grid_type_selector
void reset_point_selection()
void reset_zoom(samplecnt_t)
void calc_extra_zoom_edges(samplepos_t &start, samplepos_t &end)
double sample_to_pixel(samplepos_t sample) const
static int _draw_channel
PBD::ScopedConnection escape_connection
void bind_mouse_mode_buttons()
virtual bool canvas_cue_end_event(GdkEvent *event, ArdourCanvas::Item *)
Glib::RefPtr< Gtk::Action > get_mouse_mode_action(Editing::MouseMode m) const
void quantize_regions(const RegionSelection &rs)
void toggle_follow_playhead()
static Glib::RefPtr< Gtk::RadioAction > draw_channel_action(int)
Gtkmm2ext::Bindings * bindings
virtual Temporal::timepos_t snap_to_grid(Temporal::timepos_t const &start, Temporal::RoundMode direction, ARDOUR::SnapPref gpref) const =0
static Glib::RefPtr< Gtk::Action > undo_action
virtual void begin_reversible_command(std::string cmd_name)=0
virtual Temporal::timepos_t _get_preferred_edit_position(Editing::EditIgnoreOption, bool use_context_click, bool from_outside_canvas)=0
virtual void set_visible_channel(int)
bool follow_playhead() const
virtual bool canvas_control_point_event(GdkEvent *event, ArdourCanvas::Item *, ControlPoint *)=0
void temporal_zoom_step_mouse_focus_scale(bool zoom_out, double scale)
static MouseCursors const * cursors()
virtual void undo_selection_op()=0
void transform_region()
virtual bool enter_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
static void register_common_actions(Gtkmm2ext::Bindings *)
void snap_mode_selection_done(Editing::SnapMode)
QuantizeDialog * quantize_dialog
virtual bool canvas_velocity_event(GdkEvent *event, ArdourCanvas::Item *)=0
void undo(uint32_t n=1)
void temporal_zoom_step_mouse_focus(bool zoom_out)
Gtk::Adjustment vertical_adjustment
static Glib::RefPtr< Gtk::Action > reg_sens(Glib::RefPtr< Gtk::ActionGroup > group, char const *name, char const *label, sigc::slot< void > slot)
virtual std::pair< Temporal::timepos_t, Temporal::timepos_t > max_zoom_extent() const =0
Gtk::Adjustment horizontal_adjustment
samplepos_t pixel_to_sample_from_event(double pixel) const
samplepos_t pixel_to_sample(double pixel) const
static void draw_velocity_chosen(int)
bool autoscroll_horizontal_allowed
virtual RegionSelection region_selection()=0
Editing::ZoomFocus zoom_focus() const
virtual Selection & get_selection() const
virtual bool autoscroll_active() const =0
virtual void get_regionviews_by_id(PBD::ID const id, RegionSelection &regions) const =0
void set_grid_to(Editing::GridType)
virtual bool key_press_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
virtual ArdourCanvas::ScrollGroup * get_cursor_scroll_group() const =0
ArdourWidgets::ArdourButton follow_playhead_button
virtual bool button_press_dispatch(GdkEventButton *)=0
void transform_regions(const RegionSelection &rs)
samplecnt_t get_current_zoom() const
virtual TrackViewList axis_views_from_routes(std::shared_ptr< ARDOUR::RouteList >) const =0
virtual ArdourCanvas::GtkCanvas * get_canvas() const =0
Selection * selection
virtual void begin_reversible_selection_op(std::string cmd_name)=0
bool mouse_sample(samplepos_t &, bool &in_track_canvas) const
uint32_t autoscroll_cnt
void register_mouse_mode_actions()
bool _mouse_changed_selection
ArdourWidgets::ArdourButton note_mode_button
virtual void register_actions()=0
Glib::RefPtr< Gtk::RadioAction > grid_type_action(Editing::GridType)
samplecnt_t samples_per_pixel
Editing::GridType pre_internal_grid_type
virtual bool leave_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
virtual bool canvas_cue_start_event(GdkEvent *event, ArdourCanvas::Item *)
virtual void do_redo(uint32_t n)=0
static std::vector< std::string > grid_type_strings
static Glib::RefPtr< Gtk::ActionGroup > _midi_actions
static sigc::signal< void > DropDownKeys
void transpose_region()
virtual ARDOUR::Location * find_location_from_marker(ArdourMarker *, bool &) const =0
double _track_canvas_width
void set_common_editing_state(XMLNode const &node)
virtual void mouse_mode_toggled(Editing::MouseMode)=0
static void draw_length_chosen(Editing::GridType)
void select_automation_line(GdkEventButton *, ArdourCanvas::Item *, ARDOUR::SelectionOperation)
virtual void set_selected_midi_region_view(MidiRegionView &)
Gtk::HBox snap_box
Gtk::HBox draw_box
virtual void snap_to_internal(Temporal::timepos_t &first, Temporal::RoundMode direction=Temporal::RoundNearest, ARDOUR::SnapPref gpref=ARDOUR::SnapToAny_Visual, bool ensure_snap=false) const =0
virtual ArdourCanvas::Container * get_noscroll_group() const =0
virtual void play_note_selection_clicked()
static EditingContext * current_editing_context()
void draw_velocity_changed()
static int _draw_velocity
Gtk::Label visible_channel_label
static void draw_velocity_action_method(int)
virtual double get_y_origin() const =0
SelectionMemento * _selection_memento
virtual PBD::HistoryOwner & history()=0
Temporal::timecnt_t snap_relative_time_to_relative_time(Temporal::timepos_t const &origin, Temporal::timecnt_t const &x, bool ensure_snap) const
void temporal_zoom_step_scale(bool zoom_out, double scale)
virtual bool canvas_playhead_cursor_event(GdkEvent *event, ArdourCanvas::Item *)
samplecnt_t pixel_duration_to_samples(double pixels) const
ArdourMarker * entered_marker
ArdourWidgets::ArdourButton mouse_cut_button
virtual bool button_release_dispatch(GdkEventButton *)=0
Editing::GridType internal_grid_type
EditorCursor * _playhead_cursor
static void update_undo_redo_actions(PBD::UndoHistory const &)
virtual void full_zoom_clicked()
virtual Gdk::Cursor * which_trim_cursor(bool left_side) const =0
static Glib::RefPtr< Gtk::RadioAction > draw_length_action(Editing::GridType)
EditorCursor * _snapped_cursor
static EditingContext * _current_editing_context
void apply_midi_note_edit_op(ARDOUR::MidiOperator &op, const RegionSelection &rs)
ARDOUR::Quantize * get_quantize_op()
ArdourWidgets::ArdourButton mouse_select_button
virtual void step_mouse_mode(bool next)=0
void edit_notes(MidiView *)
virtual Gdk::Cursor * which_mode_cursor() const =0
double horizontal_position() const
void quantize_region()
double duration_to_pixels_unrounded(Temporal::timecnt_t const &pos) const
int32_t get_grid_music_divisions(Editing::GridType gt, uint32_t event_state) const
ArdourCanvas::Rectangle * rubberband_rect
std::list< XMLNode * > before
virtual void ui_parameter_changed(std::string)
double time_to_pixel(Temporal::timepos_t const &pos) const
sigc::signal< void > ZoomFocusChanged
void next_grid_choice()
virtual void redisplay_grid(bool immediate_redraw)=0
Editing::GridType _grid_type
bool snap_mode_button_clicked(GdkEventButton *)
sigc::connection autoscroll_connection
EditingContext(std::string const &)
Temporal::timepos_t canvas_event_time(GdkEvent const *, double *px=0, double *py=0) const
std::string _name
virtual bool button_press_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
virtual Gdk::Cursor * get_canvas_cursor() const
virtual ArdourCanvas::Duple upper_left() const
virtual void mark_region_boundary_cache_dirty()
void temporal_zoom(samplecnt_t samples_per_pixel)
double time_to_pixel_unrounded(Temporal::timepos_t const &pos) const
virtual void set_entered_track(TimeAxisView *)
void legatize_region(bool shrink_only)
static sigc::signal< void > DrawLengthChanged
VerboseCursor * _verbose_cursor
Gtk::HBox grid_box
virtual void begin_reversible_command(GQuark)=0
static Glib::RefPtr< Gtk::RadioAction > draw_velocity_action(int)
samplepos_t _leftmost_sample
virtual void select_all_within(Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, std::list< SelectableOwner * > const &, ARDOUR::SelectionOperation, bool)=0
virtual Selection & get_cut_buffer() const
virtual void abort_reversible_selection_op()=0
void set_draw_length_to(Editing::GridType)
void prev_grid_choice()
ArdourWidgets::ArdourButton mouse_draw_button
ArdourWidgets::ArdourButton play_note_selection_button
PBD::ScopedConnectionList parameter_connections
ArdourWidgets::ArdourButton mouse_move_button
Temporal::timepos_t get_preferred_edit_position(Editing::EditIgnoreOption eio=Editing::EDIT_IGNORE_NONE, bool use_context_click=false, bool from_outside_canvas=false)
void choose_canvas_cursor_on_entry(ItemType)
ArdourWidgets::ArdourButton mouse_grid_button
virtual bool canvas_note_event(GdkEvent *event, ArdourCanvas::Item *)=0
virtual bool key_release_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
samplepos_t window_event_sample(GdkEvent const *, double *px=0, double *py=0) const
bool grid_type_is_musical(Editing::GridType) const
Selection * cut_buffer
virtual void set_mouse_mode(Editing::MouseMode, bool force=false)
void register_grid_actions()
DragManager * _drags
virtual void add_mouse_mode_actions(Glib::RefPtr< Gtk::ActionGroup >)
sigc::signal< void > ZoomChanged
bool autoscroll_vertical_allowed
virtual void begin_selection_op_history()=0
virtual StripableTimeAxisView * get_stripable_time_axis_by_id(const PBD::ID &id) const =0
virtual bool button_release_handler(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
void reset_x_origin(samplepos_t)
virtual void set_zoom_focus(Editing::ZoomFocus)=0
Editing::SnapMode pre_internal_snap_mode
virtual void cycle_zoom_focus()
void temporal_zoom_step(bool zoom_out)
virtual bool canvas_velocity_base_event(GdkEvent *event, ArdourCanvas::Item *)=0
static void draw_channel_chosen(int)
virtual void snap_to(Temporal::timepos_t &first, Temporal::RoundMode direction=Temporal::RoundNearest, ARDOUR::SnapPref pref=ARDOUR::SnapToAny_Visual, bool ensure_snap=false) const
uint32_t count_bars(Temporal::Beats const &start, Temporal::Beats const &end) const
virtual ArdourCanvas::Container * get_trackview_group() const =0
std::vector< MidiView * > filter_to_unique_midi_region_views(RegionSelection const &ms) const
virtual void add_command(PBD::Command *)=0
EditorCursor * snapped_cursor() const
int idle_visual_changer()
virtual Gdk::Cursor * which_track_cursor() const =0
double _visible_canvas_width
Editing::SnapMode _snap_mode
void legatize_regions(const RegionSelection &rs, bool shrink_only)
void check_best_snap(Temporal::timepos_t const &presnap, Temporal::timepos_t &test, Temporal::timepos_t &dist, Temporal::timepos_t &best) const
void draw_channel_changed()
PBD::Signal< void()> SnapChanged
virtual void instant_save()=0
virtual bool get_smart_mode() const
void grid_type_selection_done(Editing::GridType)
virtual void reposition_and_zoom(samplepos_t, double)=0
virtual void commit_reversible_command()=0
virtual Temporal::timepos_t snap_to_bbt(Temporal::timepos_t const &start, Temporal::RoundMode direction, ARDOUR::SnapPref gpref) const
virtual Temporal::timecnt_t get_nudge_distance(Temporal::timepos_t const &pos, Temporal::timecnt_t &next) const =0
static void draw_channel_action_method(int)
virtual std::shared_ptr< Temporal::TempoMap const > start_local_tempo_map(std::shared_ptr< Temporal::TempoMap >)
ArdourWidgets::ArdourDropdown draw_length_selector
ArdourWidgets::ArdourButton mouse_content_button
virtual void update_tempo_based_rulers()
static int _idle_visual_changer(void *arg)
virtual void maybe_autoscroll(bool, bool, bool from_headers)=0
virtual void commit_reversible_selection_op()=0
void set_horizontal_position(double)
void set_draw_velocity_to(int)
Editing::MouseMode current_mouse_mode() const
Editing::GridType grid_type() const
static void radio_reg_sens(Glib::RefPtr< Gtk::ActionGroup > action_group, Gtk::RadioAction::Group &radio_group, char const *name, char const *label, sigc::slot< void > slot)
static void switch_editing_context(EditingContext *)
virtual void set_samples_per_pixel(samplecnt_t)=0
double timeline_to_canvas(double p) const
ArdourWidgets::ArdourVSpacer _grid_box_spacer
static Gtkmm2ext::Bindings * button_bindings
void build_draw_midi_menus()
virtual void midi_action(void(MidiView::*method)())
virtual ArdourCanvas::ScrollGroup * get_hscroll_group() const =0
static Editing::GridType _draw_length
void note_edit_done(int, EditNoteDialog *)
virtual bool internal_editing() const =0
static void draw_length_action_method(Editing::GridType)
virtual void redo_selection_op()=0
void draw_length_changed()
void cycle_snap_mode()
virtual Editing::ZoomFocus effective_zoom_focus() const
bool preview_video_drag_active() const
virtual ArdourCanvas::GtkCanvasViewport * get_canvas_viewport() const =0
void grid_type_chosen(Editing::GridType)
void snap_mode_chosen(Editing::SnapMode)
ArdourWidgets::ArdourDropdown draw_velocity_selector
void transpose_regions(const RegionSelection &rs)
virtual VerboseCursor * verbose_cursor() const
virtual void escape()
virtual void follow_playhead_clicked()
bool typed_event(ArdourCanvas::Item *, GdkEvent *, ItemType)
bool grid_musical() const
void compute_bbt_ruler_scale(samplepos_t lower, samplepos_t upper)
void temporal_zoom_by_sample(samplepos_t start, samplepos_t end)
virtual Editing::MouseMode effective_mouse_mode() const
ArdourWidgets::ArdourVSpacer _draw_box_spacer
Temporal::timecnt_t relative_distance(Temporal::timepos_t const &origin, Temporal::timecnt_t const &duration, Temporal::TimeDomain domain)
ArdourWidgets::ArdourButton snap_mode_button
PBD::Command * apply_midi_note_edit_op_to_region(ARDOUR::MidiOperator &op, MidiView &mrv)
Gtk::Menu _note_context_menu
virtual void set_snapped_cursor_position(Temporal::timepos_t const &pos)=0
samplepos_t canvas_event_sample(GdkEvent const *event, double *pcx=nullptr, double *pcy=nullptr) const
void pack_snap_box()
DragManager * drags() const
double _visible_canvas_height
height of the visible area of the track canvas
Editing::SnapMode snap_mode() const
int32_t get_grid_beat_divisions(Editing::GridType gt) const
double duration_to_pixels(Temporal::timecnt_t const &pos) const
static Glib::RefPtr< Gtk::ActionGroup > _common_actions
Editing::ZoomFocus _zoom_focus
double time_delta_to_pixel(Temporal::timepos_t const &start, Temporal::timepos_t const &end) const
ArdourWidgets::ArdourDropdown draw_channel_selector
Temporal::Beats get_grid_type_as_beats(bool &success, Temporal::timepos_t const &position) const
virtual void parameter_changed(std::string)
XMLNode * button_settings() const
virtual void on_samples_per_pixel_changed()
double sample_to_pixel_unrounded(samplepos_t sample) const
virtual void get_per_region_note_selection(std::list< std::pair< PBD::ID, std::set< std::shared_ptr< Evoral::Note< Temporal::Beats > > > > > &) const =0
void popup_note_context_menu(ArdourCanvas::Item *, GdkEvent *)
virtual void note_mode_clicked()
virtual ArdourMarker * find_marker_from_location_id(PBD::ID const &, bool) const =0
std::string editor_name() const
Temporal::Beats get_draw_length_as_beats(bool &success, Temporal::timepos_t const &position) const
virtual bool button_press_handler_2(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
virtual double visible_canvas_width() const =0
Glib::RefPtr< Gtk::ActionGroup > editor_actions
BBTRulerScale bbt_ruler_scale
virtual void do_undo(uint32_t n)=0
ArdourWidgets::ArdourButton mouse_timefx_button
RegionView * entered_regionview
virtual void reset_x_origin_to_follow_playhead()=0
virtual void snap_to_with_modifier(Temporal::timepos_t &first, GdkEvent const *ev, Temporal::RoundMode direction=Temporal::RoundNearest, ARDOUR::SnapPref gpref=ARDOUR::SnapToAny_Visual, bool ensure_snap=false) const
static sigc::signal< void > DrawChannelChanged
virtual void set_canvas_cursor(Gdk::Cursor *)
bool on_velocity_scroll_event(GdkEventScroll *)
ArdourWidgets::ArdourButton full_zoom_button
Glib::RefPtr< Gtk::RadioAction > snap_mode_action(Editing::SnapMode)
void set_session(ARDOUR::Session *)
int draw_channel() const
void ensure_visual_change_idle_handler()
ArdourCanvas::Rect autoscroll_boundary
EditorCursor * playhead_cursor() const
ArdourWidgets::ArdourDropdown visible_channel_selector
TimeAxisView * entered_track
double timeline_origin() const
Temporal::timepos_t _snap_to_bbt(Temporal::timepos_t const &start, Temporal::RoundMode direction, ARDOUR::SnapPref gpref, Editing::GridType grid_type) const
void reset_y_origin(double)
virtual MeterMarker * find_marker_for_meter(Temporal::MeterPoint const &)=0
void get_common_editing_state(XMLNode &node) const
virtual void end_local_tempo_map(std::shared_ptr< Temporal::TempoMap const >)
Editing::GridType draw_length() const
Temporal::TimeDomain time_domain() const
Editing::SnapMode internal_snap_mode
uint32_t bbt_bar_helper_on
Editing::MouseMode mouse_mode
static void toggle_reg_sens(Glib::RefPtr< Gtk::ActionGroup > group, char const *name, char const *label, sigc::slot< void > slot)
static Glib::RefPtr< Gtk::Action > redo_action
void redo(uint32_t n=1)
virtual void visual_changer(const VisualChange &)=0
virtual void history_changed()=0
static Glib::RefPtr< Gtk::Action > alternate_redo_action
void set_snap_mode(Editing::SnapMode)
static MouseCursors * _cursors
bool drag_active() const
void pack_draw_box()
void set_follow_playhead(bool yn, bool catch_up=true)
virtual void show_rulers_for_grid()
void build_grid_type_menu()
double canvas_to_timeline(double p) const
virtual bool button_press_handler_1(ArdourCanvas::Item *, GdkEvent *, ItemType)=0
int draw_velocity() const
void temporal_zoom_to_sample(bool coarser, samplepos_t sample)
virtual bool motion_handler(ArdourCanvas::Item *, GdkEvent *, bool from_autoscroll=false)=0
static sigc::signal< void > DrawVelocityChanged
static void register_midi_actions(Gtkmm2ext::Bindings *)
virtual void stop_canvas_autoscroll()=0
static Glib::RefPtr< Gtk::Action > alternate_alternate_redo_action
virtual TempoMarker * find_marker_for_tempo(Temporal::TempoPoint const &)=0
Definition: id.h:34
Lists of selected things.
Definition: xml++.h:114
ItemType
Definition: editor_items.h:24
GtkImageIconNameData name
Definition: gtkimage.h:6
PBD::PropertyDescriptor< bool > regions
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t
SnapMode
Definition: editing.h:70
GridType
Definition: editing.h:52
EditIgnoreOption
Definition: editing.h:241
@ EDIT_IGNORE_NONE
Definition: editing.h:242
ZoomFocus
Definition: editing.h:126
MouseMode
Definition: editing.h:98
@ RoundNearest
Round to nearest.
CursorRAII(EditingContext &e, Gdk::Cursor *new_cursor)
std::shared_ptr< Temporal::TempoMap const > old_map
TempoMapScope(EditingContext &context, std::shared_ptr< Temporal::TempoMap > map)