Commit Graph

288 Commits

Author SHA1 Message Date
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
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
831c085b2e remove MidiRegionView::snap_sample_to_grid_underneath() and replace with calls directly into Editor snap method 2021-08-13 12:51:35 -06:00
dee71c0a97 mostly fix region- and note-create drags 2021-08-13 12:51:32 -06:00
313d957eaf MidiRegionView: restore functioning (?) of snap_sample_to_grid_underneath() 2021-08-13 12:51:31 -06:00
5b2a435e02 getting editor_drag.cc to compile 2021-08-13 12:51:29 -06:00
9d69fa3820 another day or two's work on timeline type conversion 2021-08-13 12:51:29 -06:00
7433bc27e0 intermediate, unfinished snapshot of ongoing timeline types work on GTK GUI 2021-08-13 12:51:29 -06:00
0a469527f1 updated Temporal::Beats ... GUI edition 2021-08-13 12:51:28 -06:00
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