add stub for cue editor

This commit is contained in:
Paul Davis 2023-11-17 17:57:45 -07:00
parent f037bb622d
commit 60f7878dc6
7 changed files with 348 additions and 17 deletions

230
gtk2_ardour/cue_editor.cc Normal file
View File

@ -0,0 +1,230 @@
#include "cue_editor.h"
CueEditor::CueEditor ()
{
}
CueEditor::~CueEditor ()
{
}
VerboseCursor*
CueEditor::verbose_cursor () const
{
return nullptr;
}
void
CueEditor::set_snapped_cursor_position (Temporal::timepos_t const & pos)
{
}
std::vector<MidiRegionView*>
CueEditor::filter_to_unique_midi_region_views (RegionSelection const & ms) const
{
std::vector<MidiRegionView*> mrv;
return mrv;
}
void
CueEditor::select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, Selection::Operation, bool)
{
}
void
CueEditor::get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const
{
}
StripableTimeAxisView*
CueEditor::get_stripable_time_axis_by_id (const PBD::ID& id) const
{
return nullptr;
}
TrackViewList
CueEditor::axis_views_from_routes (std::shared_ptr<ARDOUR::RouteList>) const
{
TrackViewList tvl;
return tvl;
}
ARDOUR::Location*
CueEditor::find_location_from_marker (ArdourMarker*, bool&) const
{
return nullptr;
}
ArdourMarker*
CueEditor::find_marker_from_location_id (PBD::ID const&, bool) const
{
return nullptr;
}
TempoMarker*
CueEditor::find_marker_for_tempo (Temporal::TempoPoint const &)
{
return nullptr;
}
MeterMarker*
CueEditor::find_marker_for_meter (Temporal::MeterPoint const &)
{
return nullptr;
}
void
CueEditor::maybe_autoscroll (bool, bool, bool from_headers)
{
}
void
CueEditor::stop_canvas_autoscroll ()
{
}
bool
CueEditor::autoscroll_active() const
{
return true;
}
void
CueEditor::redisplay_grid (bool immediate_redraw)
{
}
Temporal::timecnt_t
CueEditor::get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next)
{
return Temporal::timecnt_t (Temporal::AudioTime);
}
void
CueEditor::instant_save()
{
}
EditingContext::EnterContext*
CueEditor::get_enter_context(ItemType type)
{
return nullptr;
}
void
CueEditor::begin_selection_op_history ()
{
}
void
CueEditor::begin_reversible_selection_op (std::string cmd_name)
{
}
void
CueEditor::commit_reversible_selection_op ()
{
}
void
CueEditor::abort_reversible_selection_op ()
{
}
void
CueEditor::undo_selection_op ()
{
}
void
CueEditor::redo_selection_op ()
{
}
double
CueEditor::get_y_origin () const
{
return 0.;
}
void
CueEditor::reset_x_origin (samplepos_t)
{
}
void
CueEditor::reset_y_origin (double)
{
}
void
CueEditor::set_zoom_focus (Editing::ZoomFocus)
{
}
Editing::ZoomFocus
CueEditor::get_zoom_focus () const
{
return Editing::ZoomFocusPlayhead;
}
samplecnt_t
CueEditor::get_current_zoom () const
{
return 2048;
}
void
CueEditor::reset_zoom (samplecnt_t)
{
}
void
CueEditor::reposition_and_zoom (samplepos_t, double)
{
}
void
CueEditor::set_mouse_mode (Editing::MouseMode, bool force)
{
}
void
CueEditor::step_mouse_mode (bool next)
{
}
void
CueEditor::set_canvas_cursor (Gdk::Cursor*)
{
}
size_t
CueEditor::push_canvas_cursor (Gdk::Cursor*)
{
return 0;
}
void
CueEditor::pop_canvas_cursor ()
{
}
void
CueEditor::reset_x_origin_to_follow_playhead ()
{
}
Gdk::Cursor*
CueEditor::get_canvas_cursor () const
{
return nullptr;
}
Editing::MouseMode
CueEditor::current_mouse_mode () const
{
return Editing::MouseContent;
}

102
gtk2_ardour/cue_editor.h Normal file
View File

