13
0
Commit Graph

284 Commits

Author SHA1 Message Date
62bcaf2191 for now (at least) do not show tempo/meter markers for MusicTimePoints
This policy may change in the future
2022-05-24 17:10:25 -06:00
2ec6d45d6d temporal: remove the concept of a time domain for the tempo map (GUI edition) 2022-05-24 17:10:25 -06:00
12bf8279e8 better undo/redo command names for tempo/timesig edits 2022-05-24 17:10:25 -06:00
26816fc696 remove debugging output 2022-05-10 11:44:51 -06:00
be2a29b8c3 remove debug output during tempo marker redisplay 2022-05-10 09:46:08 -06:00
9b51d80210 explanatory comment 2022-05-10 09:46:08 -06:00
69ee24c22b editor: improved handling of tempo map changes
This splits apart the actual signal handler from the work that needs to be done
to update the GUI in response to a tempo map change. This allows us to do the
visual update when we are manipulating the thread-local write copy of the map
during e.g. a drag operation.
2022-05-02 12:02:04 -06:00
33622474af editor: change return type of begin_tempo_map_edit()
This allows us to get the write-copy of the tempo map in one step.
2022-05-02 12:01:12 -06:00
7293904e53 use new TempoCommand when putting tempo map ops into undo/redo history 2022-04-08 11:58:04 -06:00
883a44e6a4 temporal: TempoMap::use() returns a const ptr to enforce semantics (GUI version)
This commit leaves two issues outstanding:

1. unclear/ugly semantics for drag operations that reset the GUI thread's tempo map to the writable copy
2. undo/redo for the tempo map

These will be addressed in future commits
2022-04-08 11:58:04 -06:00
7cb7d83bb8
Cont'd "meter/time-signature" disambiguation 2022-04-05 19:26:01 +02:00
92024cac99
Remove debug messages (2/2) 2022-03-16 17:08:15 +01:00
320a20cbab tempo display: during ressaociate markers, update tempo curves as well 2022-03-10 08:27:24 -07:00
daf56ccf0a tempo ruler: do not resize marker (a grabbable object) due to tempo changes 2022-02-14 21:22:36 -06:00
684ac0e42e fix buglets after some recent changes to editor tempodisplay
These were caught by msvc but not by gcc .Disappointing
2022-01-26 07:25:00 -07:00
c916d3d952 Substantial overhaul of tempo display code
Major changes: do not delete and recreate markers and curves for every tempo map
change, attach tempo curves directly to their (preceding) tempo marker, notable
cleanup of TempoCurve class to remove unnecessary members.

More tweaks expected since algorithm for matching markers and tempo map
points is not correct yet.
2022-01-18 19:47:20 -07:00
4db7aa6bdc add Editor API to manage tempo map edits (at least, drags) 2022-01-15 22:53:36 -07:00
7ea072a4f4 editor markers: refactor ::reassociate_metric_marks() to be able to process one marker at a time 2022-01-15 20:04:03 -07:00
c24cabead0 GUI changes to follow TempoMap::sample_at() API changes 2021-11-17 15:57:30 -07:00
f0cd3b5c0c editor: when the tempo map changes, update the per-thread pointer
TempoMap::use() merely returns the current per-thread tempo map
pointer; if a change is signalled, we should force an update
of the per-thread ptr via TempoMap::fetch()
2021-11-17 12:16:38 -07:00
3fe0a2f53a fix warning noted by macOS compiler 2021-08-13 14:11:41 -06:00
7938d8de4f fix (some) editing based on tempo & meter marks
After beginning an edit operation with TempoMap::write_copy(), the tempoPoint and meterPoint objects
referenced by markers are incorrect, since they refer to the original map, not the copy we are working
on. Fix this with Editor::reassociate_metric_markers()

