Ardour  9.0-pre0-822-g12e3bc5c20
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 
34  TrackViewList axis_views_from_routes (std::shared_ptr<ARDOUR::RouteList>) const;
35  AxisView* axis_view_by_stripable (std::shared_ptr<ARDOUR::Stripable>) const { return nullptr; }
36  AxisView* axis_view_by_control (std::shared_ptr<ARDOUR::AutomationControl>) const { return nullptr; }
37 
42 
43  void maybe_autoscroll (bool, bool, bool from_headers);
45  bool autoscroll_active() const;
46 
47  void redisplay_grid (bool immediate_redraw);
49 
50  void instant_save();
51 
53  void begin_reversible_selection_op (std::string cmd_name);
58 
59  PBD::HistoryOwner& history() { return *this; }
60  void history_changed ();
62 
63  void add_command (PBD::Command * cmd) { HistoryOwner::add_command (cmd); }
64  void begin_reversible_command (std::string cmd_name) { HistoryOwner::begin_reversible_command (cmd_name); }
65  void begin_reversible_command (GQuark gq) { HistoryOwner::begin_reversible_command (gq); }
66  void abort_reversible_command () { HistoryOwner::abort_reversible_command (); }
67  void commit_reversible_command () { HistoryOwner::commit_reversible_command (); }
68 
69  double get_y_origin () const;
70 
75 
76  void set_mouse_mode (Editing::MouseMode, bool force = false);
80  void step_mouse_mode (bool next);
86  bool internal_editing() const { return true; }
87 
88  Gdk::Cursor* get_canvas_cursor () const;
89  MouseCursors const* cursors () const {
90  return _cursors;
91  }
93 
94  std::vector<MidiRegionView*> filter_to_unique_midi_region_views (RegionSelection const & ms) const;
95 
96  std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>);
97  void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>);
98 
99  protected:
101 
102  void do_undo (uint32_t n);
103  void do_redo (uint32_t n);
104 
105  Temporal::timepos_t _get_preferred_edit_position (Editing::EditIgnoreOption, bool use_context_click, bool from_outside_canvas);
106 };
107 
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:36
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:67
TempoMarker * find_marker_for_tempo(Temporal::TempoPoint const &)
AxisView * axis_view_by_stripable(std::shared_ptr< ARDOUR::Stripable >) const
Definition: cue_editor.h:35
void begin_reversible_command(std::string cmd_name)
Definition: cue_editor.h:64
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:89
void begin_reversible_command(GQuark gq)
Definition: cue_editor.h:65
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:63
CueEditor(std::string const &name)
TrackViewList axis_views_from_routes(std::shared_ptr< ARDOUR::RouteList >) const
PBD::HistoryOwner & history()
Definition: cue_editor.h:59
bool internal_editing() const
Definition: cue_editor.h:86
MeterMarker * find_marker_for_meter(Temporal::MeterPoint const &)
std::shared_ptr< Temporal::TempoMap const > start_local_tempo_map(std::shared_ptr< Temporal::TempoMap >)
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:61
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:66
static MouseCursors * _cursors
Definition: id.h:34
PBD::PropertyDescriptor< std::string > name
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