13
0
Commit Graph

711 Commits

Author SHA1 Message Date
234ea15499 do NOT remove tracks from selection during drag selection on the basis of geometry alone.
Membership of select-enabled route groups matters too.
2017-02-08 17:40:27 +01:00
nick_m
931910b046 hotfix for cross-track dragging bug with music-locked regions. 2017-02-07 05:08:54 +11:00
nick_m
4161a60244 NoteDrag copy modifier detection is no longer explicit. 2017-02-07 01:56:47 +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
04c484089c non-primary music-locked regions follow tempo changes while dragging.
- the contents still don't update but position is much
          more wysiwyg.
2017-02-04 22:57:36 +11:00
nick_m
d38dc86380 rework RegionMotionDrag so that we can actually drag a region to zero.
- did this ever work?
2017-02-04 22:57:36 +11:00
nick_m
b04f89be51 make dragging a region from the list not crash.
- its still a fake event, but we can at least get the snap correct.

	- playlist->add_region() parameters were whacky
	  (for Playlist::add_region_internal()?)
2017-02-04 22:57:36 +11:00
nick_m
970ed12fee fix thinko wrt Drag::adjusted_frame() 2017-02-04 22:57:36 +11:00
nick_m
650c1381d4 setup_snap_delta() need only take a framepos_t. 2017-02-04 22:57:36 +11:00
nick_m
59daffea1d rework snap
snap now fills in a struct (MusicFrame) which contins a snapped frame
along with a music divisor.
this gives useful information wrt magnetic snap which may or may not
have rounded to an exact musical position.

region position may now be set musically (using quarter notes for now).

this patch fixes several problems in the current code:

	- dragging a list of music-locked regions now maintains correct
	  musical offsets within the list.

	- splitting regions using magnetic snap works correctly (#7192)

	- cut drag should now work correctly with magnetic snap.

	- musical length of split midi regions is no longer frame based.
2017-02-04 22:57:36 +11:00
6de15a79cf improve range drag semantics
If a track is selected during the drag (by moving the mouse pointer into a new track), but it was not
selected at the start, and is then de-selected (by moving the mouse back out of it), then remove
it from the selection.
2017-01-25 21:46:24 +01:00
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
7960e1ddbf GUI follow up for new-MIDI-track API change 2017-01-20 21:47:09 +01:00
7551f6941f never remove tracks from selection during a range drag 2017-01-10 15:18:00 +00:00
nick_m
d0580ecfbc allow all types of range location (loop, start, end etc.) to be glued to bars and beats. 2016-12-29 01:39:31 +11:00
628c99d555 Follow Edits => Follow Range
* "Follow Edits" button had several behaviors that confused users.
* "Follow Range" only has 2 behaviors:
** Click anywhere in Range mode (or Smart mode) to locate the playhead.
** When you select a Range, "Play" will play the selected range.
2016-12-19 13:14:44 -06:00
nick_m
d4f7f5ffa2 TempoMap - rename some methods.
gui_move_tempo   -> gui_set_tempo_position
	gui_move_meter   -> gui_set_meter_position
	gui_dilate_tempo -> gui_stretch_tempo
2016-12-19 04:13:17 +11:00
nick_m
27b95300e2 add frame parameter for Meter ctor and TempoMap::replace_meter(). allow for various failures. 2016-12-19 04:02:01 +11:00
nick_m
c518bc3fb7 when dragging or copying multiple regions, respect position lock style.
- music-locked regions are moved by drag beat distance
	  (will conform to tempo changes over the drag distance)
	  audio-locked regions are moved by frame distance.
2016-12-14 02:08:59 +11:00
b34a614df4 Further fixes to non-cxx11 enabled builds
Hopefully all that is necessary this time
2016-12-13 17:10:30 +10:00
0eff7d4a0c Add option to Zoom to Selection on double click
Currently implemented for Region and Range selections.

The new option is false/off by default to maintain existing behaviour. I'm not
sure it should require another option, perhaps Zoom to Selection should be the
default and accessing the region properties dialog can be via Modifier+double
click, but further changes can be made on user feedback etc.

Related: #7112
2016-12-13 13:02:04 +10:00
nick_m
44e8181c36 only set the exact musical position of the primary region for move/copy drag. 2016-12-13 04:33:58 +11:00
nick_m
34e41a3ca6 rename MetricSection movable -> initial, but of course initial is !movable.. 2016-12-12 02:07:00 +11:00
Julien ROGER
c5cda446e0 Fix crash when track creation failed draging region
Add more check when creating a new track from a region drag into editor's empty area.

Fix #6496
2016-12-06 22:23:29 +10: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
62f37da989 filter events in HitCreateDrag, remove some code. 2016-11-22 02:05:32 +11:00
nick_m
cc1d33a91d NoteCreateDrag - remove some code 2016-11-22 01:59:57 +11:00
73f3e479d3 Make Cut mode respect snap modifer 2016-11-21 22:19:56 +10:00
d4190d3761 Show cursor in Cut mode on button press at cutting position
Previously it would be shown at the mouse cursor position even though the
Region is cut/split at the snap/quantize point if no motion occurred.
2016-11-21 20:45:35 +10:00
4ec299779c Reparent cursor used in Cut mode so that it is on top and visible 2016-11-21 20:11:47 +10:00
nick_m
e0c06f39e1 clean up HitCreateDrag. should be a no-op. 2016-11-21 04:57:32 +11:00
nick_m
eef18c47fd fix compilation, rename PercussiveCreateDrag -> HitCreateDrag 2016-11-21 04:20:27 +11:00
nick_m
71c0c872b7 only spray percussive hits during create drag if the grid is in use. 2016-11-21 04:11:54 +11:00
nick_m
5bcb9adbf8 rework mouse hit creation (percussive mode) - mostly as per #7130.
- snap behaviour is round to nearest

	- holding down button 1 while dragging creates many
	  (if not already present) hits.
2016-11-21 04:02:21 +11:00
nick_m
4d0422a0fc NoteCreateDrag scope fix - should be a no-op. 2016-11-21 01:46:42 +11:00
nick_m
d92d9d3a79 use a minimum note length of whatever 1 px is in beats in NoteCreateDrag. 2016-11-21 01:44:56 +11:00
nick_m
cb64e926c2 NoteCreateDrag starts on button press.
- removes the separation between click and
	  drag-creation of notes noth now handled by the drag code).
