13
0
Commit Graph

117 Commits

Author SHA1 Message Date
22a14a56f3 use new selection API to avoid double signal when a track or tracks are SET as the selection 2016-01-29 16:15:41 -05:00
fbe236999d modify Selection API to provide (default-valued) "with_signal" argument to all ::clear_*() methods
This allows the clear methods to be used before calling ::add(), to avoid the
emission of a signal saying "there are no <foo> selected right now".

There should be no side-effects from this commit.

Note that correct use of this new API is complex, and requires avoiding the use
of wrapper methods like clear_objects().
2016-01-29 16:15:41 -05: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
nick_m
578a60b875 Add error check to region gain control point selection undo. 2015-10-20 00:53:29 +11:00
nick_m
202a23d513 Add region gain point selection undo. 2015-10-20 00:53:28 +11:00
nick_m
17294ab9ec Make control point selection more consistent.
- disallow simultaneous events via ControlList::editor_add ()
	- clicking on an automation line selects the points that define it.
	- don't 'flash' a region selection when using mousedraw mode.
	- cp click selection resembles region selection.
	- region gain points respect snap modifier (a la automation points).
2015-10-20 00:53:27 +11:00
e1f168de11 rename Marker class
Classes are in the global namespace.
OSX has a flat namespace and OSX32bit/Carbon has a Marker too.
2015-07-23 17:58:40 +02:00
99f28d1966 initialize uninitialized variable
just another hint for clang/static analysis.
2015-03-17 04:11:19 +01:00
b489385bf1 fix some static-analysis warnings 2015-02-19 20:37:58 +01:00
nick_m
ade1c4923c Fix note resize double undo bug.
Newly drawn notes are selected.
Clear midi note selection on Selection::set_state().
2015-01-17 04:55:05 +11:00
764aad9efe clean up whitespace & debug output in 44203ce 2015-01-11 02:56:53 +01: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
nick_m
884cc6f90c Add automation track control points to undo history (and selection_op history). 2015-01-02 08:01:12 -05:00
nick_m
792f9ff37b Removed unrelated change in Selection::set_state () (clear_points()). 2015-01-02 08:01:12 -05:00
nick_m
a795892492 Separate selection operations into their own temporary history mechanism.
The user can now replay *all* earlier selection operations until the next
session undo/redo command, or the completion of a new operation.
Nothing relating to selection ops is stored, and selection operation history
is begun on first idle.

Selection operation history is fundamentally different from the history of
operations which act on a selection in terms of both their viewport and the
amount of information required to replay them.
WRT undo, the user of a selection op doesn't care about the viewport state
at the beginning of an op, but rather that at the end of the previous one.
2015-01-02 08:01:12 -05:00
057cf770f0 32/64bit compat 2014-12-31 01:15:39 +01:00
a12a065457 Fix copy paste of MIDI and track automation. 2014-12-18 20:23:34 -05:00
7ab8a11fb5 Enforce internal/external selection exclusivity. 2014-12-18 20:22:48 -05:00
nick_m
9af9e17adc Add editor selection state to session history via a SelectionMemento, which
combines selection related editor properties with the current editor selection.

The related editor properties are:
mouse mode,
zoom setting,
left frame of the canvas,
y origin of the canvas.

Selection state now includes region views (storing the underlying region id)
and time.

This patch also fixes a region mute undo bug.
2014-12-18 11:03:10 -05:00
767c0238a3 Replace half-baked param metadata with descriptor.
Among other things, this means that automation controls/lists have the actual
min/max/normal/toggled of parameters, and not those inferred from the Parameter
ID, which is not correct for things like plugin parameters.

Pushing things down to the Evoral::ParmeterDescriptor may be useful in the
future to have lists do smarter things based on parameter range, but currently
I have just pushed down the above-mentioned currently used attributes.
2014-12-01 23:35:24 -05:00
2fa6caad95 Support cut/copy/paste of several regions and lines at once.
The idea here is to do the reasonable thing, and copy objects of some
type (e.g. MIDI region, gain line) to tracks with a matching type.  The user
can override this with a track selection, which will be used straight-up.

