Commit graph

336 commits

Author SHA1 Message Date
Robin Gareus
aba8595342
Don't re-create MIDI Region Editor when it already exists 2025-08-20 22:01:03 +02:00
Paul Davis
ff988eec37 fix one of 3 editing context refactoring warnings 2025-07-11 13:27:55 -06:00
Paul Davis
1ed9876446 Change various positions and dimensions to integer from double
This includes note heights, note positions, contents height
for streamviews, positions of tracks. It makes zero sense to think of these as
having potentially fractional positions.

In addition, fractional note heights and positions lead to numerous
errors drawing MIDI stuff at the pixel level.
2025-06-02 19:28: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
68ca768bc4 dbl-click on MIDI region shows combined properties/pianoroll editor 2025-02-08 12:22:48 -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
c98a36be0f switch mouse button and motion handling in MidiView to use Drag formalization
It appears that mouse handling in MidiRegionView (now moved into MidiView)
predated the full Drag formalization. This led to inconsistencies as parts of the Drag
formalization were adopted, including the use of motion events to start a drag (this
is incorrect in the current semantics of a Drag).

This commits removes all/most of the special purpose drag handling machinery in MidiView
and uses Drags instead
2024-12-27 14:13:02 -07:00
Paul Davis
8064353a82 fix/remove on the current #warnings arising from the pianorule refactor 2024-11-23 09:06:38 -07:00
Paul Davis
61f1466f50 use virtual methods to get MidiRegionView to do ::set_model() correctly 2024-11-05 13:27:22 -07:00
Paul Davis
b8fb779fa7 allow dragging in MIDI automation line in cue editor
Note: once this is cleaned up and checked with respect to snap and more,
the same should be done for MidiRegionView
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
56ce9c33c0 renaming: AutomationLineBase => AutomationLine, AutomationLine => EditorAutomationLine 2024-10-17 07:44:31 -06:00
Paul Davis
54fdf90cc2 lots of detailed fixes to get lollipops in tracks working again, post re-factor 2024-10-17 07:44:31 -06:00
Paul Davis
7899829a5e note range for midi * views API cleanup 2024-10-17 07:44:30 -06:00
Paul Davis
3700f191cd fix some region-view level selection issues 2024-10-17 07:44:29 -06:00
Paul Davis
33298a0ba0 get region-create drags working and no crashes (nut also no note) for note-drags 2024-10-17 07:44:29 -06:00
Paul Davis
27e9e19aac initial refactoring of MidiRegionView IS-A MidiView 2024-10-17 07:44:29 -06:00
Paul Davis
204d4237f8 further steps towards MidiRegionView outside the Editor 2024-10-17 07:44:29 -06:00
Paul Davis
089a9521d5 steps to an ecology of editing 2024-10-17 07:44:29 -06:00
Robin Gareus
4fa4fdf498
Remove patch change GUI Flag when MIDI model changes
Previously patch changes were only removed when the
removal was initiated by the GUI.
2024-09-09 00:16:33 +02:00
Paul Davis
d6beba67dc note joining should occur per-channel 2023-11-24 08:32:28 -07:00
Paul Davis
b92b2389fd make note-tupling work on multiple notes 2023-11-22 19:37:46 -07:00
Paul Davis
c3d14b1169 basic note-tupling functionality implemented 2023-11-21 17:07:42 -07:00
Paul Davis
e39709863a add new state and methods to MidiRegionView for note splitting 2023-11-21 17:07:42 -07:00
Paul Davis
d5a7e5f289 pass vectors for velocities by reference 2023-10-28 17:48:33 -06:00
Paul Davis
ef0938a16d more improvements to velocity drawing (including straight line) 2023-10-27 11:50:15 -06:00
Paul Davis
91fbb1c65b first steps towards improving straight line drags for velocity 2023-10-27 11:50:15 -06:00
Paul Davis
edc0e636e2 allow users to opt for "select only the last drawn note" when drawing notes 2023-10-17 22:03:47 -06:00
Paul Davis
1f13b311fd midi display: ensure that lollipops are visible right after import
VelocityGhostRegion used the visibility of the "parent" note canvas item of a
lollipop canvas item to determine the lolli's visibility. But during the
construction of the MidiRegionView, the note's container is not yet visible, so
this fails.

In addition this logic would hide lollis for notes that are outside the current
visible note range of the track (because the parent note item was not visible).

