Commit Graph

258 Commits

Author SHA1 Message Date
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
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
Nil Geisweiller
6431c4a6d9 More 8 whitespace to tab indentation fixes 2016-12-22 14:20:13 +02: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
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
cc1d33a91d NoteCreateDrag - remove some code 2016-11-22 01:59:57 +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
9698f16aee Note selection state uses note event_id_t. 2016-10-15 23:50:02 +11:00
nick_m
4270569528 Fix bug where drawing long notes placed the new note on the previous snap line.
- NoteCreateDrag already applies this shift, so it was
	  always applied twice to the note start frame.
2016-09-23 05:06:03 +10:00
nick_m
c0f89e99a2 MidiRegionView uses quarter note snapping.
- also ensures poiinter ghost note respects the snap modifier.
2016-08-31 23:12:11 +10:00
nick_m
6e49ca61a4 Remove the temporary note group in MidiRegionView, update start trim during drag. 2016-07-22 23:21:27 +10:00
140258d8ab remove reference "const int32_t&" -> const int32_t"
this simplifies lua-bindings and also let's the compiler worry about
constant primitive types.
2016-07-10 15:30:41 +02:00
nick_m
93c24e4433 Paste uses exact beats. rework _start_beats calculation in copy-with-offset ctor. 2016-07-10 02:18:36 +10:00
90e35c7143 Fix bug #6762, MIDNAM note read outs don't work when dragging MIDI note
Also fixes it so the key is selected in the piano roll header
2016-02-11 08:17:18 +10:00
084af96bf4 Change handling of Midi note selection to eliminate signal emission/delays.
Each MidiRegionView(MRV) is connected to the Selection::ClearMidiNoteSelection
signal that is used to notify the all MRV instances to clear their note
selection.

The MRV class also has a private static SelectionCleared signal that is used to
signal other MRV instances when their selection has been cleared. When the
Selection::ClearMidiNoteSelection signal is emitted it causes each MRV to also
emit the SelectionCleared signal. So the emission takes quadratic time.

With 1500 MRV instances emission takes about 2.2 seconds on my machine, and
some operations like track selection cause it to be emitted 3 times(another
issue).

The Selection class in the Editor knows which MRV instances have note
selections, as it is notified by MidiRegionView whenever the selection count
becomes zero or becomes non-zero. Clearing the Note selection should then just
be O(N) and direct calls can be used rather than signals.

This change removes both the signals and uses the existing references between
Selection and MRV class to control note selection. There should be no
behavioural changes in Midi note selection with this change.
2016-01-14 20:41:44 +10:00
André Nusser
76237a696c Hide MIDI ghost note when over existing note. 2016-01-12 13:45:38 +01:00
e7b8e98db2 Replace static PBD::Signal in NoteBase with direct call to MidiRegionView
NoteBaseDeleted signal is static so each MidiRegionView(MRV) gets notified
about the deletion of each NodeBase instance even if it is contained in another
MRV

The NoteBase and MRV classes are currently coupled anyway, so this change uses
the reference to the MRV parent to directly call the parent when the NoteBase
is deleted. This is all in the GUI thread so I'm not sure why a PBD::Signal was
being used?

If the MRV class is the only reference holder to the NoteBase class
then I'm not sure if a callback is needed, perhaps the MRV should just remove
the note from the selection before deleting it but I'm not that familiar with
the code.

Signal emission/calls static NoteBaseDeleted signal vs direct with 10540
NoteBase instances.

static:

After Load Session: 6360638
After Unload Session: 12221026(5860388)

direct:

After load Session: 10540
After unload Session: 21080

Session Load/Unload time in master, debug/release with ~10000 Notes(seconds)

Load Debug: 32, 26
Unload Debug: 83
Load Release 32, 20, 42
Unload Release 26, 25

Session Load/Unload time with direct call debug/release(seconds)

Load Debug: 21.7, 18.1
Unload Debug: 69.4, 71
Load Release: 22.6, 13.4, 17.7
Unload Release: 24, 23.5

