Skip to main content

Selection/clipboard behavior in phrase editor

Posted

Here is what I visualize. In my dream world, this is how the selection and clipboard would behave in the phrase editor in Synfire.
(Of course, a lot of this is how Sonar behaves.) :-)

If the following paragraphs come across as condescending, I did not intend it that way; it is just me putting on my programmer hat. I tried to be as precise and clear as possible.

Variables representing the state of the phrase editor that I may refer to:

- Now time
- TimeSpanBegin, TimeSpanEnd (can be off/undefined)
- set of selected symbols
- set of selected segments
- LoopPointBegin, LoopPointEnd (can be off/undefined)

Some definitions:

- Resetting the selection: TimeSpanBegin and TimeSpanEnd are both set to off, and all items are removed from the sets of selected symbols and segments

- Selected time span: the time from TimeSpanBegin to TimeSpanEnd

Behavior rules:

1. Any time the selection is changed in the body of the phrase editor (e.g. by clicking on symbols or segments), the TimeSpanBegin and TimeSpanEnd points are adjusted accordingly. TimeSpanBegin = the beginning time of the first symbol in the selection, TimeSpanEnd = the end time of the last symbol in the selection.

(A corollary of rule #1 is: there is never a selected symbol or segment that exists outside the range of TimeSpanBegin..TimeSpanEnd)

2. Any time the selection is directly changed through the time ruler (e.g. by dragging a horizontal span in the time ruler), the set of selected segments is adjusted as well. All (and only) symbols that BEGIN within the span are selected.

3. Clicking anywhere that is not a segment or symbol will set the now time, and reset the selection.

4. Clicking on a symbol will reset the selection, then select that symbol.

5. If a symbol is double-clicked, or clicked a second time before a click is made somewhere else, the symbol's segment is selected.

6. If a symbol is clicked while its segment is currently selected, rule #4 still applies and the selection reverts to the symbol only.

7. Clicking on a line (with a reasonable modicum of tolerance) that is between two segments will select its segment, provided that the click location is distant enough from any area where rules 4-6 would apply.

8. Dragging a box will reset the selection, and select all segments that have symbols that are within or have durations that are within the box, and segments that have one or more lines that are partially contained by the box.

9. Dragging a line horizontally in the time ruler will NOT change the now time. Instead, it will set the TimeSpanBegin and TimeSpanEnd points, and select all symbols that begin in that span only (per rule #2).

10. Holding down SHIFT or CTRL will prevent rules 3, 4, 8, and 9 from resetting the selection. In rule 3, the selection will remain unchanged, and in rules 4, 8, and 9, the new item(s) will be added to the selection.

11. SHIFT and CTRL are synonymous, with one exception. CTRL can be used to toggle (add AND remove symbols from a selection), where SHIFT is can only be used for adding. Rules 5 and 6 still apply while SHIFT is held down, where with CTRL they do not.

12. Instead of a dotted box representing the set of selected items, individual segments or symbols that are currently selected will be highlighted somehow... for example, by outlining them, inflating them slightly, or shading them differently. This will allow for irregular, non-rectangular selection regions as well.

12. The blue bar that appears in the time ruler will always, and only, represent TimeSpanBegin and TimeSpanEnd

13. Loop points (which is what the blue bar currently seems to represent) would be represented separately (such as markers in the time ruler). They would be set explicitly by the user with a "Set Loop Points to Selection" command, or something similar. The loop points, now time, and selected time span may all have different values.

14. Copying and cutting will always apply to the selected items only (not necessarily all items in the time span). The offset within the clipboard will be determined by its distance from the TimeSpanBegin at the time it was copied.

15. Pasting will always be applied at the now time by default; however:

16. On paste, a "what do you mean?" dialog pops up, with the most likely option selected by default. This will allow the user to tweak the paste location if necessary, and specify whether the paste is meant to replace, blend with, or be inserted into the existing data. Advanced options such as "number of repetitions" could potentially be added to this dialog.


Wed, 2009-12-23 - 18:33 Permalink

Thanks!

That's great input. It's certainly desirable to eliminate the need to switch between tools, especially symbols and segments should interact more intuitively. I also like the idea of making the lines between symbols touchable in some way.

Concerning selections, there are basically three distinct types:
- one or more symbols
- one or more segments
- a span

These can not be combined. Either you have a span, or individual objects selected. Regarding the span, it's defined by offset and length. If I understand you correctly, your "now time" refers to the span offset.
Unfortunately it would be impossible to have a span that is independent of the now time. Now time is always its offset.

Admittedly the time ruler does not make use of all its possibilities yet. There's room to make its behavior more persistent and global. Especially wrt loop points and playhead.

[quote]On paste, a "what do you mean?" dialog pops up
Well, an application should, in theory, be 100% free of question dialogs, except they are warnings. I really dislike the "want to make a snapshot" question that is still there. It will be eliminated as soon as possible. If it's not clear from the context what will happen, the design has failed.

Wed, 2009-12-23 - 20:44 Permalink

These can not be combined. Either you have a span, or individual objects selected.

Actually, what I am proposing is that there is only one type of selection... the beginning and the end of the span are just properties of the selection, as are the actual items in the selection. The user manipulating one of these properties may affect the other properties of the selection, but it doesn't affect the type of selection. For instance, adding and removing individual symbols by clicking on them will directly affect these specific items, but indirectly affect the beginning and end time span. On the other hand, dragging a line on the ruler will directly affect the time span, but indirectly affect the items that are contained in the selection; however, in either case, it is still one type of selection. It just has multiple interfaces to control it. Both time span and items can simultaneously be both knobs and gauges connected to the same object. At all times, there are either zero or one selections, and the selection can only be one type.

(And now on second thought, I am questioning the need to distinguish between segments and symbols in a selection... perhaps only the symbols matter? Maybe the fact that all of a segments' symbols are contained within a selection would be enough information to represent the fact that the segment is selected?)

The "now time" I refer to is intended to be independent of the selection span... it refers to where playing will begin when play or record is pressed, or to where pasting will occur by default.

As far as trying to eliminate question dialogs popping up... I tend to agree with you, in 98% of cases.

However, I have found that paste operations are one exception to this. There are so many different things the user can mean when pasting something, and it so often changes from one invocation to the next, that using a question dialog (as opposed to global settings, or even worse, context based heuristics!) is the least of the evils here.

In practice, I have found it to be surprisingly comfortable. Sonar pulls it off really nicely.