13
0
Commit Graph

284 Commits

Author SHA1 Message Date
509efdb290 temporal: refactor ::get_grid() for performance reasons
the API now provides the option to call ::get_grid() with an iterator which may
be re-used on subsequent calls. This avoids unbounded O(N) "walks" from the
marker preceding the start point of the grid to the start point.

This commit also includes "fast-path" code for the common case of a single
tempo and single meter
2023-07-14 13:03:36 -06:00
d688af76c0 clean up mapping bar context menu, extend with clear tempos 2023-06-30 15:50:47 -06:00
bfa13ad714 temporal: reference time for BBT_Argument is always superclocks (GUI) 2023-06-30 12:10:50 -06:00
ac491fce0e bbt markers: now have an (insensitive) tempo and meter marker visible
probably needs more work for event handling on the tempo and
meter markers.
2023-06-28 18:03:38 -06:00
50232a23a7 temporal: hide superclock_t variant of TempoMap::metric_at()
This fixes several callsites that were passing samplepos_t to get a TempoMetric,
some of them somewhat significant (e.g. VST plugins that want tempo information).

Bad API design on my part, apologies.

This commit combines libs/ and gtk2_ardour because the new private status
of the ::metric_at() call would be a blocking point for git bisect
2023-06-12 12:36:16 -06:00
dbebc0b7e0
Make Markers properly themable, use color-names
This simplifies code, and also immediately changes marker
colors when the theme is changed.
2023-05-18 01:26:35 +02:00
240a85097c when editing tempo, round position to beat in GUI 2023-05-05 20:52:48 -06:00
49e1f7f79d fix logic of editing tempo & meter
Old code use the TempoMetric (Tempo + Meter) in effect at the old
location of the tempo/meter to compute the position of the edited tempo/meter,
using a BBT time from the dialog.

But this TempoMetric uses the very tempo/meter that we're editing!

So we have to use previous_tempo() or previous_meter() to construct
the relevant TempoMetric, and if it is the first tempo or meter, then
obviously it cannot move position at all.
2023-05-03 21:55:23 -06:00
5c0886379b fix position of edited tempo marker in the presence of BBT markers 2023-04-28 15:57:42 -06:00
a0dc539d70
Set thread-local tempo-map to write-copy
Use the new map that is being edited for lookups while changing
the map in the in the GUI. This can changes directly visible
as the map is being edited.

This used to be done directly with the fetch_writable() API
2023-04-10 10:03:21 +02:00
518fc7754f tempo mapping: half-way towards working drags again
For some reason, mid-drag changes are not visible
2023-04-09 14:36:03 -06:00
13311b7a32 tempo mapping: tempo group and mapping group are now only ever visible one at a time
Currently, the "switch" is in Edit > Tempo
2023-04-08 11:44:21 -06:00
8fbf2c3f52 add enum and member var for controlling what kind of tempo editing we are doing
note: this was much harder than it ought to be
2023-04-08 11:44:21 -06:00
295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
10b845b1ca fix mapping begin/commit/abort logic in editor 2023-03-24 14:19:16 -06:00
ab3fe29afd no need for a temporary ptr-to-tempo map 2023-03-24 14:19:16 -06:00
f96a0d0ddf editor: adding handling of mid-mapping tempo redisplay 2023-03-24 14:19:16 -06:00
aa3cbd8791 editor: expand handling of tempo-redisplay in middle of drag 2023-03-24 14:19:16 -06:00
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
21074b189a remove unnecessary virtual (no default value involved) 2023-03-24 14:19:15 -06:00
d25a615e20 API development for time domain flipping (GUI edition) 2023-03-24 14:19:15 -06:00
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
dbd779bf85 NOOP: remove commented debug output 2023-02-23 12:14:39 -07:00
a7458d308b midi clock: allow user to "quantize" MIDI clock resolution (GUI edition) 2023-02-23 10:17:54 -07:00
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
e2d265c018 tempo edit: use ::replace_tempo() instead of ::set_tempo() after dialog 2022-12-20 21:56:37 -07:00
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
b972301a3b
Add action to noninteractively add BBT marker at playhead 2022-12-02 21:31:56 +01:00
148dfdd23c editor tempodisplay: use new TempoMap::get_grid() argument to get a finer grid 2022-11-29 10:09:39 -07:00
97a544390d use TempoMapChange to manage all feasible tempo map editing operations 2022-10-27 13:43:13 -06:00
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
a928e35efb significant overhaul of automation region/lines to update during tempo map drags etc 2022-10-25 11:10:36 -06:00
1ce17c1903 fix time domain for new BBT markers created from context menu/dialog 2022-10-07 16:24:56 -06:00
0938d21c30 change add new bbt marker from primary-click to context-click on BBT ruler 2022-10-03 14:16:34 -06:00
fc6ad8ebd9 bbt markers: all the basics of dragging, editing, removing 2022-08-17 16:40:35 -06:00
3259ab2d41 tempodisplay: correctly redisplay tempo map stuff after adding a BBT marker 2022-08-17 16:39:32 -06:00
ecf554aa4a tempo display: basics of updating MIDI during tempo-related drag operations 2022-06-28 11:44:25 -06:00
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
32a3bf229e remove commented code 2022-06-27 22:27:15 -06:00
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
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
944b0ed6e0
Prefer const iterators when container does not change 2022-06-26 13:55:46 +02:00
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
7724af1850 remove debug output 2022-06-16 22:34:59 -06:00
2f6047e000 tempo display: remove dangling unconditional call to reassociate markers 2022-06-16 22:14:43 -06:00
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
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
8f7a267900 tempo display: when tempo map changes, metric markers must be reassociated with the new map 2022-06-16 12:58:03 -06:00
de2c553e1a improvements to BBT marker dialog appearance and behavior 2022-06-03 13:20:13 -06:00
25c151bd8d fix errors in drawing BBT markers
This was hastily added and inadequately checked code before
2022-05-29 14:42:23 -06:00