Commit Graph

19365 Commits

Author SHA1 Message Date
86e6df15cc
Fix region-gain when region is glued to bar/beats
The region-gain envelop is an Automation list that uses AudioTime
regardless of the regions own position.

Since the actual audio data is using always using samples this
results in reliable envelopes without the reduced granularity of
BeatTime.

All points the list have to be in the AudioTime domain.

Previously it was possible to have a mixed-domain list e.g.

- add 2h:30min long source
- lock it to music-time
- set grid and snap to 1/8 note
- range select some range shortly after 2:25
- draw region-gain for range

<events>
a0 1
a492113664000 1.0000001192092896
a492113737500 0
a494032822500 0
a494032896000 1.0000003048365
b34560000 1.0000003048365
</events>
2022-07-04 00:58:07 +02:00
d932d9365f fix crash in a debug build caused by trying to print debug info about a negative time value that will never be used 2022-07-03 16:53:30 -06:00
0295e05d04
Force latency update callback after measuring port-insert latency 2022-07-03 02:16:11 +02:00
c6566f3933 mackie protocol: add more null checks; remove some debug msgs 2022-06-30 16:47:17 -05:00
198df78cfe mackie debugging: ugly printouts 2022-06-30 14:04:51 -05:00
66bd195030 mackie protocol: potential crash-fix 2022-06-30 11:30:07 -05:00
13de664ae6
Provide jack2 compatible implementation for jack1
jack1 (which is Linux only) does not have a jack_client_stop_thread
API, and expects the application to call pthread_join().

This fixes an issue when the application is compiled using jack2 headers
but the application later runs using jack1's library.
2022-06-30 17:19:57 +02:00
1f6abbb756
Comment-out unused timepos_t modulo operator which is not implemented 2022-06-30 01:47:42 +02:00
f67e731a7f
Prevent session-range changes to create invalid loop ranges
When a session-range coincides with a loop-range location, moving
the session-range also updates the loop-range.

Keeping session and loop-range in sync can be useful if the whole
session is looped. However markers are treated individually, so
we need prevent invalid ranges.

If session-start and loop-start coincide, but loop-end is before the
end-marker, it is possible to move session-start beyond the loop-end.
2022-06-30 01:07:32 +02:00
3bcf75a35a
Remove Range::squish debug information, used fixed modulo operation 2022-06-30 01:07:32 +02:00
2c1f36201c
Fix timecnt_t modulo operation when mixing time-domains 2022-06-30 01:07:32 +02:00
ca49bc00f0
Remove old "user" API, use consistent get/set_double() 2022-06-29 01:39:02 +02:00
3623b39168
Replace ::user_double() with ::get_double() 1/2 2022-06-29 01:39:02 +02:00
a4a241c738
Prepare replacing ::user_double() with ::get_double()
Automation Controls (and controls in general) are now
only updated in realtime context. Either via automation-playback,
or via SessioEvent. This directly sets the Control:_user_value
(before emitting the Changed signal).

The GUI does not need to evaluate the control at a given point
in time, so the API call can be removed and unified.

This commit first removes all calls to "get_double" to ensure
that no special cases exist.
2022-06-29 01:39:02 +02:00
5cb6e1046b
Fix automated controllable display value
::automation_run() evaluates the value, possibly ahead of time
depending on latency-compensation. The actual value is set in
realtime-context via set_value_unchecked() -> actually_set_value()
which emits the Changed signal.

At this point in time Control::user_value is already set correctly.
There is no need to evaluate and interpolate again, at a potentially
incorrect (uncompensated) time: `_session.transport_sample()`.

This fixes an issue with the GUI Automation control showing an
outdated value when there is an "immediate jump" in the signal:
eg. add a latent plugin post-fader, then automate the Fader to jump
from 0dB to -inf dB (snap to grid) and play though that transition.

(Plugin controls were not affected by this bug, the process
cycle is split for those, but Mixbus internal AC were affected).
2022-06-29 01:39:02 +02:00
7a01f3cbcd
Fix automated fader display value (use cycle-end value) 2022-06-29 01:39:01 +02:00
b0b7750bc7
NO-OP, use default argument 2022-06-29 01:38:55 +02:00
ee350362d3
Debug loop range squishing
When the loop-range is defined in BeatTime, the disk-reader encounters
rounding issues due to time-domain mismatches.

With a simple session fixed BPM at 120,  48kHz.
looping 1 bar exactly 2 sec at the start of the session:
```
 Range::squish start: b0 end: b7680 squish: a113554560
 Range::squish using modulo:       b45 = a661500
 Range::squish using modulo in TD: a5760
 Range::squish using earlier():    a658560
```
The correct answer is a113554560 - 2 * 56448000 [SC/sec] = a658560