This change adds a method to MidiRegionView to decide if a note is within the
region's time range, and if so, we show the lollipop item. This means that
lollis for notes outside the note-range will still be visible, which seems more
correct. In addition, the nascent condition of the parent note's container no
longer affects lolli visibility.
2023-09-24 18:38:20 -06:00
Paul Davis
60256282e3 lollis: make a single drag be represented by a single Command object (for undo/redo) 2023-06-26 14:18:18 -06:00
Paul Davis
6d4bbae48c prototyping mouse-drag-paint velocity 2023-06-26 14:18:18 -06:00
Paul Davis
31de7e93bf lollis: show note selected status (using note selection outlien color) 2023-06-26 14:18:18 -06:00
Paul Davis
2d9a2ad668 lollis: also adjust velocity bars during the drag 2023-06-26 14:18:18 -06:00
Paul Davis
f7130f5c02 lollipop drag: move all selected notes 2023-06-26 14:18:18 -06:00
Paul Davis
cf7ba80fc1 the basics of lollipop dragging 2023-06-26 14:18:18 -06:00
Paul Davis
73ed3bc7e0 midi copy drag: select all new notes after drag
Cut-n-paste worked before, but Primary-drag only selected the dragged note.

This also contains several code changes to use for (auto ...) syntax.
2023-06-14 21:42:23 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
e06bd481a1 fix color of MIDI notes during capture so that they are visible 2022-10-28 16:41:15 -06:00
Robin Gareus
63c78ebced Fix MIDI edit opertaiont (trim, draw) across tempo-changes
In the presence of tempo-changes distinguishing between offsets and
absolute positions is signficant. It is only valid to convert absolute
times using the tempo-map

Furthermore since GUI zoom-factor is time-invariant (samples per pixel),
all GUI operations must explictly use samples (or timecnt). It is not
valid (and problematic) to use use a location dependent timepos.
2022-10-23 19:12:31 +02:00
Paul Davis
d2fc142e21 infrastructure and implementation to allow "q" to drive quantize-selected-notes in midi edit mode 2022-08-31 13:53:55 -06:00
Ben Loftis
1fa7a72f72 midi_region_view: rename 'apply_diff' to 'apply_note_diff' for clarity
these functions operate on the _note_diff_command,
 which is explicitly a NoteDiff,  not a generic DiffCommand

also fix a few thinkos where the ambiguous naming led to errors
2022-05-10 15:47:48 -05:00
Ben Loftis
9fcf8b3a11 midi_region_view: rename commit_resizing -> finish_resizing
* 'commit' suggests that this function would commit an undo record
2022-05-10 15:47:48 -05:00
Paul Davis
9e77d8923a MIDI: ctrl-d now duplicates selected notes
This commit also fixes selection-after-paste, so that the selection is always
the newly pasted notes.
2022-04-27 08:13:09 -06:00
Paul Davis
a0d08232ad midi selection: implement MidiRegionView::set_selected()
This allows an MRV to clear its own selection of notes when
the region itself is deselected. This should help #8729 and #8899
2022-04-17 22:58:16 -06:00
Paul Davis
bde3f3a277 midi region view: allow change_note_note() to return the new note value 2022-04-17 12:02:53 -06:00
Paul Davis
4fa97e2c50 split midi region view redisplay into two similar methods
::model_changed() is used when the model has changed (eg. new notes or some
notes deleted); ::view_changed() is used when only some view parameter (e.g.
zoom, scroll, track height etc) has been altered.

Not fully functional yet (::view_chanted() ignores scroll)
2022-04-05 20:52:10 -06:00
Paul Davis
b8a6b97b49 redesign (MIDI)RegionView display disabling around an RAII model 2022-04-05 20:52:10 -06:00
Paul Davis
ae8c043fe1 regionviews: use integer counter instead of boolean to control redisplay of contents 2022-04-05 20:52:09 -06:00
Ben Loftis
252ae56a08 MIDI Draw: change behavior regarding MIDI Channel of new notes
When adding a note, use these criteria to choose the channel number:
* if the user has explicitly specified a note in the pulldown, use that
* if the user has AUTO selected and we are in a region, choose the nearest note's channel (consistent with velocity behavior)
* as a fallback, query the track for its channel-filter (old behavior)
2021-11-18 08:23:08 -06:00
Ben Loftis
2a6da0113f MIDI Draw: Provide a menu to explicitly select note-length
ToDo: 3,5,7's?  keyboard shortcuts?
2021-11-18 07:35:13 -06:00