Some instances requiring this fix may still remain
2021-08-13 12:51:35 -06:00
2ec93062d9 use simpler logic to avoid negative values when filling grid 2021-08-13 12:51:35 -06:00
162d36ffc8 remove some debug output 2021-08-13 12:51:35 -06:00
5153124664 change (GUI) Marker objects to accept any Canvas::Item as parent, and use this to draw BBT position markers in the BBT ruler 2021-08-13 12:51:34 -06:00
c22c8ed69f get TempoMarkerDrag and BBTRulerDrag to compile 2021-08-13 12:51:33 -06:00
d131a9aa12 remove debug output 2021-08-13 12:51:33 -06:00
80f543dc17 fix missing conversions between samples & superclock for ruler display 2021-08-13 12:51:33 -06:00
b0b346c4ac fix deadlock caused by not unlocking TempoMap when not finishing a meter-marker-drag 2021-08-13 12:51:32 -06:00
e653e61923 fix up redrawing Tempo/Meter rulers when tempo changes 2021-08-13 12:51:32 -06:00
3c857b697f fix incorrect call to Tempo constructor that reordered note type and end tempo
Probably should find a better API for the constructor that makes this impossible
2021-08-13 12:51:32 -06:00
eaedcd79d4 fix a bunch of undo-able tempo map operations to use RCU 2021-08-13 12:51:32 -06:00
2674057ad6 prototype for new general code structure when editing TempoMap 2021-08-13 12:51:32 -06:00
fbdd93a411 Fix Editor::mouse_add_new_meter_event() 2021-08-13 12:51:31 -06:00
9412130c01 use cleaned up Temporal ::quarters*_at* API (GUI edition) 2021-08-13 12:51:31 -06:00
90553b315f fix up memento command use for tempo map undo/redo 2021-08-13 12:51:30 -06:00
3c00fab75e remove/hide Session::tempo_map() and use TempoMap::use() instead (thread local shared ptr) (GUI edition) 2021-08-13 12:51:30 -06:00
9f866a6bbe consolidate some TempoMap modifier methods 2021-08-13 12:51:30 -06:00
dade9994d8 collect together modifying TempoMap methods, and make ::apply_with_metrics() more clearly const 2021-08-13 12:51:30 -06:00
1098b27b35 new tempo map API for almost all of the GUI now 2021-08-13 12:51:30 -06:00
7ef11dc698 continued work on using new tempo map API (before switch to RCU) 2021-08-13 12:51:30 -06:00
749a49c278 incorporating new tempo map API 2021-08-13 12:51:29 -06:00
5b2a435e02 getting editor_drag.cc to compile 2021-08-13 12:51:29 -06:00
9d69fa3820 another day or two's work on timeline type conversion 2021-08-13 12:51:29 -06:00
f4490f54c5 change Timecode::BBT_Time to use Temporal namespace, plus a couple of other minor changes to enable compilation
This still uses the tempo map object in libs/ardour, not the new one in libs/temporal, and isn't likely to be functional
(though it could be)
2021-08-13 12:51:28 -06:00
1fb5c443c7 and the 1/128 2021-02-21 07:14:49 -06:00
b146e45df5 make sure that the 1/64ths grid case is covered 2021-02-20 18:37:56 -07:00
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
808dc8ad64 new_grid: fix some thinkos in ruler math, to better match sensible grid lines.
Tweak enums to better match the Grid values they represent.
2018-07-27 00:26:21 +02:00
a699a637e4 Switch CDFrame grid to use MinSec ruler rather than Sample ruler. 2018-02-26 18:52:28 -06:00
e1b380b302 Rename SMPTE enum back to Timecode. 2018-02-26 18:38:18 -06:00
22819b8d2f Fix a rather large naming thinko: GridTypeSamples should be CDFrames. 2018-02-26 17:02:24 -06:00
dc61256466 new_grid: Rewrite of Snap and Grid. (squashed commit)
Separate Snap from Grid.  Lots of naming changes.
Multiple simultaneous snap options allowed. Grid is one of the possible Snap options.
Grid uses the same data as the rulers.  Replace complicated tempo_lines with simple grid_lines.
The Grid is zoom-scale-sensitive along with the rulers.  If you are zoomed out, grid becomes coarser.
2018-02-09 09:59:39 -06:00
30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
nick_m
1399ef391d Remove redundant beat arg from TempoMap::add_meter
BBT time should be enough to determine the beat.
2017-07-22 02:15:20 +10:00
Thomas Brand
63ea7b6516 NO-OP whitespace (updated GH PR #357) 2017-07-01 19:28:26 +02:00
nick_m
b4ddbce1ff Fix incorrect positioning of tempo line subdivisions if first meter is non-zero
Commit cebefe6 assumed that frame 0 was the music origin.
Silly me.
2017-06-09 11:05:56 +10:00
nick_m
cebefe69d9 Tempo lines display subdivisions correctly over a tempo change
TempoMap::get_grid() supplies a list of beat positions, leaving the lines
to work out any subdivision positions.
This is fine, unless a tempo section falls in between beats.
Use a BeatsFramesConverter along with a quarter note position
(in the BBTPointsList) to make this easier.
2017-06-09 01:44:48 +10:00
830728aaee compute_bbt_ruler_scale should not be necessary for every redraw of the timeline. Works OK here without it... 2017-03-10 08:50:29 -06:00
nick_m
589c13c0eb allow setting end bpm in new tempo from tempo dialog. 2017-03-07 04:00:38 +11:00
nick_m
5c741b7a07 tempo editing updates
- a tempo marker may now be set to always continue (clamped)
	  this means that the end tempo of the previous section will
	  track the start tempo during tempo ops.
	  it mimics the behaviour in 5.8, with the gui indicating
	  the curves to be changed.
2017-03-05 05:21:56 +11:00
nick_m
4496babc8f initial rework of tempo text display (numbers are curve items)
- move tempo numbers to a layer above the curve.

	- the offset of the text box in Marker is horrible here.
	  what to do?
2017-02-27 20:16:10 +01:00
nick_m
5b38fbab4d fix compilation 2017-02-27 20:16:10 +01:00
nick_m
f69f546717 poor man's display of end tempo for ramps. 2017-02-27 20:16:10 +01:00
nick_m
3a7bc1fd3f Tempo Marks : set point colour by discontinuity, display non-quarter pulse if we are non-quarter.
- a jump in tempo by more than 1 ntpm results in a red
	 tempo mark pointer.

	- ignore UIConfiguration::get_allow_non_quarter_pulse()
	  when displaying note type in the marker text (only display
	  note type if we are non-quarter).
2017-02-27 20:16:10 +01:00
nick_m
8e944953c6 highlight the tempo curve that is to be altered, modify text to suit. 2017-02-27 20:16:10 +01:00
nick_m
97c4c2a28c complete changes to tempo type.
- this implements in the intention behind the previous commit.
	  a tempo mark is constant until its end has been changed by a
	  shift-drag on the next marker.
2017-02-27 20:16:10 +01:00
nick_m
ccb51a8ddb rework tempo editing.
most changes are due to a new design where tempo discontinuities at the
beginning of a ramped section may be set.
this allows easier mapping of live performance, especially in
the common case of a ramped ritard before the beginning of a new section.

feature summary:

holding constraint modifier (shift) while dragging the BBT ruler area
drags the tempo lines by changing the start tempo (as before)

holding copy modifier (control) while dragging the BBT ruler area
drags the tempo lines by changing the end tempo (ahem. not quite there)

dragging a tempo mark while holding constraint (shift) will change the
previous end tempo to match the marker position *worth trying*.

holding constraint and copy modifier (control + shift) while dragging
the BBT ruler area attempts to'pinch' or twist the surrounding tempi
sp that later ones are not repositioned (currently suffereng from
rounding errors)
2017-02-27 20:16:10 +01:00
nick_m
7b9784fff4 mark session dirty when dragging tempo markers. 2017-01-27 03:05:32 +11:00
nick_m
2ca06335f7 amend 4cb009058 (if newly active tempo became last it had no curve) 2017-01-07 03:39:24 +11:00
nick_m
4cb0090583 fix some inactive tempi bugs
- no tempo curve for inactive tempi

	- inactive and meter-locked tempi cannot be deleted.
2017-01-07 01:12:09 +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
9c5e1ffb0d sort tempo curves initially as well. 2016-12-12 02:07:00 +11:00
nick_m
782b28a1a8 amend previous commit 2016-12-12 02:07:00 +11:00
nick_m
dbbe65777f fix flickering in tempo curve when markers are reordered. 2016-12-11 23:46:49 +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
ac23496b40 MidiRegion _start/_length beats are frame based only when lock style is Audiotime 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
nick_m
715b178130 Improve bbt ruler drawing performance for large time ranges.
- when the timeline displays many bars, zoom/autoscroll
	  speed is improved by calculating the bbt ruler scale first
	  then requesting a suitably scaled grid.
2016-10-19 03:56:43 +11:00
nick_m
949dd8245d Add a colour for music-locked meters. 2016-08-20 04:33:51 +10:00
nick_m
5c2ccc4f3e Allow negative return in TempoMap::beat_at_frame() and its exact_ variant.
- audio-locked midi regions can be start-trimmed properly
	  when close to 1|1|0
	- a midi region placed before the first meter
	  will continue the tempo curve and first meter.

Only a couple of callers require change, as bbt_at_beat() already
deals with this.
2016-08-14 03:04:53 +10:00
cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
nick_m
99653ae2ca Simplify Editor::mouse_add_new_meter_event() a bit. 2016-07-10 02:18:38 +10: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
180445c18c Indicate meter frame even when adding a music-locked meter from the gui. 2016-07-10 02:18:37 +10:00
nick_m
8b0c5b8426 Register colour aliases for tempo curve. 2016-06-16 02:06:40 +10:00
nick_m
b3b246b724 Pick a colour for music-locked tempo markers. 2016-06-13 04:27:53 +10:00
nick_m
34c9ac9dd7 Tempo ramps - rename bbt_time() -> bbt_at_frame(), frame_time() -> frame_at_bbt() 2016-05-27 23:38:17 +10:00
nick_m
8f3bc6f809 Tempo ramps - rename tempo_at() -> tempo_at_frame().. 3 decimals for the audioclock tempo display. 2016-05-27 23:38:17 +10:00
nick_m
a9921c10eb Gd Lk ramps - rework auto scaling. change colour. 2016-05-27 23:38:17 +10:00
nick_m
1927a707c5 Tempo ramps - fix huge marker height mark, remove unused var. 2016-05-27 23:38:17 +10:00
nick_m
6309807bc7 Tempo ramps - rename for consistency, remove some testing code, add meter based bbt->pulse conversions. 2016-05-27 23:38:17 +10:00
nick_m
8b2f73d5ac Tempo ramps - rework tempo drags, improve comments. 2016-05-27 23:38:17 +10:00
nick_m
f182235410 Tempo ramps - consolidate TempoMap::predict_tempo() 2016-05-27 23:38:17 +10:00
nick_m
d1a075110a Tempo ramps - more code cleanup, fix cross-marker jumping using tempo dialog bbt 2016-05-27 23:38:17 +10:00
nick_m
074db3b861 Tempo ramps - more code consolidation wrt add meter/tempo. 2016-05-27 23:38:16 +10:00
nick_m
82d876b48b Tempo ramps - clean up add/replace tempo 2016-05-27 23:38:16 +10:00
nick_m
cfbc42cd3a Tempo ramps - ensure displayed grid extends beyond the leftmost frame. 2016-05-27 23:38:16 +10:00
nick_m
2d3d7a5355 Tempo ramps - fix ambiguous api, fix flickering tempo curves. 2016-05-27 23:38:16 +10:00
nick_m
058b781258 Tempo ramps - tempo marker's mark indicates curve height ar point. 2016-05-27 23:38:16 +10:00