8556560eca
change design of MidiRegionView::add_to_selection() so that the rubber-band select works again
...
Adding the first note trigged Editor::set_selected_midi_region_view() which cleared
the (newly added to) selection
2020-05-01 22:27:50 -06:00
044be53616
attempt to properly manage MIDI note display of selected status
...
Whether to display the selected outline depends on BOTH whether the note is
selected, and whether we are in an internal editing mode.
2020-05-01 17:39:13 -06:00
0b7d0ebfd6
remove debug output
2020-04-17 10:47:01 -06:00
ca9e54100a
more sane design for MidiRegionView::nudge_notes()
...
Use nudge clock if snap/grid is disabled; use grid (and grid/4 if "fine" adjustment is chosen)
2020-04-16 21:39:38 -06:00
8545250936
MidiRegionView no longer handles any keypresses or alters editor "note selection"
...
1. Alt is still handled to change drag behavior
2. Selection doesn't store notes unless they are part of the cut buffer, which means we should not
be altering the note selection in the editor's selection object most of the time.
2020-04-16 17:48:12 -06:00
4e005540c6
Update PatchChange when instrument/midnam changes
2020-04-04 01:48:30 +02:00
8d28115ec7
Update MIDNAM handling in GUI
...
* Always use InstrumentInfo for lookups.
Remove name lookups that directly used gui_property()
* Use set/get_gui_property() only to save/restore state,
push custom selection to InstrumentInfo.
* Only store custom selection, use unset for "default"
default = plugin-provided (if available) otherwise general-midi
2020-04-01 16:33:40 +02:00
e6ce5a611c
shortest note length after a drag-trim is 1 tick, not 1/512 beats
2020-01-28 00:06:12 -07:00
fd62b38f8d
correct computation of new note length after a front-drag-trim
2020-01-28 00:05:44 -07:00
2d5a3013e0
fix 03c4335c1e
to use the correct test for zero length
...
That commit used the dangerous Beats::operator== (int) comparison, which only campares the beat portion
2020-01-14 14:35:08 -07:00
03c4335c1e
fix drawing of zero-length notes
...
Note that the result is too narrow to be manipulated, though it can be moved
2020-01-11 10:57:21 -07:00
929bd7c8ac
use Note::end_time() == numeric_limits<Beats>::max() as the indicator that a note is in-process w.r.t. recording
...
We used to use length() == 0, but this clashes with actual zero-length notes
2020-01-11 10:57:21 -07:00
2ae327fa8f
prevent MIDI note starts being drawn earlier than their region start
2020-01-08 10:22:08 -07:00
a855119bdd
rename all Evoral source from .(hpp|cpp)$ to .(h|cc)
2019-11-02 16:32:18 -06:00
b83ef09947
various adjustments so that a MidiPlaylist gets re-rendered whenever it changes.
...
This may still be missing a few changes (i.e. they do not cause re-rendering)
2019-11-02 16:32:18 -06:00
0573e7cdf0
alter where note resolution happens when a re-rendering is scheduled for a MIDI track
2019-11-02 16:32:18 -06:00
5b90bad68c
fix commented out decision on whether or not to hide/show sysexes in MIDI regions
2019-09-20 12:26:49 -06:00
4050ca5633
Update GPL boilerplate and (C)
...
Copyright-holder and year information is extracted from git log.
git history begins in 2005. So (C) from 1998..2005 is lost. Also some
(C) assignment of commits where the committer didn't use --author.
2019-08-03 15:53:15 +02:00
e0bdcd7137
(Source List) Clean up the natural_position implementation (gtk2 part).
2019-08-01 12:11:31 -05:00
eb4e854a56
Replace some more "samples" with "frames" (rectangles)
2019-04-09 00:31:29 +02:00
01a43c6b1e
Another round of whitespace fixes
2019-04-09 00:27:33 +02:00
a0b032efe2
Revert more "frame/sample" replacements
...
- Coverage concerns rectangles (frames, not sample)
- frame-handles are rectangles
- layout container boxes are frames
- inline display boxes are display_frame
2019-04-08 22:42:47 +02:00
8a7e452265
Yet another "Rect frame" (not a sample)
2019-04-08 20:57:56 +02:00
f9e12235c3
Frame as in "picture frame", not sample
2019-04-08 20:19:15 +02:00
83981a37a3
Ignore scroll-wheel while dragging notes.
...
Previously, dragging a MIDI note and scrolling with scroll wheel
(to change velocity) made the note jump back to location before drag.
2018-08-09 18:11:18 +02:00
0883f02de9
new_grid: The Return of the snap_to_X functions.
...
We no longer assume that Snap always uses the visible ruler lines.
If you want to snap to the grid, and ignore the users zoom scale, use SnapPref::SnapToGrid_Unscaled
This fixes 2 (known) oversights: "snap region(s) to grid" and "regions whose start are left of the canvas edge".
2018-07-27 00:28:47 +02:00
b0e496c825
remove more unused MIDI note colors
2018-07-05 16:52:49 -04:00
870fe055cf
make use-note-color-for-velocity much much more efficient
...
(by not invoking the global color change signal)
2018-07-03 18:33:11 -04:00
a1df752095
call Note::set_velocity() at an appropriate time
2018-07-03 11:28:01 -04:00
f54f270627
Fix a few warnings
2018-02-17 09:12:38 -06:00
dc61256466
new_grid: Rewrite of Snap and Grid. (squashed commit)
...
Separate Snap from Grid. Lots of naming changes.
Multiple simultaneous snap options allowed. Grid is one of the possible Snap options.
Grid uses the same data as the rulers. Replace complicated tempo_lines with simple grid_lines.
The Grid is zoom-scale-sensitive along with the rulers. If you are zoomed out, grid becomes coarser.
2018-02-09 09:59:39 -06:00
d6eb1c826f
new_grid: MidiRegionView::motion should propagate thru RegionView, so snapped_cursor is updated. This probably fixes other bugs as well.
2018-02-09 08:26:27 -06:00
c6eab71435
new_snap: Snapped Cursor ( squashed commit )
...
Snapped Cursor is a line that follows the edit point, and indicates where the operation will occur.
This replaces and extends the line that appears with the Cut tool.
New associated preferences: snap_threshold and show_snap_cursor.
2018-02-09 08:21:45 -06:00
b9c6ffac21
fix header order and space alignment
2017-09-24 12:57:27 -04:00
7db12f6b12
convert codebase to use Temporal for various time types
2017-09-24 12:03:54 -04:00
41bd6d3721
fix unintentionally edited color/theme name from f2s edit
2017-09-19 11:15:22 -04:00
30b087ab3d
globally change all use of "frame" to refer to audio into "sample".
...
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
e37558502e
changes required to operate with the Evoral::Beats ticktime commit
2017-09-18 11:40:53 -04:00
nick_m
d1932b23b3
Call Editor::abort_reversible_command() in MidiRegionView::abort_command()
...
Fixes broken undo stack if no changes occurred.
Edit note dialog is currently the only user.
2017-07-22 02:15:20 +10:00
André Nusser
77a2632e34
Fix compiler warning of unused variable.
2017-05-14 18:15:10 +02:00
05231949e6
When adding a PC, use the channel given in the dialog.
2017-03-29 23:53:56 +02:00
nick_m
16089bff96
more linked midi region trim drag fixes.
...
- freeze the correct playlists on fiorst move.
- only update the start offset of linked regions once the drag
has finished.
2017-03-06 15:51:53 +11:00
nick_m
1f9c26136c
rework percussive hit spraying.
...
- the spray is limited to the first entered note.
- all new notes are selected (requires a selection change to
MRV::create_note_at()
2017-03-05 01:57:10 +11:00
nick_m
e8b5b4fcf3
offset linked regions to compensate for negative start after trim drag.
...
- should fix 7105
2017-03-04 11:28:49 +11:00
nick_m
62cef7feff
also fix flying percussive hits while copy-dragging.
2017-02-24 01:11:56 +11:00
nick_m
ae3c50c495
hotfix for flying percussive hits while dragging.
...
- Hit::position still may not be set correctly,
but this patch eliminates the error for now.
2017-02-24 00:36:58 +11:00
nick_m
b24dd49c1a
update note length when dragging notes (over tempo change)
2017-02-07 03:10:02 +11:00
nick_m
987c1cb94a
remove overzealous bounds check when dropping notes.
2017-02-05 05:26:18 +11:00
nick_m
5031bdcf10
midi note drags are music-based.
...
- wysiwyg (during drag) when dragging more than one note across
a tempo change.
- introduces a muscal equivalent of snap_delta (only used for
note drags atm)
- split earliest note in selection into a separate function
- MRV::copy_selection() returns the equivalent _primary note
to avoid offset hell.
- RV::snap_frame_to_frame returns a MusicFrame
- prevent note drag moving before region start.
2017-02-05 05:02:01 +11:00
fac04afbba
If 'MidiRegionView::find_canvas_sys_ex()' fails, make it return a boost::shared_ptr<> (rather than returning an int)
2017-02-04 16:14:56 +00:00
nick_m
f7b005ebf1
clean up patch change/sysex headers.
2017-02-04 22:57:36 +11:00
nick_m
2eca71e6f1
set sysex height & position on redisplay.
2017-02-04 22:57:36 +11:00
nick_m
3e4eaf3991
improve sysex data display.
...
- don't add a new SysEx canvas item every time we zoom or drag.
- speed up redisplay generally using PatchChange-like method
for finding items (find_canvas_sys_ex() in boost::unordered_map).
2017-02-04 22:57:36 +11:00
nick_m
59daffea1d
rework snap
...
snap now fills in a struct (MusicFrame) which contins a snapped frame
along with a music divisor.
this gives useful information wrt magnetic snap which may or may not
have rounded to an exact musical position.
region position may now be set musically (using quarter notes for now).
this patch fixes several problems in the current code:
- dragging a list of music-locked regions now maintains correct
musical offsets within the list.
- splitting regions using magnetic snap works correctly (#7192 )
- cut drag should now work correctly with magnetic snap.
- musical length of split midi regions is no longer frame based.
2017-02-04 22:57:36 +11:00
nick_m
ab052d0565
speed up midi ghost region update
...
- as MRV removes invalid notes from the GR, we
can simply update all events after checking vertical visibility.
2017-01-30 01:46:38 +11:00
nick_m
e7415c6619
MidiRegionView::redisplay_model() - code cleanup
2017-01-27 00:56:39 +11:00
8432a77329
MIDI note copy needs to adjust pitch of new notes before adding them
2017-01-24 23:07:27 +01:00
8dedea5ffa
implement copy-drag for MIDI notes.
...
Probably some corner cases to be fixed, but pretty functional and largely modelled
on existing code (paste, drag, step add note etc.)
2017-01-23 21:58:02 +01:00
3dbdc4d837
Leave some notes about memory-leaks
2017-01-20 13:54:12 +01:00
nick_m
9e9f99f004
note display performance.
...
use boost::unordered_map as a note store for ghost & midi region
views.
as per otiginal method, only notes within regoin bounds are stored.
2017-01-04 00:19:31 +11:00
nick_m
4d274cbf26
fix bug where hidden ghostregions were updated.
2016-12-30 20:40:48 +11:00
8b8f705520
Fix updates of region-color
2016-12-29 23:06:15 +01:00
nick_m
e58fda2fa2
minor MidiRegionView::redisplay_model() cleanup
2016-12-30 00:46:43 +11:00
nick_m
68ca289b92
retain note selection for invalidated notes.
2016-12-30 00:40:20 +11:00
nick_m
f4b3133035
more note performance work (dereference less).
2016-12-29 23:22:06 +11:00
nick_m
149cb402b9
revert 7805217b5
(make note mode change work again).
2016-12-29 23:15:35 +11:00
nick_m
d49b141e11
improve the performance of MidiRegionView::find_canvas_patch_change().
...
- also fixes patch changes appearing outside region bounds
when copied/trimmed.
2016-12-29 04:21:37 +11:00
nick_m
7805217b5f
don't clear note items in MidiRegionView::display_model().
...
- redisplay_model() does this for us.
2016-12-29 02:39:57 +11:00
nick_m
da92d2d764
speed up load/quit for sessions containing ~25k events.
...
- MGR uses a _note_group to hold events.
- MRV & MGR delete canvas notes directly from their note group.
- sysex is untested (it uses MRV note group).
2016-12-24 02:01:37 +11:00
nick_m
ddd085cf4e
hide ghost events appropriately (e.g. after split).
2016-12-23 05:07:22 +11:00
nick_m
37e858da7d
only update GhostEvents on visible trackviews.
...
- this requires that MidiGhostRegion::update_contents_height()
also controls visibility.
2016-12-23 02:55:51 +11:00
nick_m
96048ad4c0
midi scrooming performance updates.
...
- MGR visibility is handled by update_note/hit()
MRV unconditionally updates MGR events
- remove MidiGhostRegion::update_range()
- rename set_contents_height -> update_contents_height
2016-12-23 00:51:34 +11:00
nick_m
eecc9ed743
fix various midi display bugs introduced by 9038be49d8
.
2016-12-21 03:18:18 +11:00
nick_m
9038be49d8
improve midi zoom/scroom performance with lots of notes.
...
- mostly due to searching a multiset rather than a list of
canvas events.
2016-12-20 21:31:54 +11:00
nick_m
a99331a4e9
more work on patch change redisplay.
...
- fixes just-introduced undo crash.
2016-12-16 01:58:58 +11:00
c9444e048e
correct return syntax
2016-12-15 11:57:31 +00:00
nick_m
cfbcadc7ef
speed up patch change redisplay when using scroomer / adjusting height.
...
- zoom is still a bit slow.
2016-12-15 22:35:23 +11:00
nick_m
176625d9e0
test diff for patch change performance when caching colours.
2016-12-14 04:05:08 +11:00
08fffeffec
Remove Evoral::MIDIEvent
...
It is slightly questionable whether type specific methods like
velocity() belong on Event at all, these may be better off as free
functions. However the code currently uses them as methods in many
places, and it seems like a step in the right direction, since, for
example, we might some day have events that have a velocity but aren't
stored as MIDI messages (e.g. if Ardour uses an internal musical model
that is more expressive).
In any case, the former inheritance and plethora of sloppy casts is
definitely not the right thing.
2016-12-03 15:18:21 -05:00
nick_m
bd107a28c6
MidiRegionView::clear_events() does _selection.clear(). remove the extra one.
2016-11-23 15:32:13 +11:00
nick_m
fcad5a337f
decouple midi region note range and height from midi streamview.
...
- this allows a midi region drag to update the visible notes
correctly while crossing MIDI streamviews with a differing
note range.
as a side effect, fixes a bug where changing
note range on a track did not draw some notes
(apply_note_range redisplays the model).
2016-11-23 08:04:14 +11:00
nick_m
766fa9aa5b
don't display notes that start at region end.
...
- its not obvious that this is happening in sustained mode,
but Percussive reveals all.
2016-11-22 02:59:57 +11:00
nick_m
a14c577b8a
fix thinko in 8e8c4a73f1
.
2016-11-22 02:21:05 +11:00
nick_m
8e8c4a73f1
prevent Percussive mode from displaying a ghost hit at region end.
2016-11-22 02:01:01 +11:00
nick_m
eef18c47fd
fix compilation, rename PercussiveCreateDrag -> HitCreateDrag
2016-11-21 04:20:27 +11:00
nick_m
5bcb9adbf8
rework mouse hit creation (percussive mode) - mostly as per #7130 .
...
- snap behaviour is round to nearest
- holding down button 1 while dragging creates many
(if not already present) hits.
2016-11-21 04:02:21 +11:00
nick_m
7eed31a4b2
MRV handles an alt key press even if nothing happened.
...
- nothing else treats a modifier press as
a key press event, so don't pass it on.
amends 0af9fb0d
2016-11-21 01:17:24 +11:00
nick_m
f989ed5b7f
fix for short notes being displayed as infinitely long.
2016-11-21 00:17:31 +11:00
nick_m
0af9fb0dee
pressing alt while creating a note (snap modifier) keeps mouse_state.
2016-11-20 04:54:20 +11:00
nick_m
e525be86d6
after creating a note, don't add the ghost note until next motion.
2016-11-20 04:51:38 +11:00
nick_m
cb64e926c2
NoteCreateDrag starts on button press.
...
- removes the separation between click and
drag-creation of notes noth now handled by the drag code).
2016-11-20 04:49:18 +11:00
nick_m
0e0ef41ed4
remove unused variable.
2016-11-19 21:42:50 +11:00
nick_m
c9dd1d39d1
further to 1a6a72b57
, handle deleting a note while a non-selected one is entered.
2016-11-19 21:40:41 +11:00
nick_m
1a6a72b57a
fix for ghost note becoming stuck after note selection deleted.
...
- thanks ristic for the report
2016-11-19 03:03:20 +11:00
nick_m
d9dea0a3aa
rename Region pos_beats -> quarter_note
2016-11-11 03:37:08 +11:00
nick_m
dca96d8b5d
rename Region pulse to pos_beats. use new beat distance api where required.
...
- add more debugging output detecting regions whose
beat and frame position do not align on a playlist.
this is required as a check as we have never used
frame rounding on constant tempi before 8884a5723dc
2016-11-11 03:37:08 +11:00
nick_m
24846f478b
clean up ghost note wrt create drag.
...
- hide ghost note when add dragging.
- new note length snaps as per ghost note start (shifted snap).
- prevent ghost note from appearing before region start.
2016-10-26 04:52:09 +11:00
nick_m
1c9dbb5242
Amend previous commit.
2016-10-17 04:33:48 +11:00
nick_m
2359a0b2fa
Set note colour of new MidiGhostRegions corrctly.
2016-10-17 04:23:43 +11:00
nick_m
1692968627
Slightly improve note update performance, fix note resizing for non-4.0 meter divisors.
2016-10-16 03:11:05 +11:00