13
0
Commit Graph

279 Commits

Author SHA1 Message Date
11cb981e30 add extend_selection() to MIDI region bindings; expose invert-selection also 2021-06-08 07:40:54 -06:00
6bd12a4e83 clearing note selection in internal edit mode also deselects regions 2021-01-18 16:07:20 -07:00
4ad1c19166
Special case MIDI note selection auditioning - #8358
This adds a few exceptions to the general preference
"Sound MIDI notes as they are being selected in the editor".

* Select all no longer plays _all_ notes.
* Remain silent when selection is inverted or a range is selected.
* Play no sound when a saved selection is restored on session load.
2020-08-09 20:37:56 +02: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
eca7888047 NOOP: newline removal 2020-04-16 17:48:12 -06:00
abe275c3e0 add a bunch of argument-free methods to MidiRegionView for use as actions 2020-04-16 17:48:12 -06:00
4e005540c6
Update PatchChange when instrument/midnam changes 2020-04-04 01:48:30 +02:00
0a6f517230
No more doxygen warnings for gtk2_arodur/*
That's with doxgen 1.8.13.
2019-09-30 21:03:16 +02:00
c7be6f2330
Fix some UI doxygen warnings 2019-09-30 05:34:06 +02: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
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
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
601c317d70 Clean up library inheritance (colors.h, utils.h)
make libwidget independent of libcanvas.
Confine basics to pbd and gtkmm2ext.
2017-07-17 21:06:04 +02:00
Thomas Brand
63ea7b6516 NO-OP whitespace (updated GH PR #357) 2017-07-01 19:28:26 +02:00
nick_m
2012cf0d1a remove bogus variable from last commit 2017-03-05 01:23:12 +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
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
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
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
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
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