Calculating the modulo iteratively is not great, however usually
only one iteration is required.
2022-06-28 03:01:41 +02:00
873f78de78 NOOP: rearrange code DiskReader::get_midi_playback() to follow the "early exit for conditional" style guide 2022-06-25 13:36:55 -06:00
64f9829b56
AudioBackends: ignore setting latency of invalid port(s) 2022-06-24 19:55:17 +02:00
fe0e997335
Backend: prefer debug_msg over PBD::Transmitter in threads
PBD::Transmitter is neither thread-safe nor rt-safe. This likely
fixes a crash on macOS when process-threads are started.
Many threads simultaneously enter coreaudio_process_thread() and
log a message calling `PBD::info << .. << endmsg` simultaneously.
2022-06-24 19:27:57 +02:00
9ab32d7cb4
Fix builds on platforms without execinfo (amend cd4549aff7) 2022-06-23 01:59:58 +02:00
5831ddd40b amend b30ac5e221 to actually replace the assert with a return 2022-06-22 16:09:38 -06:00
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
0004ca2c41 add useful DEBUG_RESULT and DEBUG_RESULT_CAST to pbd/debug.h 2022-06-22 13:31:08 -06:00
d917d7b351 fix actual x_assert macro definition 2022-06-22 13:31:08 -06:00
df641765ec add new header for x_assert() macro 2022-06-22 13:31:08 -06:00
4599b07217 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
046cdf1295 fix unused variable warning by removing it. 2022-06-22 13:31:08 -06:00
41948821e2 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ebb9d3d4dc fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
26d2c8a7fa handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
bb5798ee66 fix may-be-used-unset warning and bizarre brace/indent style 2022-06-22 13:31:08 -06:00
6fd4c01fc9 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
4878c48386 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
7a32ff33d4 handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
f7b91d577b handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
9922daf284 handle compiler stupidity with early return 2022-06-22 13:31:08 -06:00
24f1a65d5f use C style cast in C code, rather than C++ constructor 2022-06-22 13:31:08 -06:00
48a109e8c8 fix snprintf buffer size warning 2022-06-22 13:31:08 -06:00
660d2fc8ab fix strncpy() size argument error (Windows only, needs review) 2022-06-22 13:31:08 -06:00
9b80d6558a fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ad8e1c1cfd fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
45403dd2f1 fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
b30ac5e221 replace unnecessary assert(0) with return; 2022-06-22 13:31:08 -06:00
4ee854e7df fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
123cc92fff fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
7436a110dc fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
ecefe29d5e fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
6fdd745dc5 fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
311e36b28f fix optimized unused variable warnings 2022-06-22 13:31:08 -06:00
168b540959 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
0e1f62e605 fix optimized build unused variable warnings and abort not assert 2022-06-22 13:31:08 -06:00
f1a24fac98 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
f78d384281 fix may-be-used-unset warning 2022-06-22 13:31:07 -06:00
1e09e0f6fa fix may-be-used-unset warnin 2022-06-22 13:31:07 -06:00
ed645761d0 fix optimized unused variable warning 2022-06-22 13:31:07 -06:00
ae9c11fb01 fix redefined CANVAS_DEBUG warning 2022-06-21 17:35:01 -06:00
670b1fe3e2 fix initialization order warning 2022-06-21 17:34:48 -06:00
ac18b84351 remove always-true-condition from if() to avoid compiler warning 2022-06-21 17:34:09 -06:00
b51c4b7ef9 fix signed/unsigned warning 2022-06-21 17:33:37 -06:00
181f40a349 fix signed/unsigned warning 2022-06-21 17:33:22 -06:00
83b5fdf569 fix unused code warning 2022-06-21 17:33:04 -06:00
cd4549aff7 fix signed/unsigned warning 2022-06-21 17:31:50 -06:00
dc4235efbe fix left-shift of negative value warning 2022-06-21 17:31:17 -06:00
e2ef135161 remove unused warning 2022-06-21 17:30:59 -06:00
f679da4e1e simplify implementation of Beats::operator%= (Beats) 2022-06-21 14:46:20 -06:00
5d81535588 remember to use muldiv() when doing a*b/c; also no need to call to_ticks(), just use _ticks 2022-06-21 14:46:20 -06:00
1be136adbd allow construction of Beats with a beat count that exceeds INT32_MAX 2022-06-21 14:46:20 -06:00
d6d9792dcb fix construction of Beats from an int64_t that exceeds INT32_MAX 2022-06-21 14:46:20 -06:00
71ee12af6a
Add API to format keyboard modifiers for tooltips 2022-06-21 22:11:49 +02:00
5b03bf72fa
NO-OP: code style 2022-06-21 22:11:08 +02:00
af38528174
Physical modifier abstraction is constant 2022-06-21 22:09:54 +02:00
8a5fc65df4
Expose newly added semantic modifiers 2022-06-21 21:38:37 +02:00
3266b1acb0
Add API to query currently held modifiers keys 2022-06-21 21:37:14 +02:00
f1eb45e129
NO-OP: clang format 2022-06-21 21:37:08 +02:00
696e05c3e5 convert internal implementation of Temporal::Beats to just use a 64 bit tick value
This expands significantly the maximum number of Beats that can be represented, which is a good
thing in itself. It slightly speeds up some Beats::operator methods, and slightly slows down
::get_beats() and ::get_ticks().

