Commit graph

40884 commits

Author SHA1 Message Date
Paul Davis
e591bc91f9 attach shared bindings to a parent of editor canvas to make them accessible 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
911ad78c06 add API to access PBD::UndoHistory member of HistoryOwner 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
8eb38f1406 move undo/redo key bindings into shared "Editing" space 2024-10-17 07:44:31 -06:00
Paul Davis
a61f49ad4f show Bindings _name in DEBUG_TRACE output 2024-10-17 07:44:31 -06:00
Paul Davis
42959b1313 adjust MidiModel API to require HistoryOwner not Session for commands 2024-10-17 07:44:31 -06:00
Paul Davis
8c086693af show HistoryOwner::_name in DEBUG_TRACE messages 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
b989464914 NO-OP: add useful comment 2024-10-17 07:44:31 -06:00
Paul Davis
e8fdbb8cd9 Session IS-A history owner 2024-10-17 07:44:31 -06:00
Paul Davis
d30c8a1286 abstract concept of a history owner from ARDOUR::Session into libpbd 2024-10-17 07:44:31 -06:00
Paul Davis
f80395fc2f use MidiModel::ContentsChanged to drive MIDI cue edit swaps (GUI version)
No need for a special method called post-edit
2024-10-17 07:44:31 -06:00
Paul Davis
fd6afb30e6 use MidiModel::ContentsChanged to drive MIDI cue edit swaps
No need for a special method called post-edit
2024-10-17 07:44:31 -06:00
Paul Davis
60830f4ab7 remove debug output 2024-10-17 07:44:30 -06:00
Paul Davis
62d36832c6 more changes to get MIDI clip editing working
MIDITrigger now has a direct reference to a MidiModel, and uses
that as the basis for discovering what state has changed and needs
updated after an edit operation pushes a new state to the trigger
2024-10-17 07:44:30 -06:00
Paul Davis
7bf464795a add ::render() to MidiModel since that's what we'll be editing 2024-10-17 07:44:30 -06:00
Paul Davis
fcfa4fecb4 more preparation for MIDI cue editing to propagate to the slot (trigger) 2024-10-17 07:44:30 -06:00
Paul Davis
06d5496f70 further preparation for MIDI cue editing in triggerbox code 2024-10-17 07:44:30 -06:00
Paul Davis
9060a32c34 MIDI state trackers: dump() is const
Plus minor fixes to ::resolve_diff()
2024-10-17 07:44:30 -06:00
Paul Davis
044aec6563 basics of MIDI clip editing notification via model swap 2024-10-17 07:44:30 -06:00
Paul Davis
7dee98279a extend MidiModel and MIDITrigger in preparation for edit-change handling 2024-10-17 07:44:30 -06:00
Paul Davis
5da8de05ca NO-OP: internal whitespace and newline cleanup 2024-10-17 07:44:30 -06:00
Paul Davis
4267d5b0d7 MidiStateTracker: extend API to allow "diffs" between two MidiStateTrackers 2024-10-17 07:44:30 -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
3224b37702 NO-OP: whitespace 2024-10-17 07:44:30 -06:00
Paul Davis
4724683b5f fix placement of ghost note while in draw mode 2024-10-17 07:44:30 -06:00
Paul Davis
30a7f44c12 fix geometry calculations during NoteCreateDrags.
This also only uses the draw length parameter if no motion
occured during the NoteCreateDrag. Otherwise it uses the length that was
dragged (which is subjected to a threshold).
2024-10-17 07:44:30 -06:00
Paul Davis
dd211c4329 prefer nullptr to 0 2024-10-17 07:44:30 -06:00
Paul Davis
71f946f3b3 move tooltip settings for EditingContext widgets to EditingContext 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
99d1a4cd9b if the Editor is not the current EditingContext, don't do Editor::escape stuff 2024-10-17 07:44:30 -06:00
Paul Davis
033dd31ff1 fix reordering warning 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
afe98a6671 correctly define MIDI actions using MidiView, not MidiRegionView
The latter is derived from the former.
2024-10-17 07:44:30 -06:00
Paul Davis
fea6c7592f NO-OP: whitespace 2024-10-17 07:44:30 -06:00
Paul Davis
e0a5b591f8 correct errors in coordinate math when moving a mote selection
This may be the first of several instances where mixing
timeline-relative positions and global canvas coordinates leads to
problems. Let's hope there are not too many.
2024-10-17 07:44:30 -06:00
Paul Davis
e7ae93929b correctly set timeline_origin for a MidiCueEditor
for some reason the width is different when ::set_region() is called
2024-10-17 07:44:30 -06:00
Paul Davis
c97f4f4016 various changes to editor drag code to correctly use a bounding item 2024-10-17 07:44:30 -06:00
Paul Davis
030052e57f don't double-apply the effect of a drag with a bounding item to _grab_y 2024-10-17 07:44:30 -06:00
Paul Davis
a9163516d8 the horizontal position *is* the value of the horizontal adjustment.
Don't waste time getting a less accurate answer from sample_to_pixel() on
_leftmost_sample.
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
d550292f8f additional DEBUG_TRACE (Destruction) output 2024-10-17 07:44:30 -06:00
Paul Davis
36d0a6e908 fix dangling references to a MidiRegion and MidiTrack in a MidiView 2024-10-17 07:44:30 -06:00
Paul Davis
3aba913649 manual cleanup after another tricky rebase against master 2024-10-17 07:44:30 -06:00
Paul Davis
e630051de1 more manual fixes after a substantial rebase 2024-10-17 07:44:30 -06:00
Paul Davis
6ee97f93bb more manual fixes after a substantial rebase 2024-10-17 07:44:30 -06:00
Paul Davis
e205bb98a1 manual fixes after a substantial rebase 2024-10-17 07:44:30 -06:00