summaryrefslogtreecommitdiff
path: root/gtk2_ardour/midi_region_view.cc
AgeCommit message (Collapse)Author
2016-02-22Spelling correction patch from DebianAdrian Knoth
Patch taken (and forward-ported to HEAD) from <https://anonscm.debian.org/cgit/pkg-multimedia/ardour.git/plain/debian/patches/0100-fix-typos.patch>
2016-02-11Fix bug #6762, MIDNAM note read outs don't work when dragging MIDI noteTim Mayberry
Also fixes it so the key is selected in the piano roll header
2016-01-14Change handling of Midi note selection to eliminate signal emission/delays.Tim Mayberry
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-12Comment remaining unsolved bug.André Nusser
2016-01-12Don't show a ghost note when draw mode is entered over a note.André Nusser
2016-01-12Clean enter_internal and leave_internal in MidiRegionView.André Nusser
2016-01-12Hide MIDI ghost note when over existing note.André Nusser
2016-01-12Hide ghost note when switching from draw to internal edit mode.André Nusser
Before it was only hidden after moving the mouse.
2016-01-12Fix appearing ghost note after drag select in internal edit mode.André Nusser
2015-12-22Better align note end time with gridNil Geisweiller
2015-12-22Remove shortening inserted notes by one tickNil Geisweiller
I don't think this is necessary, if some synth cannot deal with that, perhaps Ardour could try to send the note off right before the next note on, even-though they supposedly occur simultaneously.
2015-12-02Enable horizontal scrolling in midi regions when note is selected.André Nusser
The shortcut for 'change velocities together' had to be changed to achieve that. The new shortcut is now primary+tertiary modifier +scroll, i.e. ctrl+shift+scroll for the default keys.
2015-11-01Add comment to MRV snap workaround.nick_m
2015-10-31Fix snap modifiers not working on notes when grid is set to off.nick_m
2015-10-24Clear point selection when uniquely selecting a note.nick_m
- Also fix selection undo when creating notes w/control in MouseContent mode.
2015-10-22Remove GhostRegion::CatchDeletion signal to reduce session close timesTim Mayberry
Currently when a GhostRegion is deleted by its "parent" RegionView it emits the static GhostRegion::CatchDeletion signal which is connected to the RegionView::remove_ghost method of every RegionView instance. With a static GhostRegion::CatchDeletion signal a particular test session causes 31 Million calls of RegionView::remove_ghost on Session deletion and the session takes 70 seconds to close with a debug build. The lifetime of a ghost region is tied to both the TimeAxisView(TAV) and RegionView(RV) in that when a RegionView is deleted all GhostRegion instances associated with the RegionView should be deleted or when a TimeAxisView is deleted all ghost regions that are contained in the view should be deleted. This means that there needs to be notification between GhostRegion and both classes. Instead of using a signal for this as we know there are only two listeners and GhostRegion already holds a reference to the TimeAxisView, also take a reference to the parent RegionView in the GhostRegion constructor and use it to notify the RegionView when GhostRegion destructor is called so it can drop any references it holds. Using a direct function call in the GhostRegion destructor to notify the TimeAxisView and RegionView "parents" brings the unload/close time down for the test session from 70 seconds to 4.5 seconds. The GhostRegion also references canvas items that are added to the TimeAxisView canvas group or at least a canvas group that it manages. So when the TimeAxisView is destroyed and the canvas group that is the parent of those items is destroyed, the GhostRegion's canvas items will also be deleted/destroyed by the parent canvas item/group. This means the GhostRegions must be destroyed when the TimeAxisView they are contained in is destroyed or there will be dangling references to canvas items that have already been deleted and trying to delete them again will be bad.
2015-10-17Replace static PBD::Signal in NoteBase with direct call to MidiRegionViewTim Mayberry
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-05NOOP, remove trailing tabs/whitespace.Robin Gareus
2015-10-04globally remove all trailing whitespace from ardour code base.Paul Davis
Paul Davis was responsible for introducing almost all of this.
2015-09-18create new Event-IDs for pasted midi-notesRobin Gareus
2015-09-16Move UIConfiguration Singleton into UIConfiguration headerTim Mayberry
This removes the direct dependence on ardour_ui.h from 39 files
2015-08-15cont'd work on piano roll highlighting.Robin Gareus
2015-08-15Highlight note in piano roll - #6510Robin Gareus
2015-06-29Revert "replace two more instances of !! with implicit use of operator bool()"Paul Davis
This reverts commit e8eff9fb9c2fa6fc518404c2f9b731f8c28d3a23. OS X compiler gets confused by this change.
2015-06-29replace two more instances of !! with implicit use of operator bool()Paul Davis
2015-06-29Revert "use newly added operator bool() for Evoral::Beats rather than ↵Paul Davis
double-negation as boolean" This reverts commit a19902b52f08bf33c54e60dfb49c44a1c154f4c9. OS X compiler gets confused by this change.
2015-06-29Revert "replace two more instances of !! with implicit use of operator bool()"Paul Davis
This reverts commit e8eff9fb9c2fa6fc518404c2f9b731f8c28d3a23. OS X compiler gets confused by this change.
2015-06-29replace two more instances of !! with implicit use of operator bool()Paul Davis
2015-06-29use newly added operator bool() for Evoral::Beats rather than ↵Paul Davis
double-negation as boolean
2015-06-11Magnetic snap now works on note moves / resizes.nick_m
2015-06-11Make absolute snap the default snap.nick_m
- also fixes a couple of absolute snap bugs wrt midi notes.
2015-05-28Fix uninitialised variable.nick_m
2015-05-23Bring back contrained drag modifier with preference setting.nick_m
- this should work as before, but when applied to a button 1 drag, the constraint is in the first direction travelled.
2015-05-23Fix missing comment.nick_m
2015-05-23Fix inverted logic of SnapOff with snap modifiers pressed.nick_m
- also clean up, rename and comment some previous hanges.
2015-05-22Make note drags and resizes obey the disable sanp modifier.nick_m
2015-05-22More cleanupnick_m
- remove "no_magnets" ugh.
2015-05-17Relative Snap -make it activated by the tertiary modifier during drag.nick_m
Disabled/enabled with the shift key. no config stuff at all now. Move existing (strange) trim feature to primary + tertiary modifiers.
2015-05-17Relative snap - support magnetic mode (hackishly for now)nick_m
2015-05-16Relative snapnick_m
2015-03-29Fix mute of MIDI tracks with channel forcing.David Robillard
This moves MIDI channel filtering into a reusable class and moves filtering to the source, rather than modifying the buffer afterwards. This is necessary so that the playlist trackers reflect the emitted notes (and thus are able to stop them in situations like mute). As a perk, this is also faster because events are just dropped on read, rather than pushed into a buffer then later removed (which is very slow). Really hammering on mute or solo still seems to produce stuck notes occasionally (perhaps related to multiple-on warnings). I am not yet sure why, but occasional beats always.
2015-03-28Drag/Drop work-around midi note bleedingRobin Gareus
During DnD, the region uses the 'old/current' midi_stream_view()'s range and its position/height calculation. Ideally DnD would decouple the midi_stream_view() for the region(s) being dragged and set it to the target's range (or in case of the drop-zone, FullRange). but I don't see how this can be done without major rework. For now, just prevent visual bleeding of events in case the target-track is smaller.
2015-03-25Fix some strings incorrectly marked for translation.nick_m
My apologies to translators.
2015-03-14Only sound selected notes momentarily (#6142).David Robillard
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-13Fix note visibility (#0006168).David Robillard
2015-03-05Handle edits while playing precisely.David Robillard
This avoids stuck notes if active notes are edited, but without stopping all active notes in the region on any edit as before. This implementation injects note ons in places that aren't actually note starts. Depending on how percussive the instrument is, this may not be desired. In the future, an option for this would be an improvement, but there are other places where "start notes in the middle" is a reasonable option. I think that should be handled universally if we're to do it at all, so not considering it a part of this fix for now.
2015-01-25midi note paste undo fix.Robin Gareus
2015-01-16Fix hidden notes at trimmed region start.David Robillard
2015-01-17Fix note resize double undo bug.nick_m
Newly drawn notes are selected. Clear midi note selection on Selection::set_state().
2015-01-13Don't reuse _optimization_iterator - fixes crash on multiple note delete undo.nick_m