Ardour  9.0-pre0-582-g084a23a80d
cue_editor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include "pbd/history_owner.h"
22 
23 #include "editing.h"
24 #include "editing_context.h"
25 
26 class CueEditor : public EditingContext, public PBD::HistoryOwner, public sigc::trackable
27 {
28  public:
29  CueEditor (std::string const & name);
31 
32  void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, std::list<SelectableOwner*> const &, ARDOUR::SelectionOperation, bool);
33 
36  TrackViewList axis_views_from_routes (std::shared_ptr<ARDOUR::RouteList>) const;
37  AxisView* axis_view_by_stripable (std::shared_ptr<ARDOUR::Stripable>) const { return nullptr; }
38  AxisView* axis_view_by_control (std::shared_ptr<ARDOUR::AutomationControl>) const { return nullptr; }
39 
44 
45  void maybe_autoscroll (bool, bool, bool from_headers);
47  bool autoscroll_active() const;
48 
49  void redisplay_grid (bool immediate_redraw);
51 
52  void instant_save();
53 
55  void begin_reversible_selection_op (std::string cmd_name);
60 
61  PBD::HistoryOwner& history() { return *this; }
62  void history_changed ();
64 
65  void add_command (PBD::Command * cmd) { HistoryOwner::add_command (cmd); }
66  void begin_reversible_command (std::string cmd_name) { HistoryOwner::begin_reversible_command (cmd_name); }
67  void begin_reversible_command (GQuark gq) { HistoryOwner::begin_reversible_command (gq); }
68  void abort_reversible_command () { HistoryOwner::abort_reversible_command (); }
69  void commit_reversible_command () { HistoryOwner::commit_reversible_command (); }
70 
71  double get_y_origin () const;
72 
77 
78  void set_mouse_mode (Editing::MouseMode, bool force = false);
82  void step_mouse_mode (bool next);
88  bool internal_editing() const { return true; }
89 
91  MouseCursors const* cursors () const {
92  return _cursors;
93  }
95 
96  std::vector<MidiRegionView*> filter_to_unique_midi_region_views (RegionSelection const & ms) const;
97 
98  std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>);
99  void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>);
100 
101  protected:
103 
104  void do_undo (uint32_t n);
105  void do_redo (uint32_t n);
106 
107  std::pair<Temporal::timepos_t,Temporal::timepos_t> max_zoom_extent() const;
108 
109  Temporal::timepos_t _get_preferred_edit_position (Editing::EditIgnoreOption, bool use_context_click, bool from_outside_canvas);
110 };
111 
void set_mouse_mode(Editing::MouseMode, bool force=false)
double get_y_origin() const
void do_undo(uint32_t n)
AxisView * axis_view_by_control(std::shared_ptr< ARDOUR::AutomationControl >) const
Definition: cue_editor.h:38
StripableTimeAxisView * get_stripable_time_axis_by_id(const PBD::ID &id) const
void set_zoom_focus(Editing::ZoomFocus)
void set_snapped_cursor_position(Temporal::timepos_t const &pos)
void reposition_and_zoom(samplepos_t, double)
void step_mouse_mode(bool next)
bool autoscroll_active() const
void begin_reversible_selection_op(std::string cmd_name)
void end_local_tempo_map(std::shared_ptr< Temporal::TempoMap const >)
void redisplay_grid(bool immediate_redraw)
Temporal::timepos_t _get_preferred_edit_position(Editing::EditIgnoreOption, bool use_context_click, bool from_outside_canvas)
void instant_save()
void commit_reversible_command()
Definition: cue_editor.h:69
TempoMarker * find_marker_for_tempo(Temporal::TempoPoint const &)
AxisView * axis_view_by_stripable(std::shared_ptr< ARDOUR::Stripable >) const
Definition: cue_editor.h:37
void begin_reversible_command(std::string cmd_name)
Definition: cue_editor.h:66
std::pair< Temporal::timepos_t, Temporal::timepos_t > max_zoom_extent() const
std::vector< MidiRegionView * > filter_to_unique_midi_region_views(RegionSelection const &ms) const
void abort_reversible_selection_op()
void undo_selection_op()
ArdourMarker * find_marker_from_location_id(PBD::ID const &, bool) const
void history_changed()
void reset_x_origin_to_follow_playhead()
MouseCursors const * cursors() const
Definition: cue_editor.h:91
void begin_reversible_command(GQuark gq)
Definition: cue_editor.h:67
Gdk::Cursor * get_canvas_cursor() const
samplecnt_t get_current_zoom() const
ARDOUR::Location * find_location_from_marker(ArdourMarker *, bool &) const
Editing::MouseMode current_mouse_mode() const
void commit_reversible_selection_op()
Temporal::timecnt_t get_nudge_distance(Temporal::timepos_t const &pos, Temporal::timecnt_t &next) const
void add_command(PBD::Command *cmd)
Definition: cue_editor.h:65
CueEditor(std::string const &name)
TrackViewList axis_views_from_routes(std::shared_ptr< ARDOUR::RouteList >) const
PBD::HistoryOwner & history()
Definition: cue_editor.h:61
bool internal_editing() const
Definition: cue_editor.h:88
MeterMarker * find_marker_for_meter(Temporal::MeterPoint const &)
std::shared_ptr< Temporal::TempoMap const > start_local_tempo_map(std::shared_ptr< Temporal::TempoMap >)
void select_all_within(Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, std::list< SelectableOwner * > const &, ARDOUR::SelectionOperation, bool)
void do_redo(uint32_t n)
void get_regionviews_by_id(PBD::ID const id, RegionSelection &regions) const
PBD::ScopedConnection history_connection
Definition: cue_editor.h:63
virtual void set_samples_per_pixel(samplecnt_t)
void begin_selection_op_history()
void maybe_autoscroll(bool, bool, bool from_headers)
void redo_selection_op()
void stop_canvas_autoscroll()
void abort_reversible_command()
Definition: cue_editor.h:68
static MouseCursors * _cursors
Definition: id.h:34
GtkImageIconNameData name
Definition: gtkimage.h:6
PBD::PropertyDescriptor< bool > regions
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t
EditIgnoreOption
Definition: editing.h:241
ZoomFocus
Definition: editing.h:126
MouseMode
Definition: editing.h:98