Commit graph

115 commits

Author SHA1 Message Date
Paul Davis
22a5113b59 change how mouse mode actions are defined
they now use a lambda for the functor, and the lambda calls
current_editing_context() to pick which EditingContext will
be affected.

this design replaces one where each EditingContext had its
own set of mouse mode actions defined, using its own name
as the action group
2025-01-16 12:30:15 -07:00
Paul Davis
4e8591da99 move cut/copy/delete/paste operations into EditingContext
derived classes (Editor and Pianoroll) provide ::cut_copy() to wrap the
context-specific logic, and then both defer to MidiView for MIDI-specific
operations.

Note that this also changes several action names in ardour.keys.in
2025-01-14 15:31:53 -07:00
Paul Davis
13161a3975 refactor point-selection-changed logic "up" into EditingContext 2025-01-14 15:28:51 -07:00
Paul Davis
bd9ab55fa0 move zoom in/out buttons to EditingContext and use on the pianoroll 2025-01-07 12:59:13 -07:00
Paul Davis
d0890abe9c bring in change from bf7d4f895e but also try to fix API ambiguity and bug in that commit and existing code
_grid_type is an EditingContext member; grid_type is a method parameter
2025-01-05 11:49:18 -07:00
Paul Davis
0a40b50b86 refactor zoom focus handling so that all EditingContexts can use the same code 2024-12-29 11:24:16 -07:00
Paul Davis
25b830b032 fix event handling/routing from MidiView up to EditingContext
in particular, rename MidiView::canvas_group_event() to
avoid confusion with TimeAxisViewItem::canvas_group_event()
since a MidiRegionView inherits from both these classes.
2024-12-27 14:00:55 -07:00
Paul Davis
4c34f3cd29 provide rudimentary button control over percussive/sustained drawing in clip editor
Note that the note length selector can always be used to change the length of a note added
via a click
2024-12-13 21:48:18 -07:00
Paul Davis
0ff0d4df8b get mouse-centered zoom working in cue editor 2024-12-12 11:53:15 -07:00
Paul Davis
fb4fefe573 fix some issues with zoom focus after refactoring it into EditingContext 2024-12-12 11:53:15 -07:00
Paul Davis
a6ca9be006 refactor editor-y zooms into EditingContext 2024-12-12 11:53:15 -07:00
Paul Davis
15c86492fa use RAII for cursor mgmt around thread-waits 2024-12-08 15:09:32 -07:00
Paul Davis
98c9c03e9f remove all trace of cursor stacks; canvas cursor is always "just set" 2024-12-08 12:13:41 -07:00
Paul Davis
5b112e489b move zoom in/out actions into shared "Editing" group 2024-12-07 08:00:46 -07:00
Robin Gareus
d44ceb3ab7
Add API to consistently round start/end to duration to pixels 2024-11-28 15:00:40 +01:00
Paul Davis
465f39e5bf create nonfunctional clip boundary drags when appropriate 2024-11-23 09:06:38 -07:00
Paul Davis
e7b10fc37d virtualize editing connections to parameter changes 2024-11-12 10:47:08 -07:00
Paul Davis
677a6764ac add new buttons to EditingContext; use them in MidiCueEditor 2024-11-12 09:49:59 -07:00
Robin Gareus
a76d4b4c82
Fix class/struct mismatch (can cause with Windows builds) 2024-11-06 05:43:25 +01:00
Mads Kiilerich
140670541f Use .inc.h for #include files that not are plain headers
Regular .h files *should* be self-contained and independent of previous
includes and guarded to only include once. Make it clear which files
that *doesn't* apply for at all.
2024-10-20 03:11:53 +02:00
Robin Gareus
2339b4dfdc
Replace PBD::Signals (2/2) 2024-10-18 20:41:08 +02:00
Paul Davis
2afdeb519f refactor rubberband drags to take a functor for the no-drag condition
Also move code for adding automation line control points into automation line, rather
than in AutomationTimeAxisView (some work still required to finalize this)
2024-10-17 07:44:32 -06:00
Paul Davis
e6c0fcf98f refactor end-of-rb-selection for EditingContext
Whhat the main editor and the cue editor do with a click varies significantly
2024-10-17 07:44:32 -06:00
Paul Davis
4b8c51574d refactor the "selectables" API to allow use within separate (e.g. cue) editors 2024-10-17 07:44:32 -06:00
Paul Davis
ca1583cdad the great onceification (gui)
Replace use of #ifndef header guards with #pragma once