One minor change in an API user was required, and several tweaks to the unit tests due to the
macros being used by cppunit creating possible type confusion.

Units test pass
2022-06-21 12:26:54 -06:00
4661957091
Re-establish 47932fb7bf (which was lost in e557245bf7) 2022-06-21 20:17:01 +02:00
e557245bf7 implement group_override_modifier() (lib part)
Consistently use Tertiary for Group Override on all platforms (and be consistent about it)

Consistently use Primary-mod for Momentary on all platforms (partially reverts 47932f)
Primary modifier is used for fine-adjust on knobs and sliders, with no analogous operation on switches.
2022-06-21 13:01:30 -05:00
4dbdaf7fe9 fix possible negative return from TempoPoint::quarters_at_superclock() 2022-06-21 11:39:10 -06:00
47932fb7bf
Only special case middle-click modifier for macOS by default 2022-06-20 23:30:45 +02:00
bbb0b78a50 fetch thread local tempo map in potential peak-building threads 2022-06-20 14:25:40 -06:00
4825d67c4a
Fix record w/count-in
The pre-nutemo code used fmod() to calculate the offset into the bar:
`bar_fract = fmod (barbeat, 1.0); // fraction of bar elapsed`
with nutempo, beats start at 1, and the tick offset must also be
taken into account.

The bug was introduced in f67029bd0
2022-06-20 21:15:00 +02:00
65b7b3f2eb fix unset per-thread tempo map in AutomationWatch thread 2022-06-20 08:43:00 -06:00
0f2c3bf9c9
Fix mp3 export on big-endian systems 2022-06-20 16:05:28 +02:00
35612d26c6
Unify ::get_buffer, remove debug code 2022-06-18 22:54:09 +02:00
32161cf154
Fix valid_port race/crash when ranaming ports
PortIndex is sorted by name, and uses port-name as unique identifier.

Ports can be re-named concurrently with processing.
::set_port_name() updates the RCU in the background. The engine
may concurrently process with an old RCU reader value.

In this case valid_port() failed in the process-callback.
and ::get_buffer() returned NULL
2022-06-18 22:54:08 +02:00
fd9a76073b modifiers: add momentary_push_name (for tooltips) 2022-06-17 11:07:58 -05:00
12e703414d modifiers: make a new abstraction for momentary-click, instead of button_2 (lib part)
is_button2_event()  was used to detect the user's desire for a
  momentary-click on some buttons (mute, solo, mixer scenes)

is_momentary_push_event() disambiguates this action from is_button2_event()

for the special case of momentary, we can drop the workarounds for
  the lack of middle-mouse buttons on Mac, and instead just use
  shift+left-click on all platforms.
2022-06-17 11:07:49 -05:00
71833911a4 modifiers: publish button2_name (for use in tooltips) 2022-06-17 10:52:06 -05:00
f60b35483d temporal: fix major conceptual error managing Point reference to owner map
When TempoMap::copy_points() is called, the new points are intended to belong
to the (nascent) new map. But the copy constructor for the points leaves the
_map member of a Point unchanged, and so the new points reference the old
map (forever!). ::copy_points() must reset each Point to reference the new map.

Refactored the object that has the _map member, so that we could limit access
to its ::set_map() method to TempoMap.
2022-06-16 22:11:56 -06:00
d66bda9f07 mackie send subview: potential fix for send-enable banking (vpot push) 2022-06-16 13:27:30 -05:00
7e039d4f3f
Cleanup: retain sources used by triggers in this session
Note that ::find_all_sources_across_snapshots() finds and retains
all sources in the SourceList of other snapshots regardless
if they are used in those snapshots.
2022-06-16 20:03:58 +02:00
9964f20c63 when creating a session without a template, reset tempo map to default 2022-06-16 10:36:18 -06:00
32096afc90 temporal: remve debug output 2022-06-16 10:36:02 -06:00
2cfc013b0c temporal: fix loading tempo map from XML
We need to clear out all 4 intrusive lists before we start, not just the 3 typed ones
2022-06-16 10:18:37 -06:00
477b136e97 temporal: if requested via -Dtemporalmap, dump tempo map after any update 2022-06-16 10:18:37 -06:00
41bce61552
Cleanup bindings key replacement arrays 2022-06-15 15:32:39 +02:00
047296060f
Fix printing keybindings #8924 (brace/bracket mismatch) 2022-06-15 15:28:57 +02:00
d037dff213
NO-OP: comments and cleanup 2022-06-15 14:16:16 +02:00