@ -0,0 +1,102 @@
/*
* 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.
*/
#include "editing.h"
#include "editing_context.h"
class CueEditor : public EditingContext
{
public:
CueEditor ();
~CueEditor ();
void select_all_within (Temporal::timepos_t const &, Temporal::timepos_t const &, double, double, TrackViewList const &, Selection::Operation, bool);
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;
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);
Temporal::timecnt_t get_nudge_distance (Temporal::timepos_t const & pos, Temporal::timecnt_t& next);
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 ();
double get_y_origin () const;
void reset_x_origin (samplepos_t);
void reset_y_origin (double);
void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const;
samplecnt_t get_current_zoom () const;
void reset_zoom (samplecnt_t);
void reposition_and_zoom (samplepos_t, double);
void set_mouse_mode (Editing::MouseMode, bool force = false);
/** 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;
/** @return Whether the current mouse mode is an "internal" editing mode. */
bool internal_editing() const { return true; }
Gdk::Cursor* get_canvas_cursor () const;
MouseCursors const* cursors () const {
return _cursors;
}
VerboseCursor* verbose_cursor () const;
void set_snapped_cursor_position (Temporal::timepos_t const & pos);
std::vector<MidiRegionView*> filter_to_unique_midi_region_views (RegionSelection const & ms) const;
protected:
void set_canvas_cursor (Gdk::Cursor*);
size_t push_canvas_cursor (Gdk::Cursor*);
void pop_canvas_cursor ();
void reset_x_origin_to_follow_playhead ();
};

View File

@ -87,6 +87,8 @@ EditingContext::EditingContext ()
, selection (new Selection (this, true))
, cut_buffer (new Selection (this, false))
, _selection_memento (new SelectionMemento())
, _cursors (nullptr)
, _verbose_cursor (nullptr)
{
grid_type_strings = I18N (_grid_type_strings);
}

View File

@ -212,8 +212,8 @@ public:
virtual void reset_zoom (samplecnt_t) = 0;
virtual void reposition_and_zoom (samplepos_t, double) = 0;
virtual Selection& get_selection() const = 0;
virtual Selection& get_cut_buffer () const = 0;
virtual Selection& get_selection() const { return *selection; }
virtual Selection& get_cut_buffer () const { return *cut_buffer; }
/** Set the mouse mode (gain, object, range, timefx etc.)
* @param m Mouse mode (defined in editing_syms.h)
@ -233,8 +233,12 @@ public:
virtual bool internal_editing() const = 0;
virtual Gdk::Cursor* get_canvas_cursor () const = 0;
virtual MouseCursors const* cursors () const = 0;
virtual VerboseCursor* verbose_cursor () const = 0;
virtual MouseCursors const* cursors () const {
return _cursors;
}
virtual VerboseCursor* verbose_cursor () const {
return _verbose_cursor;
}
virtual void set_snapped_cursor_position (Temporal::timepos_t const & pos) = 0;
@ -332,6 +336,11 @@ public:
SelectionMemento* _selection_memento;
std::list<XMLNode*> before; /* used in *_reversible_command */
MouseCursors* _cursors;
friend class VerboseCursor;
VerboseCursor* _verbose_cursor;
};
#endif /* __ardour_midi_editing_context_h__ */

View File

@ -253,7 +253,6 @@ Editor::Editor ()
, _track_canvas (0)
, _track_canvas_viewport (0)
, within_track_canvas (false)
, _verbose_cursor (0)
, _region_peak_cursor (0)
, tempo_group (0)
, meter_group (0)
@ -422,7 +421,6 @@ Editor::Editor ()
, layering_order_editor (0)
, _last_cut_copy_source_track (0)
, _region_selection_change_updates_region_list (true)
, _cursors (0)
, _following_mixer_selection (false)
, _show_touched_automation (false)
, _control_point_toggled_on_press (false)

View File

@ -511,14 +511,6 @@ public:
Gdk::Cursor* get_canvas_cursor () const;
MouseCursors const* cursors () const {
return _cursors;
}
VerboseCursor* verbose_cursor () const {
return _verbose_cursor;
}
double clamp_verbose_cursor_x (double);
double clamp_verbose_cursor_y (double);
@ -869,7 +861,6 @@ private:
bool within_track_canvas;
friend class VerboseCursor;
VerboseCursor* _verbose_cursor;
RegionPeakCursor* _region_peak_cursor;
@ -2405,8 +2396,6 @@ private:
Gtk::MenuItem& action_menu_item (std::string const &);
void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
MouseCursors* _cursors;
void follow_mixer_selection ();
bool _following_mixer_selection;

View File

@ -65,6 +65,7 @@ gtk2_ardour_sources = [
'control_point_dialog.cc',
'control_slave_ui.cc',
'cuebox_ui.cc',
'cue_editor.cc',
'cursor_context.cc',
'curvetest.cc',
'debug.cc',