Modern C++, baby!
2024-10-17 07:44:31 -06:00
Paul Davis
90c8726c6d wideranging changes to get automation editing working in cue editor 2024-10-17 07:44:31 -06:00
Paul Davis
afa15a0061 get velocity editing working in both the cue editor and MIDI region views
Quite a bit of hairy coordinate system stuff in here that ought to be commented more
clearly
2024-10-17 07:44:31 -06:00
Paul Davis
45e4b97a6f move some methods from Editor to Editing context so that drawing controls work everywhere 2024-10-17 07:44:31 -06:00
Paul Davis
2fceb66193 manual fixups for errors during rebasing against master 2024-10-17 07:44:31 -06:00
Paul Davis
8523598664 fix management of undo/redo and _current_editing_context
We cannot switch on a leave event from a widget, because the undo/redo menu items must remain
labelled until we are actually in a new editing context. So switch when we switch tabs
or when we edit the (MIDI) cue editor
2024-10-17 07:44:31 -06:00
Paul Davis
86ecca8c76 make undo/redo action sensitivity work with multiple EditingContexts 2024-10-17 07:44:31 -06:00
Paul Davis
c4534cc9c4 undo history for MidiCueEditor
redo not operational yet for some unknown reason
2024-10-17 07:44:31 -06:00
Paul Davis
6081bd5e19 make CueEditor be a HistoryOwner and start on undo/redo refactor 2024-10-17 07:44:31 -06:00
Paul Davis
4bbdbc6d13 fix handling of MIDI draw tool actions and widgets
The actions and draw_xxx values are now "static", and changes in the values are
notified via a static PBD::Signal so that each EditingContext can update the
appearance of its relevant widgets.

Note also wider use of lambdas when creating actions and menu items.
2024-10-17 07:44:30 -06:00
Paul Davis
36eda47075 get temporal zoom workign in MidiCueEditor
and remove qite a bit of debug output
2024-10-17 07:44:30 -06:00
Paul Davis
dc44d10b48 handle Escape signal in all EditingContexts (including MidiCueEditor) 2024-10-17 07:44:30 -06:00
Paul Davis
f2e1697058 dammit jim, it's a stack not a queue 2024-10-17 07:44:30 -06:00
Paul Davis
280fdb6e62 virtualize EditingContext::midi_action() so that MidiCueEditor works
This makes MIDI bindings work in the cue editor, as intended.
2024-10-17 07:44:30 -06:00
Paul Davis
fea6c7592f NO-OP: whitespace 2024-10-17 07:44:30 -06:00
Paul Davis
060d8c82d7 introduce concept of timeline origin to EditingContext
For the main editor, the timeline starts at the left edge of the editor
canvas. But for MidiCueEditor, we place a canvas-ified piano roll header on the
left of the canvas, so the timeline starts at some position right of that.

Note that this means that converting global canvas coordinates to timeline
coordinates is no longer guaranteed to be a 1:1 transform (it will be for
Editor, but in general for EditingContext).
2024-10-17 07:44:30 -06:00
Paul Davis
bef7c48fe9 the state of things in pianorule, committed for travel purposes 2024-10-17 07:44:30 -06:00
Paul Davis
48a6e8dfcf basics of autoscroll for pianoroll (mostly shared with Editor)
More work to do moving/testing pianoroll autoscroll variant back into EditingContext
and sharing it with Editor.
2024-10-17 07:44:30 -06:00
Paul Davis
96ccb96b3b redesign drag API to provide a bounding item, not just "trackview only"
This allows rubberband drags on both the main editor and the separate piano roll to wokr
correctly.
2024-10-17 07:44:30 -06:00
Paul Davis
14b95116e1 move various action registry stuff into EditingContext 2024-10-17 07:44:30 -06:00
Paul Davis
0d01e73b86 some state mgmt for EditingContexts 2024-10-17 07:44:30 -06:00
Paul Davis
fcf5bb88d5 cue editor/piano roll: starting to get mode buttons working and keybindings too 2024-10-17 07:44:30 -06:00
Paul Davis
d356cacb2a working and accessible canvas cursor setting 2024-10-17 07:44:30 -06:00
Paul Davis
2b51e0ec24 prefer lambdas to stupid stub static functions 2024-10-17 07:44:30 -06:00
Paul Davis
f425a974d6 the continuing co-evolution of Editor,EditingContext & MidiCueEditor 2024-10-17 07:44:30 -06:00
Paul Davis
e3205bded0 do something to make MIDI bindings accessible in any EditingContext 2024-10-17 07:44:29 -06:00