}
double sample_to_pixel (framepos_t sample) const {
- return sample / samples_per_pixel;
+ return round (sample / (double) samples_per_pixel);
}
double sample_to_pixel_unrounded (framepos_t sample) const {
/* selection */
Selection& get_selection() const { return *selection; }
+ bool get_selection_extents ( framepos_t &start, framepos_t &end ); // the time extents of the current selection, whether Range, Region(s), Control Points, or Notes
Selection& get_cut_buffer() const { return *cut_buffer; }
void track_mixer_selection ();
framecnt_t get_nudge_distance (framepos_t pos, framecnt_t& next);
framecnt_t get_paste_offset (framepos_t pos, unsigned paste_count, framecnt_t duration);
- Evoral::MusicalTime get_grid_type_as_beats (bool& success, framepos_t position);
+ unsigned get_grid_beat_divisions(framepos_t position);
+ Evoral::Beats get_grid_type_as_beats (bool& success, framepos_t position);
void nudge_forward (bool next, bool force_playhead);
void nudge_backward (bool next, bool force_playhead);
void scroll_tracks_down_line ();
void scroll_tracks_up_line ();
- bool scroll_up_one_track ();
- bool scroll_down_one_track ();
+ bool scroll_up_one_track (bool skip_child_views = false);
+ bool scroll_down_one_track (bool skip_child_views = false);
void prepare_for_cleanup ();
void finish_cleanup ();
void reset_zoom (framecnt_t);
void reposition_and_zoom (framepos_t, double);
- framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool use_context_click = false);
+ framepos_t get_preferred_edit_position (bool ignore_playhead = false,
+ bool use_context_click = false,
+ bool from_outside_canvas = false);
bool update_mouse_speed ();
bool decelerate_mouse_speed ();
void get_regions_corresponding_to (boost::shared_ptr<ARDOUR::Region> region, std::vector<RegionView*>& regions, bool src_comparison);
- void get_regionviews_by_id (PBD::ID const & id, RegionSelection & regions) const;
+ void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const;
+ void get_per_region_note_selection (std::list<std::pair<PBD::ID, std::set<boost::shared_ptr<Evoral::Note<Evoral::Beats> > > > >&) const;
void center_screen (framepos_t);
ARDOUR::RoundMode direction = ARDOUR::RoundNearest,
bool for_mark = false);
+ void begin_selection_op_history ();
+ void begin_reversible_selection_op (std::string cmd_name);
+ void commit_reversible_selection_op ();
+ void undo_selection_op ();
+ void redo_selection_op ();
void begin_reversible_command (std::string cmd_name);
void begin_reversible_command (GQuark);
+ void abort_reversible_command ();
void commit_reversible_command ();
DragManager* drags () const {
_stepping_axis_view = v;
}
- ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; }
- ArdourCanvas::Container* get_noscroll_group () const { return no_scroll_group; }
- ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
- ArdourCanvas::ScrollGroup* get_vscroll_group () const { return v_scroll_group; }
- ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; }
+ ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; }
+ ArdourCanvas::Container* get_noscroll_group () const { return no_scroll_group; }
+ ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
+ ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; }
+ ArdourCanvas::ScrollGroup* get_cursor_scroll_group () const { return cursor_scroll_group; }
- ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
+ ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
- void override_visible_track_count ();
+ void override_visible_track_count ();
/* Ruler metrics methods */
void set_samples_per_pixel (framecnt_t);
Editing::MouseMode mouse_mode;
- Editing::MouseMode pre_internal_mouse_mode;
Editing::SnapType pre_internal_snap_type;
Editing::SnapMode pre_internal_snap_mode;
Editing::SnapType internal_snap_type;
void hide_marker (ArdourCanvas::Item*, GdkEvent*);
void clear_marker_display ();
void mouse_add_new_range (framepos_t);
+ void mouse_add_new_loop (framepos_t);
+ void mouse_add_new_punch (framepos_t);
bool choose_new_marker_name(std::string &name);
void update_cd_marker_display ();
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
void button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type);
bool button_release_can_deselect;
+ bool _mouse_changed_selection;
void catch_vanishing_regionview (RegionView *);
void set_selected_track (TimeAxisView&, Selection::Operation op = Selection::Set, bool no_remove=false);
void select_all_tracks ();
- void select_all_internal_edit (Selection::Operation);
+ bool select_all_internal_edit (Selection::Operation);
bool set_selected_control_point_from_click (bool press, Selection::Operation op = Selection::Set);
void set_selected_track_from_click (bool press, Selection::Operation op = Selection::Set, bool no_remove=false);
void popup_control_point_context_menu (ArdourCanvas::Item *, GdkEvent *);
Gtk::Menu _control_point_context_menu;
+ void popup_note_context_menu (ArdourCanvas::Item *, GdkEvent *);
+ Gtk::Menu _note_context_menu;
+
void add_routes (ARDOUR::RouteList&);
void timeaxisview_deleted (TimeAxisView *);
/* The group containing all other groups that are scrolled vertically
and horizontally.
*/
- ArdourCanvas::ScrollGroup* hv_scroll_group;
+ ArdourCanvas::ScrollGroup* hv_scroll_group;
- /* The group containing all other groups that are scrolled vertically ONLY
+ /* The group containing all other groups that are scrolled horizontally ONLY
*/
- ArdourCanvas::ScrollGroup* v_scroll_group;
+ ArdourCanvas::ScrollGroup* h_scroll_group;
- /* The group containing all other groups that are scrolled horizontally ONLY
+ /* Scroll group for cursors, scrolled horizontally, above everything else
*/
- ArdourCanvas::ScrollGroup* h_scroll_group;
+ ArdourCanvas::ScrollGroup* cursor_scroll_group;
/* The group containing all trackviews. */
ArdourCanvas::Container* no_scroll_group;
ArdourCanvas::Ruler* samples_ruler;
ArdourCanvas::Ruler* minsec_ruler;
- static const double timebar_height;
+ static double timebar_height;
guint32 visible_timebars;
Gtk::Menu *editor_ruler_menu;
void toggle_ruler_video (bool onoff) {ruler_video_action->set_active(onoff);}
int videotl_bar_height; /* in units of timebar_height; default: 4 */
int get_videotl_bar_height () const { return videotl_bar_height; }
- void export_video (bool range = false);
void toggle_region_video_lock ();
friend class EditorCursor;
void cut_copy (Editing::CutCopyOp);
bool can_cut_copy () const;
- void cut_copy_points (Editing::CutCopyOp, Evoral::MusicalTime earliest=Evoral::MusicalTime(), bool midi=false);
+ void cut_copy_points (Editing::CutCopyOp, Evoral::Beats earliest=Evoral::Beats(), bool midi=false);
void cut_copy_regions (Editing::CutCopyOp, RegionSelection&);
void cut_copy_ranges (Editing::CutCopyOp);
void cut_copy_midi (Editing::CutCopyOp);
void reset_region_scale_amplitude ();
void adjust_region_gain (bool up);
void quantize_region ();
+ void quantize_regions (const RegionSelection& rs);
void legatize_region (bool shrink_only);
+ void legatize_regions (const RegionSelection& rs, bool shrink_only);
+ void transform_region ();
+ void transform_regions (const RegionSelection& rs);
void insert_patch_change (bool from_context);
void fork_region ();
void set_session_extents_from_selection ();
- void set_loop_from_edit_range (bool play);
void set_loop_from_region (bool play);
- void set_punch_from_edit_range ();
void set_loop_range (framepos_t start, framepos_t end, std::string cmd);
void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
void edit_tempo_marker (TempoMarker&);
void edit_meter_marker (MeterMarker&);
void edit_control_point (ArdourCanvas::Item*);
- void edit_notes (TimeAxisViewItem&);
+ void edit_notes (MidiRegionView*);
void marker_menu_edit ();
void marker_menu_remove ();
void write_selection ();
+ uint32_t selection_op_cmd_depth;
+ uint32_t selection_op_history_it;
+
+ std::list<XMLNode *> selection_op_history; /* used in *_reversible_selection_op */
std::list<XMLNode *> before; /* used in *_reversible_command */
void update_title ();
void apply_filter (ARDOUR::Filter&, std::string cmd, ProgressReporter* progress = 0);
Command* apply_midi_note_edit_op_to_region (ARDOUR::MidiOperator& op, MidiRegionView& mrv);
- void apply_midi_note_edit_op (ARDOUR::MidiOperator& op);
+ void apply_midi_note_edit_op (ARDOUR::MidiOperator& op, const RegionSelection& rs);
/* handling cleanup */
Glib::RefPtr<Gtk::Action> undo_action;
Glib::RefPtr<Gtk::Action> redo_action;
+ Glib::RefPtr<Gtk::Action> alternate_redo_action;
+ Glib::RefPtr<Gtk::Action> alternate_alternate_redo_action;
+ Glib::RefPtr<Gtk::Action> selection_undo_action;
+ Glib::RefPtr<Gtk::Action> selection_redo_action;
void history_changed ();
RhythmFerret* rhythm_ferret;
void fit_tracks (TrackViewList &);
- void fit_selected_tracks ();
+ void fit_selection ();
void set_track_height (Height);
void remove_tracks ();