13
0
Commit Graph

676 Commits

Author SHA1 Message Date
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
nick_m
2c844552a7 Fix incorrect musical position in NoteDrag::total_dx. 2016-10-16 03:41:58 +11:00
nick_m
4faf44588f Interpret start & length_beats properties as double rather than Evoral::Beats.
- Evoral::Beats operator!= would prevent an increment
	  of start_beats by intervals of less than a tick,
	  so its possible that other subtle problems
	  existed due to this kind of thing.
2016-10-10 03:39:57 +11:00
nick_m
4270569528 Fix bug where drawing long notes placed the new note on the previous snap line.
- NoteCreateDrag already applies this shift, so it was
	  always applied twice to the note start frame.
2016-09-23 05:06:03 +10:00
fc0114a7e2 Fix #7015, Crash while aborting Region trim using Esc key
There were two issues:

The first is that TrimDrag::aborted was calling TrimDrag::finished with a null
GdkEvent which caused a segfault when dereferencing. So avoid that by passing
in a dummy event as we are just going to undo the operation in the next step
anyway so it shouldn't matter if it is valid(AFAICT).

The other is that TrimDrag:aborted was calling Editor::undo() which was in turn
calling TrimDrag::aborted leading to infinite recursion and stack overflow.
Calling Session::undo() directly seems to avoid that issue.

This fix feels like a bit of a hack...but it seems to work and is better than a
crash.
2016-09-11 22:53:00 +10:00
nick_m
dbb9e8cc31 NoteCreateDrag uses quarter-notes. 2016-08-31 23:12:11 +10:00
nick_m
ac8617017a Don't attempt to snap to the current musical grid when dragging tempi. 2016-08-24 03:41:42 +10:00
nick_m
0444ce1d5e Revert last commit (269a08a2b1). 2016-08-20 01:58:56 +10:00
nick_m
269a08a2b1 Allow both types of constrained drag (again).
- Holding the constraint modifier at the time of grab gives constrained x.

	- Holding the constraint modifier after the grab but before the first motion
	  constrains to the direction of first movement.
2016-08-20 01:46:04 +10:00
9421e0b4a7 allow constrained-drag of MIDI notes to work 2016-08-15 11:20:23 -04:00
nick_m
4eba9b8638 Resolve potential ambiguity between the constraint modifier and the copy modifier when beginning a drag. 2016-08-14 03:04:54 +10:00
nick_m
1c0651f7f4 Ensure BBTRulerDrag operates within the tempo map. 2016-08-14 03:04:54 +10:00
nick_m
e3a8f2786d Ensure positive length whan drag-adding new midi region. 2016-08-14 03:04:54 +10:00
nick_m
6e49ca61a4 Remove the temporary note group in MidiRegionView, update start trim during drag. 2016-07-22 23:21:27 +10:00
cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
774ad0752a GUI side of : once the user has explicitly set the session range end, playlist/range changes do not move it.
The user may drag the marker, edit in the Location UI, or use nudge, to set the end
2016-07-12 11:19:49 -04:00
140258d8ab remove reference "const int32_t&" -> const int32_t"
this simplifies lua-bindings and also let's the compiler worry about
constant primitive types.
2016-07-10 15:30:41 +02:00
nick_m
0bdbe56cf1 Stop passing references to things that may disappear when a metric section is replaced. 2016-07-10 02:18:37 +10:00
nick_m
39b70ceced Check meter/tempo section exists in copy drag. 2016-07-10 02:18:37 +10:00
nick_m
93c24e4433 Paste uses exact beats. rework _start_beats calculation in copy-with-offset ctor. 2016-07-10 02:18:36 +10:00
nick_m
94e0a15325 Exact beat - provide audio->music mapping for region split.
- for those not in the know, this series provides a way to
	  remove the temporal distortion introduced when using an
	  audio frame-based gui for music-locked objects.

	  In short, the gui uses an audio frame representation to move
	  objects. It displays the object using frame_at_beat(), quantizing
	  the time value to audio frames. This is fine until the user selects
	  that frame but expects it to be interpreted as a beat.
	  Thus beat_at_frame() would not produce the user-expected beat
	  (temporal quantization error of up to 0.5 audio samples).
	  This is one method of mapping audio time to music time accurately.
2016-07-10 02:18:36 +10:00
nick_m
2d5238d875 Make some musical operations on music-locked regions operate in beats.
- use exact beats to determine frame position.
	- see comments in tempo.cc for more.
	- this hasn't been done for split yet, but dragging and
	  trimming are supported.
2016-07-10 02:18:36 +10:00
da7d7f9502 many changes associated with rationalizing selection flow 2016-07-06 13:39:10 -04:00
nick_m
24f64b3ea7 Make exact beat calculation of tempi a bit less cumbersome. Move tempi on an audio basis for non-musical snap. 2016-06-12 02:46:13 +10:00
nick_m
e973e39f06 Set tempo sections to the exact pulse when snapped to a musical grid. 2016-06-12 00:42:43 +10:00
954b17325d another PresentationInfo sort order fix. 2016-06-10 13:57:19 -04:00
nick_m
6c986231d3 More tempo marker cross-dragging fixes. 2016-06-08 13:48:22 +10:00
nick_m
d18bbc646a Fix tempo markers jittering when cross-dragging over large tempo deltas. 2016-06-08 12:45:12 +10:00
2161c5d507 use new RouteGroup property names 2016-06-05 16:33:01 -04:00
eee83c25a9 make all TimeAxisView derived types return PresentationInfo for sorting 2016-06-02 14:46:35 -04:00
6baac7d46f various safety checks for the result of dynamic_cast-ing a TimeAxisView to RouteTimeAxisView
Now that we have VCATimeAxisView, this needed to be done, but it also potentially applied with automation
2016-06-02 08:42:58 -04:00
e3c4f5fa98 make double-click on patch change launch patch change editor 2016-05-31 15:30:44 -04:00
2c9c210213 manually fix rebase/merge issues caused by addition of plugin presets to methods which add a new track/bus 2016-05-31 15:30:42 -04:00
e0ff70cf86 first vaguely working version using PresentationInfo
remote control ID and "order keys" have been removed.
2016-05-31 15:30:42 -04:00
nick_m
a924e938aa Allow non-musical snap when dragging bbt ruler.
- probably not what the user wants,
	  unless snapping beats to timecode frames.
2016-05-28 06:50:22 +10:00
nick_m
0d17c21410 Revert 2d7f755 2016-05-28 05:17:43 +10:00