Lost: ability to copy/paste lines across types, e.g. gain to pan.  This is
often questionable, but sometimes useful, so we will need to implement some
sort of "greedy mode" to make it possible.  Implementation simple, but not sure
what to do.  Perhaps this should only be possible if one automation track is
explicitly (i.e. via track selection) involved, and the types are at least
compatible-ish?
2014-11-16 22:35:45 -05:00
6b3a8915f3 add abort() to non-reached code
This cleans up a lot of false-positives in static analysis
and also helps compilers to optimize code paths in general.
(tagging the fatal stingstream operator as ‘noreturn’ is
far less trivial)
2014-11-14 11:30:08 +01:00
4e85bda431 selecting a track in the mixer, with synced selection, will now clear any objects selected 2014-09-03 09:40:22 -05:00
abe203de65 fix copy paste error in selection 2014-07-07 14:15:25 -05:00
b39c30dbd1 remove leftover cruft from link-region-and-track removal 2014-07-07 09:07:06 -05:00
6d97d72999 remove some cruft with previous commits. remove option link-region-and-track-selection since they are now exclusive, and rename select-all-regions to select-all-objects to match the implementation 2014-07-06 14:02:13 -05:00
0b38d65dd0 new approach to selections which will help rationalize Split and similar functions. Object and Track selections are now mutually exclusive. a split will happen at (a) selection->regions (b) the intersection of edit_point and selection->tracks or (c) the region under the mouse, IFF nothing else is selected. 2014-07-05 20:47:43 -05:00
977f2b35df severe rationalization (still incomplete) of behaviour of cut + copy.
Quite a bit more to do here to make this as intuitive as it ought to be.
2014-02-26 10:51:38 -05:00
9ba2c04820 ensure that track selection operations call ::set_selected() for tracks, allowing faster lookups of selected status during drags 2014-02-25 21:53:52 -05:00
67265c6d90 various fixes for moving markers, fixes a crash reported by tim blechmann and also likely #5232 and #5241
git-svn-id: svn://localhost/ardour2/branches/3.0@13754 d708f5d6-7413-0410-9779-e7cbd77b26cf
2013-01-02 23:54:06 +00:00
5a23ede9ec do NOT deselect markers when clearing object selection - markers are outside of the main canvas, do not belong to timeaxisviews and thus are not objects in the sense that this method is intended for
git-svn-id: svn://localhost/ardour2/branches/3.0@13686 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-19 20:20:11 +00:00
174b2fd7b1 fix more range selection issues
git-svn-id: svn://localhost/ardour2/branches/3.0@13662 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-13 21:10:44 +00:00
036e7339ff make sure we never use ID of zero for range selections, fixing a very minor glitch in deleting a specific range selection from several
git-svn-id: svn://localhost/ardour2/branches/3.0@13661 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-13 19:56:43 +00:00
40e9dae606 various fixes for "advanced" operations on range selections. ctrl-drags now add a new range selection, allowing discontiguous selections as in ardour2, shift-click extends an existing range selection to the clicked position, alt-drag on a range selection moves it, and to do a so-called "separation drag" now use ctrl-alt-drag (or ctrl-alt-click)
git-svn-id: svn://localhost/ardour2/branches/3.0@13660 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-12-13 19:39:36 +00:00
Ben Loftis
b43875dd27 explicitly enforce selection rules to avoid some corner cases and avoid user confusion
git-svn-id: svn://localhost/ardour2/branches/3.0@13549 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-11-26 22:37:34 +00:00
6b72e755e3 fix O(N^M) behaviour of control point selection (N = number of control points, M = number of automatable parameters)
git-svn-id: svn://localhost/ardour2/branches/3.0@13525 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-11-18 15:18:34 +00:00
Carl Hetherington
fc77252d51 Slightly unpleasant hack to stop control points being
unselected when you ctrl-drag a selected point in order to
do a push drag.


git-svn-id: svn://localhost/ardour2/branches/3.0@12502 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-31 14:39:48 +00:00
Carl Hetherington
b17c8d5826 Deselect other control points on normal selection.
git-svn-id: svn://localhost/ardour2/branches/3.0@12323 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-05-17 14:03:10 +00:00
ec1ef5d6b5 remove the apparently unnecessary "ui_bind()" macro from entire source base
git-svn-id: svn://localhost/ardour2/branches/3.0@12088 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-25 12:58:19 +00:00
Carl Hetherington
a4434809e1 Use a list of ControlPoints to hold the automation selection,
rather than a time range.  This makes more sense now that we
display every point on an automation line, rather than just
a subset.  Makes the code a fair bit simpler, and should fix
some unexpected behaviours, especially when cutting automation
points.


git-svn-id: svn://localhost/ardour2/branches/3.0@12054 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-04-22 14:03:07 +00:00
442dd75533 clear marker selection as part of Selection::clear(); fixes "error" that prevents click from creating a new midi region because there appears to be a marker selection
git-svn-id: svn://localhost/ardour2/branches/3.0@11449 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-02-05 21:00:59 +00:00
7629120cda many changes, large and small, related to smart mode editing, range/region selection, and behaviour of playhead when always-play-range is enabled. could be buggy, but probably in subtle (or even very subtle) ways rather than obvious
git-svn-id: svn://localhost/ardour2/branches/3.0@11394 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-30 22:53:22 +00:00
Carl Hetherington
5f750624b0 Don't add markers to the selection multiple times when adding a list.
git-svn-id: svn://localhost/ardour2/branches/3.0@11357 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-01-27 01:26:44 +00:00
acddc9bc7a fix minor logic error with linked region & track selections
git-svn-id: svn://localhost/ardour2/branches/3.0@10905 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-12-05 18:33:20 +00:00
e2757229a7 provide link-editor-and-mixer-selection option. gui implementation is slightly hacky because of the implicit endless loop that the link creates
git-svn-id: svn://localhost/ardour2/branches/3.0@10624 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-11-15 19:33:09 +00:00
Carl Hetherington
abedf1fae3 Save marker selection state in instant.xml (#4203).
git-svn-id: svn://localhost/ardour2/branches/3.0@10245 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-10-20 00:05:31 +00:00
ed626628b5 Delete trailing whitespace
git-svn-id: svn://localhost/ardour2/branches/3.0@9656 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-06-01 17:00:29 +00:00
Carl Hetherington
dd5d994367 Prevent the point selection straying -ve when control points are positioned close to 0 (should fix #3861).
git-svn-id: svn://localhost/ardour2/branches/3.0@9412 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-23 00:03:17 +00:00
Carl Hetherington
80abf7693e Remove extend-range-to-{start,end}-of-region and replace with move-range-{start,end}-to-{previous,next}-region boundary after discussions with Chris. Seems to make more sense, and works without the need for a region selection, which is fiddly to adjust when one is in range mode.
git-svn-id: svn://localhost/ardour2/branches/3.0@9360 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-04-17 13:55:41 +00:00
Carl Hetherington
073cf1782c Fix crash on getting state of selected MIDI region automation tracks (fixes #3860).
git-svn-id: svn://localhost/ardour2/branches/3.0@9187 d708f5d6-7413-0410-9779-e7cbd77b26cf
2011-03-22 19:01:34 +00:00