Commit graph

174 commits

Author SHA1 Message Date
Paul Davis
9415dad9cc fix the visible channel in a pianoroll if the model has no channel data 2025-04-16 20:43:10 -06:00
Paul Davis
1f4ddcd53f fix inheritance design error in MidiRegionView/MidiView
trim_front_(starting|ending) must be in a class derived from RegionView,
which MidiView is not.

This ensures that Carl's original design for this (with these two methods
called at the start and end of a front-trim drag) is still operational, and we
do not end up with MIDI regions that have a negative start value.
2025-04-08 15:50:30 -06:00
Paul Davis
0c924c3933 pianoroll: dragging start handle before zero shifts MIDI later in time 2025-04-08 15:50:30 -06:00
Paul Davis
8b389ee829 amend 365e3ef8e2 to be "more right"
NoteBase-derived note objects must delete their children, because
often they are deleted long before the parent (group) is. However,
in MidiView::clear_events() we used to call _note_group->clear (true)
first, which would delete the canvas items owned by these objects,
without them knowing about it. This made it dangerous for them
to delete those same items in their destructors.

This reverses the ordering so that NoteBase objects are deleted first
(along with their canvas items) and after that we clear _note_group
which will address any danging canvas items created there that are
not owned by a NoteBase-derived object
2025-03-25 14:49:49 -06:00
Paul Davis
65db08ac2b remove debug output 2025-03-25 11:17:05 -06:00
Paul Davis
ed0c55afb7 NOOP: whitespace/line removal 2025-03-24 11:43:33 -06:00
Paul Davis
dd1e1b16cc remove unused variable 2025-03-24 11:43:33 -06:00
Paul Davis
69174beb7b NOOP: add space before parens 2025-03-24 11:43:32 -06:00
Paul Davis
0a33701089 midiview: some more auto-fication 2025-03-24 11:43:32 -06:00
Paul Davis
e243f17eb1 pianoroll: hide trim handles when region is reset 2025-03-24 11:43:32 -06:00
Paul Davis
365e3ef8e2 midiview: correctly manage NoteBase lifetimes
MidiView::clear_events() deleted the canvas items corresponding to Notes/Hits,
but did not delete the owner NoteBase objects.
2025-03-24 11:43:32 -06:00
Paul Davis
51dbe70b44 no more trim cursor in drae mode in the pianoroll
For some reason, we allow users to trim notes on the timeline when in
draw mode. Not sure why. We don't allow this in pianorolls, so make
sure the cursors don't suggest otherwise
2025-03-20 14:14:08 -06:00
Paul Davis
05b8c6d2d3 some potential fixes for wierd note split/join behavior
the split_info for a MidiView would stick around across note selection
operations that really should act as a "boundary" or end of the
split op. This commit ends the split op any time selection is cleared
or notes are added to the selection (except when in the middle of a split
2025-03-19 17:34:33 -06:00
Paul Davis
e8d4f5e06d when a pianoroll shows an empty MIDI model, use the user prefs for the note range 2025-03-17 10:12:42 -06:00
Paul Davis
ef8f2579c1 if showing an empty model in a pianoroll, set the visible channel to 1 2025-03-17 10:00:44 -06:00
Paul Davis
c509de6814 work on fixing/improving MIDI region/track scrolling behavior 2025-03-14 13:24:49 -06:00
Paul Davis
53ffd61dd9 for pianoroll MidiViews, set _visible_channel to the lowest MIDI channel with notes present 2025-03-08 18:27:20 -07:00
Paul Davis
c0ed2fd9f5 fix vanishing notes during drag in a pianoroll 2025-03-08 12:14:17 -07:00
Paul Davis
8f4c10f855 subtle change in event handling for MidiViews
this needs more investigation but we need to return false from
scroll event handling in order for stuff to work. this should
not be the case and this will likely be reverted once the reason
it is required is uncovered
2025-03-06 18:12:40 -07:00
Paul Davis
a94bd4b7c6 rename MidiView::relative_position() to ::view_position_to_model_position() 2025-03-06 18:12:40 -07:00
Paul Davis
6d1c6bc239 slight rearrangement for MidiView::relative_position() 2025-03-06 18:12:40 -07:00
Paul Davis
2cadaafc4f NO-OP: follow style guide and use space in function call 2025-03-06 18:12:39 -07:00
Paul Davis
b9d69d3948 take _visible_channel into account for MidiView when drawing notes 2025-03-06 18:12:39 -07:00
Paul Davis
441cfe4e2d Make MidiView::relative_position() return correctly for _show_source case 2025-03-06 18:12:39 -07:00
Paul Davis
eb75064909 Modify comments and variable names in MidiView::create_note_at()
First argument is a source-relative position, not region-relative.
2025-03-06 18:12:39 -07:00
Paul Davis
67fa5282cb Remove Region::absolute_time_to_region_beats()
This method did not do what its name suggested. Replace it with
::absolute_time_to_source_beats() which already existed and
computed the same result.

Also in a NoteCreateDrag, correctly adjust note start
depending on whether we are viewing the whole source or
just the region. This part may be amended later.
2025-03-06 18:12:39 -07:00
Paul Davis
fcf086986a avoid logical op ambiguity 2025-03-04 14:57:50 -07:00
Paul Davis
b489d466cf commit crash caused by event-sensitive ghost note in MidiView 2025-03-04 12:18:29 -07:00
Paul Davis
06050bb578 several related changes to get visible channel control working in MidiView/Pianoroll 2025-03-04 11:30:48 -07:00
Paul Davis
e34fd3cc3b remove unused methods related to channel changing for MIDI notes 2025-03-04 11:30:48 -07:00
Paul Davis
47e635b689 initial work on displaying non-selected-channel notes in pianoroll 2025-02-28 13:39:45 -07:00
Paul Davis
3928a3a0aa prevent note-range change signals for every added note in a MidiView 2025-02-25 13:12:57 -07:00
Robin Gareus
000c25edcc
Update gtkmm -> ytkmm header location (omnibus commit) 2025-02-01 15:25:14 +01:00
Paul Davis
ee4419003c no ghost note in draw mode in midi view if dragging something 2025-01-27 10:48:19 -07:00
Paul Davis
ab39c26f68 a variety of changes to make timeline-region editing-in-pianoroll to start to work
This also removes the useless "new pianoroll window" menu option and action
2025-01-20 18:05:19 -07:00
Paul Davis
f052c3ae15 some API tweaks, code movement and code implementation to make rbselect for pianoroll automation work 2025-01-19 15:10:35 -07:00
Paul Davis
a7382b9424 provide MidiView methods for use in NoteDrags (fixes note drags to earlier times in pianoroll) 2025-01-19 10:53:52 -07:00
luzpaz
1a18417464
fix typos in gtk2_ardour directory
Found via `codespell -q 3 -S "*.pdf,*.po,./.git,*.tosc,./waf,./share/patchfiles,./libs,./msvc_extra_headers,./share/web_surfaces,*.patch" -L acount,addin,ane,ba,buss,busses,caf,capela,devine,disconnectin,discreet,doubleclick,envolution,filetest,fo,ghandi,homs,hsi,layed,maschine,mis,nd,ontop,pass-thru,removeable,retrn,ro,scrollin,sectionin,seh,siz,sord,sur,te,trough,ue,wth`
2025-01-18 00:55:34 +01:00
Paul Davis
7ec2bc4edd fix rubber band selection coords so that it works in Editor & Pianoroll 2025-01-15 15:09:58 -07:00
Paul Davis
e4beb5c3d9 remove _note_mode property of MidiTimeAxisView and use MidiStreamView's inherited version
Note that for now, this leaves save/restore of the value to the time axis view, and doesn't alter
the fact that the MidiTrack represented by the axis view continues to have its own note mode too
2025-01-15 13:35:07 -07:00
Paul Davis
5cade315fb redraw (pianoroll) MidiView when note mode changes
This also fixes the position of the percussive mode canvas items
2025-01-15 10:34:46 -07:00
Paul Davis
678ebca032 don't always adjust note range in a MidiView after a model change 2025-01-14 16:49:58 -07:00
Paul Davis
e273ec06bb fix note drawing in clip editor by adding MidiView::relative_position() 2025-01-10 10:31:48 -07:00
Paul Davis
c47a3e79e8 fix note resizing mid- and end-drag behavior for clip editors
Clip editors show the entire source contents, which alters the conversion
process needed for dealing with pixel/length/duration values versus the
situation when only showing a region (as on the timeline)
2025-01-09 16:33:43 -07:00
Paul Davis
7c711de178 basics of pianoroll windows 2025-01-08 18:05:11 -07:00
Paul Davis
a4b22d1ac7 remove debug output 2025-01-08 14:26:29 -07:00
Paul Davis
82cdc6e3db remove debug output 2025-01-08 14:26:29 -07:00
Paul Davis
77d2a45475 fix computation of ::covers() for clip start/end handles 2025-01-08 14:26:28 -07:00
Paul Davis
9b22e16bec NO-OP: add lifetime comment 2024-12-29 11:24:16 -07:00
Paul Davis
5157234f2f auto-fication of a loop 2024-12-29 11:24:16 -07:00