Commit graph

266 commits

Author SHA1 Message Date
Paul Davis
38bb89c110 more functional tempo mapping
TempoMarker drag modifies tempo (and thus beat-time positions
and durations).

BBTRuler drag modifies the map but not positions/durations
2023-03-24 14:19:16 -06:00
Paul Davis
21074b189a remove unnecessary virtual (no default value involved) 2023-03-24 14:19:15 -06:00
Paul Davis
d25a615e20 API development for time domain flipping (GUI edition) 2023-03-24 14:19:15 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
dbd779bf85 NOOP: remove commented debug output 2023-02-23 12:14:39 -07:00
Paul Davis
a7458d308b midi clock: allow user to "quantize" MIDI clock resolution (GUI edition) 2023-02-23 10:17:54 -07:00
Paul Davis
2c7bfa9ead require use of BBT_Argument as both parameter and return type from most methods (GUI edition) 2023-02-15 16:02:56 -07:00
Paul Davis
e2d265c018 tempo edit: use ::replace_tempo() instead of ::set_tempo() after dialog 2022-12-20 21:56:37 -07:00
Robin Gareus
8a7684bd2f
Use 1|1|0 for new BBT markers, always use dialog for new markers
Amend b972301a3b
2022-12-05 19:18:26 +01:00
Robin Gareus
b972301a3b
Add action to noninteractively add BBT marker at playhead 2022-12-02 21:31:56 +01:00
Paul Davis
148dfdd23c editor tempodisplay: use new TempoMap::get_grid() argument to get a finer grid 2022-11-29 10:09:39 -07:00
Paul Davis
97a544390d use TempoMapChange to manage all feasible tempo map editing operations 2022-10-27 13:43:13 -06:00
Robin Gareus
39b85bd2d4 Commit TempoChange undo operation after map update
Tempo Map updates can change a region's position/length, in which case
region-automation may follow the region, and DiskReader:: playlist_ranges_moved
will save additional undo information.

These MementoCommand(s) need to be included in the undo operation.
2022-10-27 08:40:09 -06:00
Paul Davis
a928e35efb significant overhaul of automation region/lines to update during tempo map drags etc 2022-10-25 11:10:36 -06:00
Paul Davis
1ce17c1903 fix time domain for new BBT markers created from context menu/dialog 2022-10-07 16:24:56 -06:00
Paul Davis
0938d21c30 change add new bbt marker from primary-click to context-click on BBT ruler 2022-10-03 14:16:34 -06:00
Paul Davis
fc6ad8ebd9 bbt markers: all the basics of dragging, editing, removing 2022-08-17 16:40:35 -06:00
Paul Davis
3259ab2d41 tempodisplay: correctly redisplay tempo map stuff after adding a BBT marker 2022-08-17 16:39:32 -06:00
Paul Davis
ecf554aa4a tempo display: basics of updating MIDI during tempo-related drag operations 2022-06-28 11:44:25 -06:00
Paul Davis
bf87916fb1 tempo display: further simplifications to handling map changes
When a tempo map change originates from a drag, we know the required redraws have
already been done. Use a new bool member, ignore_map_change, to tell the Editor
to ignore the map change signal. For all other map changes, do the full reset.
2022-06-28 10:16:31 -06:00
Paul Davis
32a3bf229e remove commented code 2022-06-27 22:27:15 -06:00
Paul Davis
6dfaac9e94 redesign the mechanisms for updating tempo/meter display during drags and other map changes
We now simply move markers during drags, and do not seek to create/delete markers.

When the map is changed, we rebuild the markers from scratch. This might need optimization to avoid doing
when the editor itself changed the map.
2022-06-27 22:21:27 -06:00
Robin Gareus
b0738b1950
Fix tempo-marker/curve z-axis stacking
Previously it was possible that the tempo-curve display was rendered
above a tempo-marker (e.g. create a marker in the between of existing
markers). With the tempo-curve in front, markers on the right
became inaccessible.
2022-06-26 16:20:00 +02:00
Robin Gareus
944b0ed6e0
Prefer const iterators when container does not change 2022-06-26 13:55:46 +02:00
Paul Davis
c3f40aedeb tempodisplay: fix thinko in display of tempo/meter/bartime markers
Code used to just push back new markers to the end of the relevant list, and
this would then the new marker to be deleted soon thereafter. Instead pass
an interator indicating where to place the marker in the list.

Note that we rely on the use of std::list<T> here to keep the iterator to the
existing marker valid.
2022-06-25 22:26:34 -06:00
Paul Davis
7724af1850 remove debug output 2022-06-16 22:34:59 -06:00
Paul Davis
2f6047e000 tempo display: remove dangling unconditional call to reassociate markers 2022-06-16 22:14:43 -06:00
Paul Davis
cdf98a1bd7 tempo display: when the tempo map changes, avoid unnecessary work
If the initial tempo marker is referencing a point in the new map, assume that
all markers have already been associated with the map.
2022-06-16 22:09:53 -06:00
Paul Davis
3482d6db4e tempo display: when reassociating markers, use sclock equivalence
Since we're reconnecting visible marker objects with a new map, there's a good
chance that the map will contain map points that don't correspond to the map
points currently referenced by those markers. Thus, tests for address
equivalence will often fail.

Instead, repeat what has been done elsewhere and use the heuristic that we only
allow one point of a given type at the same superclock position.
2022-06-16 22:07:21 -06:00
Paul Davis
8f7a267900 tempo display: when tempo map changes, metric markers must be reassociated with the new map 2022-06-16 12:58:03 -06:00
Paul Davis
de2c553e1a improvements to BBT marker dialog appearance and behavior 2022-06-03 13:20:13 -06:00
Paul Davis
25c151bd8d fix errors in drawing BBT markers
This was hastily added and inadequately checked code before
2022-05-29 14:42:23 -06:00
Paul Davis
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
Paul Davis
2ec6d45d6d temporal: remove the concept of a time domain for the tempo map (GUI edition) 2022-05-24 17:10:25 -06:00
Paul Davis
12bf8279e8 better undo/redo command names for tempo/timesig edits 2022-05-24 17:10:25 -06:00
Paul Davis
26816fc696 remove debugging output 2022-05-10 11:44:51 -06:00
Paul Davis
be2a29b8c3 remove debug output during tempo marker redisplay 2022-05-10 09:46:08 -06:00
Paul Davis
9b51d80210 explanatory comment 2022-05-10 09:46:08 -06:00
Paul Davis
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
Paul Davis
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
Paul Davis
7293904e53 use new TempoCommand when putting tempo map ops into undo/redo history 2022-04-08 11:58:04 -06:00
Paul Davis
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
Robin Gareus
7cb7d83bb8
Cont'd "meter/time-signature" disambiguation 2022-04-05 19:26:01 +02:00
Robin Gareus
92024cac99
Remove debug messages (2/2) 2022-03-16 17:08:15 +01:00
Paul Davis
320a20cbab tempo display: during ressaociate markers, update tempo curves as well 2022-03-10 08:27:24 -07:00
Ben Loftis
daf56ccf0a tempo ruler: do not resize marker (a grabbable object) due to tempo changes 2022-02-14 21:22:36 -06:00
Paul Davis
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
Paul Davis
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
Paul Davis
4db7aa6bdc add Editor API to manage tempo map edits (at least, drags) 2022-01-15 22:53:36 -07:00
Paul Davis
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