2016-11-20 04:49:18 +11:00
nick_m
0e0b7667ed NoteCreateDrag::grid_frames works over a tempo change. 2016-11-20 04:42:20 +11:00
nick_m
ca046a8bb2 fix incorrect subdivision when dragging/trimming regions using magnetic snap.
- amends d2d2308588
2016-11-18 01:04:30 +11:00
nick_m
d2d2308588 magnetic snap uses note divisor appropriately.
- also looks nicer when resizing MIDI regions.
2016-11-17 04:08:13 +11:00
dac2d41ee2 Add option to zoom using button press in the time rulers and dragging vertically
This is a common operation used for zooming in other DAWs like Ableton Live and
Cubase. To support such a usage pattern without changing the existing behaviour
of the ruler area I've made it an option that is false by default.

The behaviour of RulerDragZoom is intentionally different than a CursorDrag
that occurs in the rest of the ruler area in that it doesn't follow the snap to
grid setting and no locate related stuff occurs until button release.

There are some issues with responsiveness with more than a few hundred regions
or a large amount of MIDI events/notes.

Implements feature #6768
2016-11-11 14:13:53 +10:00
nick_m
d9dea0a3aa rename Region pos_beats -> quarter_note 2016-11-11 03:37:08 +11:00
nick_m
33e95a1577 rename Tempo _beats_per_minute to _note_types_per_minute, provide pulse helpers.
- adds quarter_notes_per_minute(), note_divisions_per_minute (double)
	  pulses_per_minute() and frames_per_quarter_note()

	- this should be a no-op except for the use of tempo by
	  the vst callback which definitely uses quarter notes per minute.

	- the XML node for TempoSection named 'beats-per-minute'
	  has been renamed.
2016-11-11 03:37:08 +11:00
nick_m
594137f5cc remove public pulse methods from TempoMap.
- the only object whose musical position is not expressed in
	  quarter notes is MetricSection.
	  there is now no need to expose this.
2016-11-11 03:37:08 +11:00
nick_m
1d540605ac clamp setting tempo via vertical drag.
- a bit suboptimal. we really need the opposite of _trackview_only
	  to prevent jumping to track canvas scrolled coordinates in the first place.
2016-11-11 03:37:08 +11:00
nick_m
dca96d8b5d rename Region pulse to pos_beats. use new beat distance api where required.
- add more debugging output detecting regions whose
	  beat and frame position do not align on a playlist.
	  this is required as a check as we have never used
	  frame rounding on constant tempi before 8884a5723dc
2016-11-11 03:37:08 +11:00
nick_m
0e867b544b Refactor tempo api, include quarter-note distance in frames method.
- moves frame rounding up to TempoMap, which is needed
	  in order to calculate pulse distance without frame rounding.

	- the time unit for tempo is still minute, but this now also
	  applies to meter sections. (new audio locked meter sections no
	  longer require a frame position).

	- there is no longer a discontinuity
	  in the pulse for audio-locked meter/tempi.

	- temporarily add debugging output in Region::set_position()
	  to test for region beat not matching region frame.
2016-11-11 03:37:08 +11:00
01747f54d8 Prevent duplicate moves when selecting regions on shared playlists
selecting regions on multiple tracks which share playlists and
dragging them has various odd side-effects. This prevents the worst
of such edge-cases.

A cleaner solution would be to not allow selecting the same region
on multiple tracks at the same time in the first place.

Comments are welcome.
2016-10-27 03:33:51 +02:00
nick_m
24846f478b clean up ghost note wrt create drag.
- hide ghost note when add dragging.

	- new note length snaps as per ghost note start (shifted snap).

	- prevent ghost note from appearing before region start.
2016-10-26 04:52:09 +11:00
nick_m
0b50945484 Fix various snap issues when dragging control points (AutomationRegionView). 2016-10-16 03:47:10 +11:00