Commit Graph

110 Commits

Author SHA1 Message Date
Paul Davis ef0938a16d more improvements to velocity drawing (including straight line) 2023-10-27 11:50:15 -06:00
Paul Davis c642611fe8 fix crash in ghostregions after adding notes but not invalidating optimization iter (#9452) 2023-09-21 16:26:59 -06:00
Paul Davis cf7ba80fc1 the basics of lollipop dragging 2023-06-26 14:18:18 -06:00
Paul Davis f7e97be115 canvas lollipops: object redesign and reimplementation 2023-06-26 14:18:17 -06:00
Paul Davis 4bafadc419 steps to an ecology of lollipops 2023-06-26 14:18:17 -06:00
Paul Davis e54e8f3f4c tweaks to GhostRegion to prepare for possible inheritance 2023-06-26 14:18:17 -06:00
Paul Davis 2797ea9666 remove unusued "MIDI underlay" cruft 2023-06-26 14:18:17 -06:00
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus d1b72b28ec
NO-OP: remove unused code 2023-01-13 21:20:21 +01:00
Robin Gareus 3442500002
Remove "midi frame base", consistent TAV color (1/2) 2022-12-10 02:37:05 +01:00
Robin Gareus f003bee985
Use a dedicated Canvas Group for MRV
This fixes rendering of opaque MIDI regions (previously
MIDI regions were always transparent). This change provides a
way to "flatten" layered MIDI regions, while still allowing
to show the note-line and grid behind the regions.
2022-12-10 02:37:05 +01: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 a855119bdd rename all Evoral source from .(hpp|cpp)$ to .(h|cc) 2019-11-02 16:32:18 -06: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
Robin Gareus 31815b5f26
NO-OP: whitespace
This fixes mostly <tab> after <space> and similar <tab> not used
for indenting as well as some related code alignment issues.
2019-04-13 17:57:46 +02:00
Paul Davis 644a05f60b use new Canvas::Note object for (sustained) note display 2018-07-03 11:21:53 -04:00
Robin Gareus beb73edf55 Purify libcanvas, remove libardour dependency
A canvas is just a canvas. Move WaveView into its own library.
2017-07-17 21:06:04 +02: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
nick_m 86a471f93f MidiGhostRegion micro-optimisation. 2017-01-27 00:58:09 +11: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 5091a04362 another small improvement to MGR::add_note() performance. 2016-12-30 02:21:12 +11:00
nick_m 52275254a7 allow the use of static_cast for MGR ghost events (speeds things up a bit). 2016-12-30 01:55:41 +11:00
nick_m f4b3133035 more note performance work (dereference less). 2016-12-29 23:22:06 +11:00
nick_m cee7e0cb53 improve MidiGhostRegion::find_event() performance (end is quite common). 2016-12-29 02:36:58 +11:00
nick_m 5bada6d533 fix leak in MGR _note_group 2016-12-24 02:14:43 +11:00
nick_m da92d2d764 speed up load/quit for sessions containing ~25k events.
- MGR uses a _note_group to hold events.

	- MRV & MGR delete canvas notes directly from their note group.

	- sysex is untested (it uses MRV note group).
2016-12-24 02:01:37 +11:00
nick_m 0e8852963e shave another line from MidiGhostRegion::clear_events(). 2016-12-23 23:33:13 +11:00
nick_m 4c12df6cf3 fix thinko in previous commit. 2016-12-23 23:24:54 +11:00
nick_m efacbb1485 possibly faster way to clear ghost events. 2016-12-23 23:03:22 +11:00
nick_m cb2bbb87d7 slight speed improvement on GhostEvent ctor. 2016-12-23 22:20:08 +11:00
nick_m 7bf3345ada remove double check for note range in MGR::update_note/hit() 2016-12-23 22:18:43 +11:00
nick_m 1e487d59d1 MidiGhostRegion::update_contents_height() is only about height (again). 2016-12-23 05:44:29 +11:00
nick_m ddd085cf4e hide ghost events appropriately (e.g. after split). 2016-12-23 05:07:22 +11:00
nick_m 37e858da7d only update GhostEvents on visible trackviews.
- this requires that MidiGhostRegion::update_contents_height()
	  also controls visibility.
2016-12-23 02:55:51 +11:00
nick_m 96048ad4c0 midi scrooming performance updates.
- MGR visibility is handled by update_note/hit()
	  MRV unconditionally updates MGR events
	- remove MidiGhostRegion::update_range()
	- rename set_contents_height -> update_contents_height
2016-12-23 00:51:34 +11:00
nick_m ebf60feb13 remove wtfery in MidiGhostRegion ctor 2016-12-23 00:41:25 +11:00
nick_m 05c3850ac1 GhostEvent wrangling.
- update_range() solely looks after visibility.
	- update_note/hit() positions both x and y using code stolen from
	  update_range()
	- add update_contents_height() for when we just change the GR height.
	- find_event() is now used rather than map::find()
	- use temp canvas items to avoid constructor overhead.
2016-12-22 04:41:25 +11:00
nick_m e75788614a use map::find in the currently unused MidiGhostRegion::find_event()
- the next one is still often the one we want.
2016-12-22 04:41:25 +11:00
nick_m 2000349e69 revert b330a8a0ce 2016-12-22 04:41:25 +11:00
nick_m b330a8a0ce improve scroomer performance.
- MRV will redisplay the model on scroom, so there is no need
	  to update the range as well.
2016-12-21 23:43:05 +11:00
Robin Gareus 63e89b2090 'Rect' is ambiguous (also defined in MacTypes.h) 2016-12-21 13:21:54 +01:00
nick_m bf75770939 use a map to find GhostEvents by a pointer to Note. 2016-12-21 03:30:32 +11:00
nick_m 165645495c there is no need to do a full set_colors() in MidiGhostRegion ctor. 2016-12-11 23:57:50 +11:00
nick_m c876aea64d midi ghost region fill colour is per event. don't store it. ensure _outline is set. 2016-11-25 04:50:46 +11:00
nick_m 1692968627 Slightly improve note update performance, fix note resizing for non-4.0 meter divisors. 2016-10-16 03:11:05 +11:00
nick_m b732147676 Use Note::set (Rect) for speed improvement when rendering notes. 2016-07-10 02:18:37 +10:00
nick_m 3c1bc99df9 Improve midi model redraw performance by caching colours. 2016-07-10 02:18:36 +10:00
Tim Mayberry b074ff0dd5 Remove GhostRegion::CatchDeletion signal to reduce session close times
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-22 11:51:03 -04:00
Tim Mayberry 6b019a4953 Move UIConfiguration Singleton into UIConfiguration header
This removes the direct dependence on ardour_ui.h from 39 files
2015-09-16 16:55:17 -04:00
Paul Davis 11cfdd4c6d remove use of TimeRectangle 2015-02-11 21:59:38 -05:00