This is not a large Session, 1500 regions, 10000 notes so there is probably
some other funky stuff going on that needs fixing.
2015-10-17 22:15:07 -04:00
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
344c435dae cont'd work on piano roll highlighting. 2015-08-15 05:13:14 +02:00
nick_m
88477ace25 Fix inverted logic of SnapOff with snap modifiers pressed.
- also clean up, rename and comment some previous hanges.
2015-05-23 03:09:48 +10:00
nick_m
784abd03e0 Make note drags and resizes obey the disable sanp modifier. 2015-05-22 06:54:16 +10:00
nick_m
65e06fa350 More cleanup
- remove "no_magnets" ugh.
2015-05-22 04:26:16 +10:00
nick_m
91a34c596d Relative snap - support magnetic mode (hackishly for now) 2015-05-17 04:26:05 +10:00
nick_m
68a8330afc Relative snap 2015-05-16 04:15:52 +10:00
b72fc759c0 Only sound selected notes momentarily (#6142).
This is debatable, the "sustained until mouse release" behaviour is handy
sometimes, but this way seems like what most people probably want.

Also, this "fire it and forget it and let it delete itself a bit later" thing
with MidiPlayer makes me nervous.  I guess it's unlikely someone manages to
select a note then delete a track within 100ms, but, well...
2015-03-14 01:12:29 -04:00
4438263d4d Fix crash when undoing note delete. 2015-01-12 02:03:49 -05:00
nick_m
44203ce955 Fix AutomationTrackItem rubberband click thinking it was unhandled.
Fix several other cases where a single mouse click could cause several
(not nested) selection ops.
Fix missing selection memento for midi notes and midi commands.
Rename some variables.
Fix random style issues.
2015-01-11 04:07:31 +11:00
2a251b4570 MusicalTime => Beats. 2015-01-07 00:12:07 -05:00
e82ce75cb1 Fix display of MIDI while recording.
... almost.  There are some artifacts when you zoom out while recording that I
can't figure out, but whatever.

Also fix performance issues caused by last attempt at rec display while zoom.
2014-12-30 19:16:41 -05:00
606efb601c Show correct ghost hit for percussive tracks. 2014-12-28 20:23:52 -05:00
b54863c8c3 Set new note velocity based on surrounding notes. 2014-12-28 19:21:46 -05:00
49b7a46805 Fix potential memory errors with note player.
Seems unlikely, but if the event firing stuff is off, it could trigger the
issue (#5502) and/or a possible memory leak.
2014-12-24 16:54:38 -05:00
62355de33a Fix cursor update on nested entry.
For example, if you're in a note and something about the mode changes, it's the
underlying region context that needs to change.  So, seems we need a stack of
entry contexts to deal with this sort of thing.

Switching in/out of smart mode still doesn't update immediately because we
don't have the y-coordinate needed to update it.
2014-12-23 13:47:59 -05:00
David Robillard
670938c8c4 Fix various cursor problems.
Add a new scoped cursor system that makes it much harder to screw up and end up
with stick cursors and so on.
2014-12-20 01:13:25 -05:00
6031308520 Use color modifiers for dynamic region styles. 2014-12-18 20:23:34 -05:00
026f7bf5b7 Make MIDI regions translucent for internal tools. 2014-12-18 20:23:23 -05:00
7ab8a11fb5 Enforce internal/external selection exclusivity. 2014-12-18 20:22:48 -05:00
5f66300349 Support stepping bank by shift+scroll/arrow. 2014-12-17 20:18:11 -05:00
d2cafbe95a Remove some aborts that don't really need to be.
Enforce PatchPrimaryKey sanity at the type level rather than attempting to
check for it everywhere.

Remove dead file.
2014-12-17 19:43:09 -05:00
5ee4a5d56a Don't allow drawing notes in rec regions (crash). 2014-12-17 02:50:45 -05:00
39da38dd6e Nudge notes by 1 bar if secondary modifier active.
Similar to how transpose moves an octave if the same modifier is active.
2014-12-06 22:43:06 -05:00
16d60ef2f7 Grab keyboard only with note selection.
When entered, the keyboard is grabbed when the selection becomes non-empty, and
ungrabbed if it becomes empty again or the region is left or the user switches
out of internal mode.

This fixes scroll in internal mode and note moving with arrow keys.  Also frees
up useful keybindings when there is no note selection, which is much nicer than
the "nothing works in edit mode at all" greedy grab approach used previously.

Attempt #874327892 of getting this damned grabbing right.
2014-12-06 22:43:06 -05:00
63082821d8 Support paste between automation lanes.
Also push the increasingly unwieldly paste parameters into a context object.

As with othe things, currently it is only possible to do "cross-type paste" by
explicitly selecting the target track.  We will need to get automation region
view selection working to do better here, but at least for now it's possible to
get the data over.
2014-12-06 12:20:52 -05:00
c1cfa12d6e Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main
step towards using actual beat:tick time and getting away from floating point
precision problems.
2014-11-22 04:05:42 -05:00
24f7eccc86 Factor out copy-paste code to get grid type in beats defaulting to 1. 2014-11-22 00:46:15 -05:00
41a9060df9 Move time converters only to the region views that actually need them.
A step towards sorting out time issues more solidly, the time situation of MIDI
region views and automation region views is slightly different.
2014-11-22 00:46:15 -05:00
563f5c11a6 Support cut/copy/paste of MIDI notes and controllers at the same time. 2014-11-16 22:35:45 -05:00
31acd96384 Implement "multi-paste" for notes, regions, and automation.
The idea here is that pasting several times to the same location doesn't make
sense.  Instead, the paste is appended past the last paste, snapped to the
grid.  This make it simple to replicate a given section a number of times,
simply by copying once and pasting several times.

This behaviour only appears when successive pastes are done to the same
location (whatever the edit point is).  When the paste point changes, the
"multi-paste" state is reset.

Boots 'n cats 'n boots 'n cats.
2014-11-14 20:04:19 -05:00
5d5d9cb9e2 Fix various sticky/broken cursor issues.
This still isn't quite right, but it's a lot less broken than before, at least.
2014-11-14 02:37:36 -05:00