2023-11-17 19:57:45 -05:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2023 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2023-11-18 20:39:49 -05:00
|
|
|
|
2024-06-28 00:27:29 -04:00
|
|
|
#include "pbd/history_owner.h"
|
|
|
|
|
2023-11-17 19:57:45 -05:00
|
|
|
#include "editing.h"
|
|
|
|
#include "editing_context.h"
|
|
|
|
|
2024-06-30 10:16:07 -04:00
|
|
|
class CueEditor : public EditingContext, public PBD::HistoryOwner, public sigc::trackable
|
2023-11-17 19:57:45 -05:00
|
|
|
{
|
|
|
|
public:
|
2024-02-13 14:22:49 -05:00
|
|
|
CueEditor (std::string const & name);
|
2023-11-17 19:57:45 -05:00
|
|
|
~CueEditor ();
|
|
|
|
|
2024-08-18 14:51:28 -04:00
|
|
|
void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, ARDOUR::SelectionOperation, bool);
|
2023-11-17 19:57:45 -05:00
|
|
|
|
|
|
|
void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const;
|
|
|
|
StripableTimeAxisView* get_stripable_time_axis_by_id (const PBD::ID& id) const;
|
|
|
|
TrackViewList axis_views_from_routes (std::shared_ptr<ARDOUR::RouteList>) const;
|
2023-11-19 13:37:31 -05:00
|
|
|
AxisView* axis_view_by_stripable (std::shared_ptr<ARDOUR::Stripable>) const { return nullptr; }
|
|
|
|
AxisView* axis_view_by_control (std::shared_ptr<ARDOUR::AutomationControl>) const { return nullptr; }
|
2023-11-17 19:57:45 -05:00
|
|
|
|
|
|
|
ARDOUR::Location* find_location_from_marker (ArdourMarker*, bool&) const;
|
|
|
|
ArdourMarker* find_marker_from_location_id (PBD::ID const&, bool) const;
|
|
|
|
TempoMarker* find_marker_for_tempo (Temporal::TempoPoint const &);
|
|
|
|
MeterMarker* find_marker_for_meter (Temporal::MeterPoint const &);
|
|
|
|
|
|
|
|
void maybe_autoscroll (bool, bool, bool from_headers);
|
|
|
|
void stop_canvas_autoscroll ();
|
|
|
|
bool autoscroll_active() const;
|
|
|
|
|
|
|
|
void redisplay_grid (bool immediate_redraw);
|
2024-01-04 21:02:59 -05:00
|
|
|
Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next) const;
|
2023-11-17 19:57:45 -05:00
|
|
|
|
|
|
|
void instant_save();
|
|
|
|
|
|
|
|
/** Get the topmost enter context for the given item type.
|
|
|
|
*
|
|
|
|
* This is used to change the cursor associated with a given enter context,
|
|
|
|
* which may not be on the top of the stack.
|
|
|
|
*/
|
|
|
|
EnterContext* get_enter_context(ItemType type);
|
|
|
|
|
|
|
|
void begin_selection_op_history ();
|
|
|
|
void begin_reversible_selection_op (std::string cmd_name);
|
|
|
|
void commit_reversible_selection_op ();
|
|
|
|
void abort_reversible_selection_op ();
|
|
|
|
void undo_selection_op ();
|
|
|
|
void redo_selection_op ();
|
|
|
|
|
2024-06-29 18:47:42 -04:00
|
|
|
PBD::HistoryOwner& history() { return *this; }
|
2024-06-30 10:16:07 -04:00
|
|
|
void history_changed ();
|
|
|
|
PBD::ScopedConnection history_connection;
|
2024-06-29 18:47:42 -04:00
|
|
|
|
|
|
|
void add_command (PBD::Command * cmd) { HistoryOwner::add_command (cmd); }
|
|
|
|
void begin_reversible_command (std::string cmd_name) { HistoryOwner::begin_reversible_command (cmd_name); }
|
|
|
|
void begin_reversible_command (GQuark gq) { HistoryOwner::begin_reversible_command (gq); }
|
|
|
|
void abort_reversible_command () { HistoryOwner::abort_reversible_command (); }
|
|
|
|
void commit_reversible_command () { HistoryOwner::commit_reversible_command (); }
|
|
|
|
|
2023-11-17 19:57:45 -05:00
|
|
|
double get_y_origin () const;
|
|
|
|
|
|
|
|
void set_zoom_focus (Editing::ZoomFocus);
|
|
|
|
Editing::ZoomFocus get_zoom_focus () const;
|
|
|
|
samplecnt_t get_current_zoom () const;
|
2024-02-23 13:25:07 -05:00
|
|
|
void set_samples_per_pixel (samplecnt_t);
|
2023-11-17 19:57:45 -05:00
|
|
|
void reposition_and_zoom (samplepos_t, double);
|
|
|
|
|
2024-01-08 16:36:29 -05:00
|
|
|
void set_mouse_mode (Editing::MouseMode, bool force = false);
|
2023-11-17 19:57:45 -05:00
|
|
|
/** Step the mouse mode onto the next or previous one.
|
|
|
|
* @param next true to move to the next, otherwise move to the previous
|
|
|
|
*/
|
|
|
|
void step_mouse_mode (bool next);
|
|
|
|
/** @return The current mouse mode (gain, object, range, timefx etc.)
|
|
|
|
* (defined in editing_syms.h)
|
|
|
|
*/
|
|
|
|
Editing::MouseMode current_mouse_mode () const;
|
2024-01-08 16:36:43 -05:00
|
|
|
/** cue editors are *always* used for internal editing */
|
2023-11-17 19:57:45 -05:00
|
|
|
bool internal_editing() const { return true; }
|
|
|
|
|
|
|
|
Gdk::Cursor* get_canvas_cursor () const;
|
|
|
|
MouseCursors const* cursors () const {
|
|
|
|
return _cursors;
|
|
|
|
}
|
|
|
|
void set_snapped_cursor_position (Temporal::timepos_t const & pos);
|
|
|
|
|
|
|
|
std::vector<MidiRegionView*> filter_to_unique_midi_region_views (RegionSelection const & ms) const;
|
|
|
|
|
2024-01-26 22:45:22 -05:00
|
|
|
std::shared_ptr<Temporal::TempoMap const> start_local_tempo_map (std::shared_ptr<Temporal::TempoMap>);
|
|
|
|
void end_local_tempo_map (std::shared_ptr<Temporal::TempoMap const>);
|
|
|
|
|
2023-11-17 19:57:45 -05:00
|
|
|
protected:
|
|
|
|
void reset_x_origin_to_follow_playhead ();
|
2024-06-28 00:27:29 -04:00
|
|
|
|
|
|
|
void do_undo (uint32_t n);
|
|
|
|
void do_redo (uint32_t n);
|
2023-11-17 19:57:45 -05:00
|
|
|
};
|
2023-11-18 20:39:49 -05:00
|
|
|
|