Commit Graph

296 Commits

Author SHA1 Message Date
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
Paul Davis 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
Paul Davis dee71c0a97 mostly fix region- and note-create drags 2021-08-13 12:51:32 -06:00
Paul Davis 313d957eaf MidiRegionView: restore functioning (?) of snap_sample_to_grid_underneath() 2021-08-13 12:51:31 -06:00
Paul Davis 5b2a435e02 getting editor_drag.cc to compile 2021-08-13 12:51:29 -06:00
Paul Davis 9d69fa3820 another day or two's work on timeline type conversion 2021-08-13 12:51:29 -06:00
Paul Davis 7433bc27e0 intermediate, unfinished snapshot of ongoing timeline types work on GTK GUI 2021-08-13 12:51:29 -06:00
Paul Davis 0a469527f1 updated Temporal::Beats ... GUI edition 2021-08-13 12:51:28 -06:00
Paul Davis 11cb981e30 add extend_selection() to MIDI region bindings; expose invert-selection also 2021-06-08 07:40:54 -06:00
Paul Davis 6bd12a4e83 clearing note selection in internal edit mode also deselects regions 2021-01-18 16:07:20 -07:00
Robin Gareus 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
Paul Davis 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
Paul Davis eca7888047 NOOP: newline removal 2020-04-16 17:48:12 -06:00
Paul Davis abe275c3e0 add a bunch of argument-free methods to MidiRegionView for use as actions 2020-04-16 17:48:12 -06:00
Robin Gareus 4e005540c6
Update PatchChange when instrument/midnam changes 2020-04-04 01:48:30 +02:00
Robin Gareus 0a6f517230
No more doxygen warnings for gtk2_arodur/*
That's with doxgen 1.8.13.
2019-09-30 21:03:16 +02:00
Robin Gareus c7be6f2330
Fix some UI doxygen warnings 2019-09-30 05:34:06 +02:00
Robin Gareus 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
Paul Davis b9c6ffac21 fix header order and space alignment 2017-09-24 12:57:27 -04:00
Paul Davis 7db12f6b12 convert codebase to use Temporal for various time types 2017-09-24 12:03:54 -04:00
Paul Davis 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
Robin Gareus 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
Paul Davis 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