Commit Graph

253 Commits

Author SHA1 Message Date
Robin Gareus c437d6f886 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-23 23:21:08 +02: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
Paul Davis c24cabead0 GUI changes to follow TempoMap::sample_at() API changes 2021-11-17 15:57:30 -07:00
Paul Davis 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
Paul Davis 3fe0a2f53a fix warning noted by macOS compiler 2021-08-13 14:11:41 -06:00
Paul Davis 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
Paul Davis 2ec93062d9 use simpler logic to avoid negative values when filling grid 2021-08-13 12:51:35 -06:00
Paul Davis 162d36ffc8 remove some debug output 2021-08-13 12:51:35 -06:00
Paul Davis 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
Paul Davis c22c8ed69f get TempoMarkerDrag and BBTRulerDrag to compile 2021-08-13 12:51:33 -06:00
Paul Davis d131a9aa12 remove debug output 2021-08-13 12:51:33 -06:00
Paul Davis 80f543dc17 fix missing conversions between samples & superclock for ruler display 2021-08-13 12:51:33 -06:00
Paul Davis b0b346c4ac fix deadlock caused by not unlocking TempoMap when not finishing a meter-marker-drag 2021-08-13 12:51:32 -06:00
Paul Davis e653e61923 fix up redrawing Tempo/Meter rulers when tempo changes 2021-08-13 12:51:32 -06:00
Paul Davis 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