Commit Graph

21109 Commits

Author SHA1 Message Date
Robin Gareus 8ca4c4a255
Fix Windows build (post 356374b)
Multiple definition of `ARDOUR::MPControl<bool>::set_value`
2024-01-18 18:48:16 +01:00
Robin Gareus 356374bfb3
Vapor: replace output format API with a controllable 2024-01-18 00:18:52 +01:00
Robin Gareus 1b57838e90
Explicitly catch Glib::ConvertError
Local builds are not affected, since
```
ConvertError is-a Glib::Error is-a Glib::Exception
```

However it seems that rethrowing the ConvertError exception
is not handled correctly with glib/g++ of official builds:

https://discourse.ardour.org/t/crashes-on-cd-export-no-toc-or-cue-files/109771
2024-01-15 16:49:34 +01:00
Robin Gareus 37e7fe9963
Escape cue cd-text like toc
Really do what 02852c1980 says, which only fixed toc files.
2024-01-15 16:25:25 +01:00
Robin Gareus 0fd1edd78e
Update well-known ctrl: separate global and per band EQ enum 2024-01-15 15:34:55 +01:00
Robin Gareus 3fc7db08f0
YTK: do no parse gtkrc and theme files 2024-01-14 20:28:43 +01:00
Robin Gareus a3cd791166
Amend bfb22e2acc, fix generic MIDI signal connection 2024-01-13 18:50:26 +01:00
Robin Gareus bfb22e2acc
Ctrl Surfaces: update bound controllables
Note: this only affects surfaces that use mapped_controls, and do
not already subscribe to processors_changed/RouteProcessorChange signal.
2024-01-13 17:14:17 +01:00
Robin Gareus c3ec93997c
Remove old well-known ctrls API 2024-01-13 04:06:29 +01:00
Robin Gareus 048c574b07
Amend 70a0b47ce (add missing file) 2024-01-13 03:59:37 +01:00
Robin Gareus 70a0b47cef
Update Ctrl Surfaces: use new well-known-ctrl API 2024-01-13 03:08:51 +01:00
Robin Gareus a7e36f77ac
Add enum-based well-known-ctrl API 2024-01-13 03:03:25 +01:00
Robin Gareus 12002e1dc0
FP8: only use visible channelstrip plugins
This is in preparation for multiple Mixbus channelstrip
Plugins.
2024-01-13 03:01:40 +01:00
Robin Gareus 4a9b2cd014
Vapor: set surround bus channel names 2024-01-11 06:47:13 +01:00
Robin Gareus 3c5f9f1450
Add API to set custom IO port channel names 2024-01-11 06:47:06 +01:00
Robin Gareus db7a67980d
Vapor: allow to toggle 5.1 and 7.1.4 main output 2024-01-11 05:16:21 +01:00
Robin Gareus a9719f1b35
Vapor: add support to trim surround object level 2024-01-10 01:31:57 +01:00
Ben Loftis ee6d46d403 Ardour repo should not distinguish between Mixbus variants 2024-01-08 08:25:18 -06:00
Robin Gareus ad51c7c2ba
Localize stripped down gtk2
This is intended mainly for GNU/Linux distros who will remove
GTK2 support in the near future.
2024-01-06 21:52:48 +01:00
Robin Gareus 6172de3144
Vapor: add Lua bindings 2024-01-06 20:24:37 +01:00
Robin Gareus b84cd4fb5a
Vapor: Implement Surround Send/Return 2024-01-06 20:24:23 +01:00
Robin Gareus ec32d22cb3
Vapor: Prototype LV2 export extension 2024-01-06 20:22:39 +01:00
Robin Gareus 3de600625f
Consolidate internal bus checks (1/2) 2024-01-06 20:21:51 +01:00
Robin Gareus 9bb4d0dcf8
Vapor: Add surround types/enum 2024-01-06 20:21:25 +01:00
Robin Gareus c7772c220e
Vapor: Bootstrap Atmosphere plugin 2024-01-06 20:21:13 +01:00
Robin Gareus 0ada2df2e6
Implement [surround] LUFS meter 2024-01-06 20:21:06 +01:00
Robin Gareus 88c796c8f2
Add dedicated Exception for Plugin/Processor errors 2024-01-06 20:21:00 +01:00
Robin Gareus 5476aa336f
Fix "Ignored automation data for non-automatable parameter"
Do not save automation data for parameters that cannot
be automated.
2024-01-06 20:20:45 +01:00
Robin Gareus 66ad0ebb03
Region groups: do not group multiple takes on a single track 2024-01-06 20:20:30 +01:00
Robin Gareus bcfa591ed2
Fix crash (or stuck solo) when removing tracks 2024-01-06 20:20:00 +01:00
Robin Gareus 58641d2a35
Fix crash when session-load fails while creating Routes
When loading the state of a Route fails (here
"unknown enumerator SurroundMaster in PBD::EnumWriter"), the
routes which have already been loaded are not added to the
Session's routelist.

Already existing routes that have an InternalSend or have
a circular reference:

The Send's `_send_from` holds a shared pointer
`<Route>(shared_from_this())` to the Route, and the
Route's ProcessorList contains the InternalSend.

This leads to various
"SessionHandleRef exists across session deletion" of
IO, Ports, GraphNode, Graph, etc
which causes issues when loading another session.

Session::destroy() cleans calls drop_references for
each route in the RouteList, which breaks the circular
dependency (InternalSend drops reference to Route).
But here the RouteList is empty.

Crash fixed:
 * Load a session that fails to load a Route
  (here a session created on with the vapor branch, on master)
 * Then load another session without restarting Ardour.
2024-01-06 04:19:24 +01:00
Robin Gareus e8a902d875
Remove debug message 2024-01-06 04:19:20 +01:00
Robin Gareus 986faf42f5
Initialize some uninitialized variables
This is only relevant when session load fails, by throwing
an error, which is caught and calls destroy() before
Session::setup_lua is called.
2024-01-06 04:19:14 +01:00
Robin Gareus c5db23a15c
Update libAAF (upstream v0.5-2-g4dfb754) 2023-12-26 14:35:14 +01:00
Edgar Aichinger eeadd04b14 update german translation (this time for real) 2023-12-17 11:45:15 +01:00
Robin Gareus c3b55240b1
Fix erasing events in MIDIBuffer
When the last event in a MIDI buffer was erased, the whole buffer
was assumed to be empty (bug introduced in 7.5-96-gc5511040ec)
2023-12-15 08:50:10 +01:00
Robin Gareus 066df7cc1a
LV2: fix crash when replicating stateful plugin on copy
When copying a mono LV2 plugin to a stereo track, the
state of the copied mono plugin is copied to the replicated
instance.

However at this point in time PBD::Stateful::ForceIDRegeneration
is still enabled, and the state ID has not been set.

This used to not be an issue. Older versions of liblilv
handle non-existent paths just fine.

However in lilv v0.24.20-10-gdd5e851 `lilv_path_absolute`
was replaced with `zix_canonical_path` which returns NULL
if a state file does not [yet] exist. This lead to a segfault
due to strlen(NULL) in `serd_node_new_file_uri`:

#0 strlen -- SEGV on unknown address 0x000000000000
#1 serd_node_new_file_uri () at /lib/x86_64-linux-gnu/libserd-0.so.0
#2 lilv_state_new_from_file () at /lib/x86_64-linux-gnu/liblilv-0.so.0
#3 ARDOUR::LV2Plugin::set_state(XMLNode const&, int) at ../libs/ardour/lv2_plugin.cc:2320
2023-12-15 04:30:45 +01:00
John Emmas 9f3438b2bc Fix a call to 'access()' by adding a call to 'uriDecodeString()'
For testing - needs to be checked by Adrien and will most likely be needed for other calls to 'access()'
2023-12-13 16:13:11 +00:00
Robin Gareus 92d6cb9933
Fix alloc-dealloc-mismatch (video image) 2023-12-12 20:36:55 +01:00
Robin Gareus 634aa9900d
UF8 for everyone 2023-12-12 03:38:50 +01:00
Paul Davis f184acfb9d prevent crash in AudioPlaylist::write() due to lossy time domain convert 2023-12-11 16:52:25 -07:00
Robin Gareus 9f5f7edc5b
Add debug message to check if yabridge is detected 2023-12-10 22:13:38 +01:00
Robin Gareus 4402e2a3a8
Add workaround for yabridge threading
* yabridge runs the plugin's process function in a dedicated
  bridged thread. Ardour's process thread is not (it just waits)

* When a plugin calls `restartComponent` from the realtime
  thread. yabridge uses a host notification thread to perform
  the callback.
  Unlike other VST3 implementations that use a notification thread
  (eg. JUCE), yabridge blocks and waits for the notification to
  complete before the realtime thread can continue.

This leads to a deadlock.

However, we know that yabridge always synchronizes the
callback and concurrent calls are prevented by yabridge's design.

https://github.com/robbert-vdh/yabridge/issues/266
2023-12-10 22:08:59 +01:00
Robin Gareus f191d8ba94
Further consolidate locations signal emissions 2023-12-10 04:10:45 +01:00
Robin Gareus 0f3e3b5243
Fix signal emission for Locations::ripple (1/2)
Locations::ripple can never add/remove markers, hence
Locations::changed is not applicable.

That signal is to indicate when more than one location is
added or removed from the location list.
2023-12-10 04:08:30 +01:00
Robin Gareus 1de91fa0fb
Significantly reduce signal emission for Location undo
Undo sets the state of ALL Locations, which resulted in
at least two signals for each Location (name changed,
start+end changed), even if there was no change.
2023-12-08 23:48:37 +01:00
Robin Gareus 153c7e289d
Add explicit API to copy Locations
This is in preparation to reduce signals during
Location Drag motion (which operates on a copied
Location, that causes [static] signal emissions,
but the location itself is not in any list).
2023-12-08 21:47:03 +01:00
Robin Gareus 0c5bbfa62d
Location: add API to use cached sorted location list
Every call to ::next_section() copies the location list
and sorts all the regions.

If the session has a significant amount of Locations and
Section Marker (#9568 has 300+) sorting them each time
when iterating over sections is significant.
2023-12-08 17:22:28 +01:00
Robin Gareus ebc887e33d
Continue export-roll to flush buffers
This is required when using plugins to write data.
2023-12-08 17:22:24 +01:00
Robin Gareus a13a797600
Ignore "stop at end" when exporting
Exporting a dedicated Range should not be constrained by
session markers. This fixes at least 2 issues:

* export could be cut short when using latent plugins
* exporting a range crossing the session end marker was cut short
2023-12-08 17:22:09 +01:00
Robin Gareus 963c104cca
Change default sample-rate to 48kHz
44.1kHz is dead; many soundcards do not support it anymore.
2023-12-08 17:21:57 +01:00
Robin Gareus 004097075a
ControlGroup cannot just create Controls that don't exist
The call as-is can only create route-owned controls, and
even if it would succeed, the created ACs won't necessarily
be controlling anything.
2023-12-06 04:49:16 +01:00
Robin Gareus 0786be859d
Retain TransportMaster Ports across sessions
Unloading a session should only remove session-ports.
This fixes Timecode master sync when switching snapshots
or sessions.
2023-12-03 20:38:31 +01:00
Robin Gareus 4194313e4b
Make Timecode master connection order independent
When a user first connected a port to the Timecode master
input and then disconnected a previous port, the Timecode
master assumed it was not connected.
2023-12-02 23:42:27 +01:00
Robin Gareus dacf488c86
Fix callback order of port-dis/connections
Previously the port-engine was a LIFO. Changes were pushed back
and then popped-back. This causes issues when re-connecting
Transport Masters.

The GUI does the following when changing connections:
1. disconnect all
2. connect to new port

which lead to TransportMaster::connection_handler being called
in reverse order: connect, disconnect, and the transport
master was assumed to not be connected.

--

Now connections queue is a FIFO and code was consolidated.

(Note, we cannot use a std::deque because it does not support
memory pre-allocation with ::reserve)
2023-12-02 23:34:58 +01:00
Robin Gareus 1386b3b73f
Revert s/frame/sample/ for LTC frame 2023-12-02 22:45:33 +01:00
Robin Gareus a8c26dbfa4
Fix localtime_r check (#9554) 2023-11-28 17:05:03 +01:00
Robin Gareus 1306a698a7
Sanitize MIDI track names, remove unprintable chars #9553 2023-11-28 00:29:19 +01:00
Robin Gareus 7593551e49
Import libAAF into Ardour's source-tree
tools/update_libaaf.sh - libaaf v0.1-85-g3e4c2cd
2023-11-27 23:24:54 +01:00
Robin Gareus 47e437c2aa
Bootstrap libAAF support 2023-11-27 23:18:22 +01:00
Robin Gareus 73b44532f1
Allow to override visibility tracker
This is in preparation to keep track of external UI plugin UIs
2023-11-26 20:06:35 +01:00
Nils Philippsen e995daa375 Fix failure to build with libxml2 version 2.12
This declared some xmlError pointers const, which probably was always
assumed, but not made explicit.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2023-11-25 00:30:04 +01:00
Paul Davis f01f4eeded MIDI state tracking doesn't care about size 2023-11-20 21:40:12 -07:00
Paul Davis cb91334cc6 basic work to permit "MIDI catchup" for MIDI state at any point on the timeline
This currently does nothing and cannot be enabled
2023-11-20 21:32:49 -07:00
Robin Gareus 4d7c4bf183
Clearlooks: GtkCList is deprecated and not used by Ardour 2023-11-19 20:28:44 +01:00
Paul Davis da175cc2e8 temporal: remove TempoMap::insert_time() and use shift() instead
The former was incorrectly implemented, and the latter has already been tested more
in real life.

We should likely remove ::remove_time also and use shift() there too, but that
requires testing negative shifts more broadly.
2023-11-19 12:14:10 -07:00
Paul Davis 5723c9bf9c temporal: slightly more debug info when computing quarters from superclock 2023-11-13 22:32:15 -07:00
Paul Davis 04523dee97 temporal: NOOP reindent #ifdef'ed out code 2023-11-13 22:32:15 -07:00
Paul Davis ce4d1ffe51 temporal: after loading an old tempo map, reset it to compute omega etc. 2023-11-13 22:32:15 -07:00
Paul Davis fbc578fdb6 temporal: use "pulses" info from old tempo maps
Note: pulses are whole notes
2023-11-13 22:32:15 -07:00
Paul Davis f8d86c8d19 temporal: add a new ::set_tempo() method for use when loading older tempo maps 2023-11-13 22:32:15 -07:00
Robin Gareus 5b7e008cad
Fix missing sources after cleanup/rec #9536
Ardour accidentally removed nascent source-files during cleanup.
This can lead to missing files when recording directly after a
cleanup.

This also ensures that there are no duplicates in the
dead-sources (file sources unused in the current snapshot) list.
2023-11-13 22:15:42 +01:00
Robin Gareus bbbd023895
Add flag to hide internal plugins from user 2023-11-09 02:01:54 +01:00
Robin Gareus 5b77e348e7
Allow to clear LV2 plugin scan info 2023-11-09 02:01:14 +01:00
Paul Davis 9e4a695689 temporal: fix error in computation of timecnt_t::end() for specific conditions
parens were in the wrong place - we need to add the ::magnitude() of
the tick-based duration AFTER conversion of audio-time position to beats, not
before.
2023-11-06 20:38:08 -07:00
Paul Davis 58652f6268 launchpad pro: use "first fader" concept from lpx
we control the CC number sent by launchpad faders, and 0x20 is too large
because it causes the faders to overlap with some of the CC values
sent by RHS pads. Parametize the first fader and use it everywhere
2023-11-06 12:33:36 -07:00
Paul Davis 144756e602 launchpad: extend Dominik's LP Pro pad patch to LPX/Mini 2023-11-06 10:31:22 -07:00
dominik martinez 93a6849bdd lppro: Don't unbang trigger until pad is released
This was causing issues with cues when clips were set to gate triggering. A pad
long press was causing the clip to release. Additionally, remove an extra timer
that was being set.
2023-11-06 10:31:22 -07:00
Robin Gareus 3e8cde5ad6
Always allow playback w/o session-range 2023-11-06 16:49:46 +01:00
Paul Davis 3fc126b891 launchpads: add namespacing to make 1-source-2-surfaces work for X and Mini 2023-11-04 09:30:26 -06:00
Paul Davis 9b511ce973 launchpad: work on a single implementation for both Mini and X devices
This is not complete, because the symol names are identical, and there's no way (yet)
to ensure which versions Ardour will use if both are dynamically loaded.
2023-11-04 09:30:26 -06:00
Paul Davis c4f8c84a75 region: in definition of ::end() use a slightly faster but entirely equivalent expression 2023-11-03 15:11:38 -06:00
Paul Davis 7d0b223330 region: end().decrement() IS nt_last(), so remove the explicit decrement call 2023-11-03 15:11:38 -06:00
Paul Davis d309ab31e8 playlist partition_internal() uses exclusive end semantics
Do not pass "end-1" to it from Playlist::cut()
2023-11-03 15:11:38 -06:00
Robin Gareus b27c804a7c
Prevent duplicate entries in recent session
This can happen with snapshots or after save-as with
.ardour session files having different "Names" in the same path.

Or simply by saving a session on macOS in /tmp (which is really
/private/tmp).
2023-11-01 23:17:47 +01:00
Paul Davis 53ad83c91c some extra debugging output for MerryIO to try to produce 2023-11-01 00:25:51 -06:00
Robin Gareus a57076d203
Fix MIDI input monitoring without connections
This was seemingly accidentally committed in 07d7e0bf54.
MIDI Monitoring works now with MIDI devices that are not
connected to a Track or Bus.
2023-10-31 22:35:05 +01:00
Paul Davis 43c5f0ab46 launchpad X: 98% functionality 2023-10-31 09:56:40 -06:00
Paul Davis dec9282110 midisurface: use correct virtual method for note off
This likely needs checking for all surfaces that inherit from MidiSurface. It is clearly
the correct thing to have in the code, but existing behavior might be predicated on
the former incorrect connection
2023-10-31 09:56:40 -06:00
Paul Davis f45aec903b launchpad X: better general code design for Novation's use model 2023-10-31 09:56:40 -06:00
Paul Davis e9858773ca launchpad X: change design of fader bank implementation to match the X way (not the Pro way) 2023-10-31 09:56:40 -06:00
Robin Gareus 6dd1ad24ab
IOPlug: implement reset to default values 2023-10-31 07:41:23 +01:00
Robin Gareus eebc902564
Auditioner: fix stuck notes when auditioning different files
The MIDI Buffer is cleared when starting to process,
the panic message never made it to the plugin.
2023-10-31 02:17:05 +01:00
Robin Gareus 870172611f
Update message for relocated preference 2023-10-29 02:40:57 +01:00
Martin Vlk 562a6335de
Czech translation updates. 2023-10-29 02:41:18 +02:00
Paul Davis 638509738d launchpads: edge buttons are supposed to use CC not note messages
Apparently the LP Pro responds to either, but the LP X does not
2023-10-28 17:48:33 -06:00
Robin Gareus 49426a602f
Console1: Clean up previous commit 2023-10-28 23:04:39 +02:00
Holger Dehnhardt 03e3546422
Clean init process to prevent exceptions 2023-10-28 22:59:39 +02:00
Robin Gareus 828d45c6fa
Disambiguate In/Out etc for translations (2/2) #9512 2023-10-28 14:46:04 +02:00
Robin Gareus bec4344546
Console1: leave some TODO notes for later 2023-10-27 21:23:33 +02:00
Robin Gareus a5aff68053
Console1: remove unused dependencies 2023-10-27 21:23:33 +02:00
Robin Gareus 5cad7837fa
Console1: fix compiler warnings
For reasons unknown only the console1.h produces
 -Winconsistent-missing-override
warnings, other similar headers e.g. lppro.h do not.
2023-10-27 21:23:28 +02:00
Robin Gareus 68f55d62d0
Console1: cleanup, fix event loop initialization 2023-10-27 17:12:30 +02:00
Robin Gareus cd5369c7cd
Unload VST3 modules when closing session
This is perhaps a better solution than b8551eed7e
and 8d0a655608 and 7942897d93. It is certainly less
fragile.

It is more consistent with other plugin standards,
where modules are closed with the last instance in a session.

Then again keeping the VST3 factory around is beneficial
when switching snapshots.

Discuss, and let's watch for issues when re-loading a
previously unloaded VST3 module.
2023-10-27 04:46:38 +02:00
Robin Gareus 49124ab987
Console1: properly shut down 2023-10-26 21:53:27 +02:00
Robin Gareus 61ec873481
Console1: another attempt to fix uncaught exeptions 2023-10-26 21:37:28 +02:00
Robin Gareus 85d9e333c9
Revert "Console1: catch some more uncaught exceptions"
This reverts commit 99e2546477.
2023-10-26 21:21:01 +02:00
Robin Gareus 53e24168b6
Partially revert "Clean init process to prevent exceptions"
This reverts commit 94fec7fd8a
except whitespace and intent changes as per discussion on
https://github.com/Ardour/ardour/pull/834
2023-10-26 21:20:06 +02:00
Robin Gareus afc6c060a8
WebSockets: remove unsued variable after f34ce17bf0 2023-10-26 21:06:25 +02:00
Robin Gareus b139bfdb88
VST3: add debug messages to trace ModuleExit 2023-10-25 00:37:03 +02:00
Paul Davis f34ce17bf0 websocket: event loop names and thread/evloop pairs are set in BaseUI::main_thread()
There is no thread when an AbstractUI<T> is constructed. The event loop name and the
association between the event loop object and the thread that "runs" it must be
set from within the thread, which is not created until BaseUI::run() is called.

There appears to have been some confusion in e3569b64 about how this
all works; this commit should remove that
2023-10-24 16:26:50 -06:00
Hoger Dehnhardt 94fec7fd8a
Clean init process to prevent exceptions 2023-10-24 23:11:05 +02:00
Robin Gareus 1dbc3305fa
WebSockets: fix crash when switching snapshots #9506 2023-10-24 23:05:46 +02:00
Paul Davis e0f543d8fb launchpad X: buttton/pad cleanup from the pro code
Edge button lighting is still not functional
2023-10-23 23:20:00 -06:00
Paul Davis 499912b07d get Launchpad X port names in the right order
Unlike the LP Pro, the "DAW" port comes first, not last
2023-10-23 17:45:41 -06:00
Paul Davis ea02c49856 a better solution for the problem being addressed in b40513ff7 2023-10-22 17:31:29 -06:00
Paul Davis b40513ff7d temporal: workaround (perhaps temporary) for rounding issues in ::midi_clock_beat_at_or_after() 2023-10-22 17:15:20 -06:00
Paul Davis 4228fce86b temporal: minor optimization for TempoMap::{tempo,meter}_at() to cover common case 2023-10-22 17:15:20 -06:00
Robin Gareus d5d730ef8c
NO-OP: move implementation out of header file
This is in preparation to test directly flushing insert/send
buffers after Delivery::run like Ardour 7.4 to 8.0 does
see also 44a2ef9098
2023-10-22 00:17:08 +02:00
Robin Gareus a59e64f1d8
Catch XDG_CONFIG_HOME is not an absolute path
see https://discourse.ardour.org/t/glib-converterror-arch-linux/109362
2023-10-22 00:14:24 +02:00
Robin Gareus a7145661bc
NO-OP: cleanup after 44a2ef909 2023-10-21 15:40:12 +02:00
Paul Davis 4ca457bb9e use launchpad x icon 2023-10-19 23:46:58 -06:00
Paul Davis 98ff1307bf ardev and waf tweaks for launchpad X 2023-10-19 22:19:23 -06:00
Paul Davis 3e34229b9f initial launchpad X exploration, using copy-n-edit of launchpad pro code 2023-10-19 22:19:23 -06:00
Robin Gareus 99e2546477
Console1: catch some more uncaught exceptions 2023-10-19 23:46:43 +02:00
Robin Gareus 8f5df7ed28
Fix console1 crashes when no surface is present
e.g. selecting a track causes a ControlNotFoundException
if the ctrl surface is enabled, but no hardware is connected.

terminate called after throwing an instance of 'ArdourSurface::ControlNotFoundExceptio

```
#0  0x00007ffff14d8c2e in __cxa_throw () at /lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fffe2b560a0 in ArdourSurface::Console1::get_button(ArdourSurface::Console1::ControllerID) const (this=0x61d0017e1c80, id=ArdourSurface::Console1::FOCUS1)
    at ../libs/surfaces/console1/console1.cc:928
#2  0x00007fffe2bfc647 in ArdourSurface::Console1::map_select() (this=0x61d0017e1c80) at ../libs/surfaces/console1/c1_operations.cc:653
#3  0x00007fffe2b55384 in ArdourSurface::Console1::map_stripable_state() (this=0x61d0017e1c80) at ../libs/surfaces/console1/console1.cc:832
#4  0x00007fffe2b541ab in ArdourSurface::Console1::set_current_stripable(std::shared_ptr<ARDOUR::Stripable>)
...
```

This does at least fix the crash. Ideally the surface would
only be enabled if there is hardware present.
2023-10-19 21:58:28 +02:00
Robin Gareus 31f42b9be5
VST3: Prevent recursive calls, part II
See also 7227407aa6
2023-10-19 17:49:05 +02:00
Robin Gareus 9138fb9913
VST3: another attempt at sharing has_editor with other instances 2023-10-19 00:25:02 +02:00
Robin Gareus 7227407aa6
VST3: Prevent recursive calls to ::has_editor()
Some plugins call restartComponent(Vst::kParamTitlesChanged)
when their GUI is created, from the call that creates the UI.
This lead to a stack-overflow recursion in Ardour:

ProcessorBox::redisplay_processors -> VST3Plugin::has_editor
-> [plugin] -> VST3::restartComponent -> signal proc changed
-> ProcessorBox::redisplay processors
2023-10-18 22:01:03 +02:00
Robin Gareus bd1cf4e5cf
VST3: cache has-editor (improve on 6b9544cc39) 2023-10-18 22:01:03 +02:00
Robin Gareus c37a7944aa
NO-OP: whitespace 2023-10-18 22:01:03 +02:00
Robin Gareus 6b9544cc39
VST3: cache if plugin has custom GUI
This prevents repeated calls to createView(); view->release();
only to check if a VST3 plugin has a custom UI.
2023-10-18 01:14:20 +02:00
Robin Gareus 44a2ef9098
Fix duplicate Port flush_buffer calls (#9481)
Since 62fc1d3c2e, Delivery buffers were flushed twice.
Once by copy_to_outputs() and again later by
Delivery::flush_buffers. This resulted in duplicate events
during export (see 576840c09e, MIDI buffers are not cleared
after flush to allow export processing to grab the data from
the port-buffers).

The workaround in 62fc1d3c2e is only relevant for ClickIO,
other Deliveries (Send is a Delivery) are explicitly flushed
by Route::flush_processor_buffers_locked.
2023-10-17 05:46:44 +02:00
Robin Gareus 576840c09e
NO-OP: return early, remove scope 2023-10-17 05:40:31 +02:00
Robin Gareus 3ce2cf937e
Revert "wscript: drop unnecessary str() on configure variables"
This reverts commit 615326be9b because it
breaks windows builds.

```
File "/home/ardour/ardour-w64/wscript", line 1462, in configure
  set_compiler_flags (conf, Options.options)
File "/home/ardour/ardour-w64/wscript", line 522, in set_compiler_flags
  if re.search ('x86_64-w64', conf.env['CC']) is not None:
File "/usr/lib/python2.7/re.py", line 146, in search
  return _compile(pattern, flags).search(string)
TypeError: expected string or buffer
```
2023-10-16 21:15:25 +02:00
Robin Gareus 88365ae149
Allow for bounces with dedicated source and region-name
This restores a popular feature to use bounce to export
ranges with track name file-name, while keeping a dedicated
name for the region in the GUI.
2023-10-16 21:12:40 +02:00
Robin Gareus 866c784f33
NO-OP: whitespace 2023-10-16 21:12:37 +02:00
Robin Gareus 15d560c5e4
Consolidate common bounce code of Audio and MIDI Track 2023-10-16 21:12:33 +02:00
Robin Gareus b736c50d83
Fix deadlock in Playlist::fade_range
Region::fade_range emits a signal which will call
ARDOUR::Playlist::region_bounds_changed, which takes a WriteLock.
That resulted in a WriteLock with ReadLock held.
2023-10-15 22:51:08 +02:00
Mads Kiilerich 2973e82a90 wscript: sanitize strings from fetch_*_revision_date early instead of applying str() all over
This can perhaps be simplified further when Python2 support is dropped.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 615326be9b wscript: drop unnecessary str() on configure variables
CC is already set to a string. (And if it ever should be None, we want
to handle that explicitly.)

(And #autowaf.display_msg handle Booleans just fine.)
2023-10-15 10:47:16 -06:00
Mads Kiilerich 0e3e51d958 wscript: drop str() on VERSION
It will already have been converted to str in sanitize(), and even
python2 is fine without the extra str.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 2bb311f99b wscript: don't add pointless -DHAVE_X for each mandatory subdir
The sub_config_and_use function recursed, but it also invoked
autowaf.set_local_lib , which however didn't do anything useful. The
HAVE_ defines are not used anywhere, and the AUTOWAF_LOCAL defines are
only used in autowaf.use_lib, which however isn't used anywhere.

Dropping these defines simplify the build environment and makes the
compiler command line half as long and thus makes debugging much more
manageable.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 8fea606b32 wscript: drop APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 6b61b03434 wscript: drop traces of shutdown() handling
autowaf has no real shutdown functionality anyway. The automatic
shutdown function that could have been called wouldn't work anyway, as
it takes an argument.

The only reason it doesn't fail is that the top level wscript has no
shutdown handling and doesn't recurse to other scripts, so it is all
dead code.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 92aca32652 wscript: stop loading misc where nothing is using it
It is apparently only used in gtk2_ardour/wscript - and it seems to be
enough to load it in configure(), even though it is used in build().
2023-10-15 10:47:16 -06:00
Mads Kiilerich 88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Mads Kiilerich 1c686f4d63 wscript: drop additional configure statements already present in the top level wscript
Missed in 8bb91099c5.
2023-10-15 10:47:16 -06:00
Mads Kiilerich 94875d13ae wscript: drop unused "mandatory variables" 'top' and 'out' in libs
New files missed in d220f477ed.
2023-10-15 10:47:16 -06:00
Robin Gareus fd3f475b3f
Fix mono audio after pending overwrite (#9483)
This bug was introduced in 295dbd8e1e when replacing

```diff
-for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++n) {
+for (auto const& chan : *c) {
```

see also https://discourse.ardour.org/t/first-10-seconds-of-modified-stereo-region-goes-mono-output/109322
2023-10-15 16:33:13 +02:00
Paul Davis f29130fc7c lpp: prefer dom2's approach - no connect unless in & out are present 2023-10-14 11:22:34 -06:00
Paul Davis b8a330c1bf lpp: fix more "eclipse induced" stupidity 2023-10-14 11:20:57 -06:00
Paul Davis 7028450ea0 fix LPPro crash if device is not present 2023-10-14 10:20:05 -06:00
Paul Davis 1d6c2a946d second attempt at fixing the launchpad pro port name mess
It turns out that slightly older versions of ALSA create different "pretty"
port names for USB MIDI devices than slightly newer ones. The new versions
use names that match those seen on other platforms.

This means that to do port matching on Linux now requires a regexp
to match the possible alternatives. This matters much more for the LPP,
which has 3 input ports and 3 output ports, than it does for most devices
that have a single input and single output, and we can "find" the ports
just using simple string searching
2023-10-13 21:16:27 -06:00
Nils Philippsen c90dc9a647
Deal with kissfft >= 130
The kissfft library changed its SONAME and how the various libraries
were organized, e.g. the functions for complex and real numbers aren’t
in separate libraries anymore.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2023-10-13 22:01:32 +02:00
Paul Davis da4d16b1f2 launchpad pro: remember to destroy GUI to avoid use-after-free in its connection handler 2023-10-13 09:47:22 -06:00
Paul Davis e61c1f6993 launchpad pro: use regexes more extensively to find ports to connect to
Hopefully this works for ALSA, Windows and macOS, whereas the previous version worked only
for JACK1
2023-10-12 21:19:21 -06:00
Paul Davis 4f2c86f670 enforce time domains for region trims 2023-10-09 11:19:22 -06:00
Robin Gareus c5b2c4432e
Fix tracing internally connected MIDI ports
MIDI track A -> MIDI track B
The data on Track B's input is not available at cycle-start.
2023-10-07 22:43:27 +02:00
Paul Davis a5712d1f85 remove comment referring to glue-to-time-domain 2023-10-07 13:16:08 -06:00
Paul Davis bebe6587a2 tweak launchpad pro port name for probe to be x-platform 2023-10-07 11:43:07 -06:00
Paul Davis afe74bb460 use Meter::round_to_bar() rather than BBT_Time::round_(up|down)_to_bar
this gives slightly better behavior when dragging a meter marker
2023-10-07 11:11:31 -06:00
Paul Davis 64458c2430 prevent meter changes being dragged "through" a BBT marker
might want to do this for tempo drags too
2023-10-07 11:11:31 -06:00
Paul Davis ec34c2137d avoid a crash when dragging a meter change near a BBT marker 2023-10-07 11:11:31 -06:00
Paul Davis bdd0fda188 remove debug output 2023-10-06 17:08:28 -06:00
Paul Davis 26eed327ad amend 405574184 with correct lock scope and do not hold state 2023-10-06 17:07:44 -06:00
Paul Davis 405574184a use a RegionWriteLock while modifying Playlist region list in ::region_bounds_changed 2023-10-06 16:17:12 -06:00
Robin Gareus d95179f571
NO-OP: remove unused, unimplemented functions 2023-10-05 21:56:42 +02:00
Paul Davis eba00287cd fix SNAFU with ordering of adding stripables and selecting them
when Session emits RouteAdded, each handler (editor, mixer, trigger pages etc) will
execute their callbacks in order. But Editor::add_routes() selects the routes too,
which triggers a PresentationInfo::Change signal. This is received by e.g. the Mixer
before it has even found out about the newly added stripables. This in turn
leads to severe confusion regarding the state of the selection in the mixer,
and potentially elsewhere.

So, just add a PresentationInfo::ChangeSuspender for the scope of the RouteAdde
signal emission
2023-10-05 12:57:16 -06:00
Paul Davis cd1d83f366 reintroduce a fake XML "active" property for Tempo to allow 7.x to load 8.x sessions 2023-10-05 11:22:38 -06:00
John Emmas 14973bd894 Simplify the MSVC / superclock change which should now be compatible with all compilers 2023-10-05 14:01:32 +01:00
Paul Davis 62416ee276 remove unnecessary argument from Playlist::shift() 2023-10-04 18:50:42 -06:00
Robin Gareus c3b881327c
Possible fix for MSVC build 2023-10-05 01:50:37 +02:00
Robin Gareus 49cb4a1f33
Revert "Fix superclock init on Windows"
This reverts commit febc345414.
2023-10-05 01:50:36 +02:00
Robin Gareus febc345414
Fix superclock init on Windows
Static global symbols on windows (even identical symbols) are
not mapped to the same address when mixing .dll + .exe.

see also d3cd621f7a
2023-10-04 23:34:40 +02:00
Robin Gareus 0e3cf0454c
Yet another plugin parameter automation time-domain fix
see also fded5063d9
2023-10-04 21:45:06 +02:00
Robin Gareus 7f2637fa96
Fix find_next_event return value in case no music-time event is found 2023-10-04 21:45:03 +02:00
Paul Davis 0c3791117c remove much debug output associated with tempo map copy/pasta, et al. 2023-10-04 08:37:26 -06:00
Robin Gareus 9ace3c6d56
Remove debug messages (VST2 bypass feature) 2023-10-04 16:26:24 +02:00
Robin Gareus c7745ffd43
Double check our assumptions when merging MIDI 2023-10-04 15:12:31 +02:00
Robin Gareus 923e6a554e
Fix MIDI combine (#9466)
Initially thew new region has a length of zero (0:0). When
merging Notes from a truncated region (no explicit note-off)
those notes are lost:
"Stuck note resolution - end time @ 0:0 is before note on: @ 0:0"

Truncate (or split) a region so that a note is cut short:
```
  Region [{<--Note-------->}]
```
becomes
```
  Region [{<--Note--]
                    ^ implicit note-off at region boundary
```

When combining this region with an empty Region after gap,
```
  Region [{<--Note--]  [    ]
```
the result should be
```
  Region [{<--Note->}       ]
```

For this reason, even without a gap between the regions,
the original note length must not be restored.
The result MUST NOT be the same as the original:
```
  Region [{<--Note-------->}]
```
2023-10-04 15:10:06 +02:00
Robin Gareus 94562a0238
Fix typo in Lua documentation 2023-10-04 14:34:41 +02:00
Robin Gareus 2b0bb54599
Update LuaState API (4/4)
Now that all calls use explicit parameters, we can remove
the default params, and make ::sandbox() private
2023-10-04 02:50:44 +02:00
Robin Gareus 6b3f25eb2a
Update Lua instances (2/4)
This is effectively a NO-OP.
2023-10-04 02:48:26 +02:00
Robin Gareus 7c10a54334
Prepare for explicit Lua Sandboxing (API update) 1/4 2023-10-04 02:46:58 +02:00
Krzysztof Gajdemski 7e7337aa61 Update Polish translation 2023-10-04 01:09:24 +02:00
Paul Davis 364c892c68 remove debug output 2023-10-03 11:13:57 -06:00
Ben Loftis f53ff625d1 commit to BeatTime as the most likely desired session timebase 2023-10-02 14:48:44 -05:00
Alexandre Prokoudine cda1f12845 Update Russian translation 2023-10-02 11:00:05 +02:00
Robin Gareus dfd44c2ebf
Fix 3-point edit undo/redo #9464
Playlist::split can result in removal of a region
(adding two others instead). In this case the state
of the removed region (if modified) is not saved.
2023-10-02 03:13:31 +02:00
Robin Gareus afa295d4af
Unset playlist's TimeDomain Parent when deleting Track
This fixes a heap-use-after-free, when deleting a Track
and then doing a 3-point edit which iterates over all
playlists.
2023-10-02 01:57:07 +02:00
Paul Davis f6d60abda8 remove debug output 2023-10-01 13:26:53 -06:00
Ben Loftis 6c68817b26 add a user config var for preferred time domain (libardour part)
(as opposed to default_time_domain which is the per-session default)
2023-10-01 13:57:28 -05:00
Paul Davis cd99fed7cd canvas: add PolyItem::clear() 2023-09-30 11:09:58 -06:00
Paul Davis ff021b83d3 libardour: add Region::absolute_time_to_source_time() 2023-09-30 11:09:58 -06:00
Paul Davis b89dd73324 NOOP: no need for virtual keyword here 2023-09-30 11:09:58 -06:00
Paul Davis 243f40e10d fix unset-looping-because-monitoring-input (#9458) 2023-09-28 16:52:35 -06:00
Robin Gareus c4f6385d22
Fix playlist partitioning when mixing time domains 2023-09-27 22:15:25 +02:00
Ben Loftis 9651a2c2e2 region groups: more fixes for Duplicate operations 2023-09-27 11:06:40 -05:00
Ben Loftis 72761734e8 region groups: more fixes for drag-copy and range-paste operations 2023-09-27 11:06:40 -05:00
Robin Gareus 40a9ba746e
Freeze plugin cache version
This allows to copy existing VST2/3 cache files to
a new major version
2023-09-27 17:28:20 +02:00
John Emmas ea8742b030 #include <sys/utime.h> when building with MSVC 2023-09-27 09:36:26 +01:00
Robin Gareus 947e6c7815
I/O Plugins: fix a heap-use-after-free
I/O plugin Controls are destroyed with ~IOPlug, however
Session::destroy()'s call to drop_references() still
triggers AutomationControl::session_going_away() on the
binding proxy.

This is even properly documented in session_object.h:

> A named object associated with a Session. Objects derived
> from this class are expected to be destroyed before the
> session calls drop_references().
2023-09-27 02:22:22 +02:00
Robin Gareus e79ca8f9ba
Copy plugin cache with old config 2023-09-27 02:22:22 +02:00
Robin Gareus 6494214622
Add option to prefer file timestamps with recursive copy 2023-09-27 02:22:22 +02:00
Robin Gareus 7f453cab9e
Allow to query cache-dir by major version
Luckily "cachename" parameter was unused, so this API
can be changed.
2023-09-27 02:22:22 +02:00
Robin Gareus 245aac887b
Fix saving patch-change channel undo/redo commands 2023-09-26 05:32:57 +02:00
Paul Davis 0a6ac2678a canvas: if LineSet does the 0.5 pixel shift, make it the right direction 2023-09-25 20:01:21 -06:00
Paul Davis 5fa5c5d202 canvas: NOOP fix comment about docs on single pixel lines 2023-09-25 19:52:10 -06:00
Paul Davis bc78694a1a canvas: fix bounding box of a LineSet (lower edge was not lower enough) 2023-09-25 19:51:33 -06:00
Robin Gareus 496957efdf
Fix layering when copy/pasting regions (1/2)
Playlist::add_region, Playlist::add_region_internal always
adds the region to the top of the playlist, ignoring the
region's layer.

Note that there is also difference between
Region::layer and Region::layering_index.
2023-09-25 22:36:27 +02:00
Robin Gareus 300de26b3e
Fix XML read error when creating new export profiles
Previously creating a new preset first attempted to load
it from disk, before creating it. This resulted in a
`XML error: failed to load external entity`.
2023-09-25 22:36:24 +02:00
JungHee Lee f9da85639d
Update ko.po 2023-09-25 18:56:56 +02:00
Robin Gareus 5082dc62a4
Copy more old config files from v7 to v8 2023-09-25 17:21:10 +02:00
Paul Davis 6db28ef08d remove debug output 2023-09-24 15:01:04 -06:00
Martin Vlk 5ec2c9ed4d
Czech translation updated for the 8.0 release. 2023-09-24 19:57:25 +02:00
Violet Purcell 6e24a409f4
Use <atomic> instead of <stdatomic.h> in libc++ fix
The definitions from <stdatomic.h> conflict with <atomic>, which causes
a build failure since <atomic> is included previously.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
2023-09-23 23:53:05 +02:00
Paul Davis 616273cfab temporal: slightly tweak DEBUG_TRACE output 2023-09-22 22:54:53 -06:00
Paul Davis 14e7f62891 fix BBT_Time::round_up_to_beat_div() (partially)
Math is now correct for cases where "beats" in BBT are quarters.
Incorrect for others
2023-09-22 22:54:37 -06:00
Paul Davis 1c2cd78f41 Revert "temporal: fix superclock time used to find relevant tempo & meter"
This reverts commit b192eea65a.
2023-09-22 15:35:40 -06:00
Paul Davis e2f6241dd6 temporal: NOOP whitespace 2023-09-22 15:35:39 -06:00
Paul Davis 1cdfe2aa2f temporal: actually iterate 2023-09-22 15:30:31 -06:00
Paul Davis b192eea65a temporal: fix superclock time used to find relevant tempo & meter 2023-09-22 15:30:20 -06:00
Paul Davis d6565cce77 temporal: NOOP whitespace 2023-09-22 15:18:27 -06:00
Paul Davis d282c317d0 temporal: use new BBT variant of get_tempo_and_meter() 2023-09-22 15:18:27 -06:00
Paul Davis a89108c9af temporal: removed #if 0'ed old code 2023-09-22 15:18:27 -06:00
Paul Davis 374283cc3f temporal: provide a new variant of ::get_tempo_and_meter() for BBT time
This one is more complex than the Beats or superclock variants, because
we cannot just start from the front of the map. Instead, we have to
first iterate through the map so that we start the code in
_get_tempo_and_meter<...> from the TempoPoint and MeterPoint
in effect at the BBT_Argument's reference time.
2023-09-22 15:18:27 -06:00
Paul Davis 3aacbc453e temporal::remove version of get_tempo_and_meter() that was never used 2023-09-22 15:18:27 -06:00
Paul Davis 8e3e78c116 temporal: optimize common case for ::get_tempo_and_meter() 2023-09-22 15:18:27 -06:00
Paul Davis 8c2bf116f5 fix crash when using OSC in a session with no master bus and no stripables selected 2023-09-22 15:18:27 -06:00
Robin Gareus a37f4e194d
Remove redundant RegionGroupRetainer
Track::use_captured_midi_sources is called from use_captured_sources().
which is only called from DiskWriter::transport_stopped_wallclock(),
which is only called from Session::non_realtime_stop().
2023-09-22 18:29:11 +02:00
Ben Loftis 0a12986639
Preserve existing region-group relationships
This solves several issues related to splitting or pasting regions, when
there is more than one layer.

Rather than assign a new group-id for "all the regions on the right of a
split", only ions that had a *prior* group-relationship should be
propagated into the new group.

Signed-off-by: Robin Gareus <robin@gareus.org>
2023-09-22 18:21:34 +02:00
Violet Purcell 8aa716d437
Backport VST3 libc++ fix on linux
LLVM libc++ does not have the ext/atomicity.h header. This fix is copied
from the upstream vst3_pluginterfaces repo.

Signed-off-by: Violet Purcell <vimproved@inventati.org>
2023-09-22 04:41:11 +02:00
Paul Davis ad7bcd2ebe temporal: add clarification on why the non-ramped ::quarters@superclock is so complex 2023-09-20 13:38:15 -06:00
Mads Kiilerich c5e7e5c4df pbd: clarify int62_t comments 2023-09-20 12:51:52 -06:00
Mads Kiilerich 3478acfcf9 temporal: clarify timepos_t and timecnt_t comments
It tooke me a while to get an understanding of this. It might also be
helpful to others to make the description more explicit.
2023-09-20 12:51:52 -06:00
Mads Kiilerich d2c48debd1 temporal: drop timecnt_t "origin" as alias for "position"
The alias was only used when it was exposed in lua. It was without any
indication that it was a deprecated alias, but let's just bite the
bullet and get rid of it.
2023-09-20 12:51:52 -06:00
Mads Kiilerich cbcb7b1ce2 temporal: refactor to expose superbeat tech debt
A group of functionality was only used once, in
TempoPoint::quarters_at_superclock . Keep things simple and enable
further refactoring and cleanup by inlining everything and dropping
superbeat, big_numerator and super_note_type_per_second from Tempo.

The use of big_numerator right next to superclock_ticks_per_second
seems error prone. It should perhaps just be refactored to work in
superclock domain all the time.

It seems weird that the ramped case is much simpler than the non-ramped.

This (pretty much) removes the last references to "superbeat", which
I thus doesn't have to understand ;-)
2023-09-20 12:51:52 -06:00
Mads Kiilerich e5ec516611 temporal: drop unused superclocks_per_ppqn
superclocks-per-pulses-per-quarter-note is too meta to have any actual
use.
2023-09-20 12:51:52 -06:00
Mads Kiilerich 40bf4ce82d temporal: drop nused note_type_as_beats
The note_type_as_beats was the only temporal thing using hardcoded value
of 1920. It seems like it just should use the usual Ardour PPQN (aka
ticks_per_beat) ... which also has the value 1920.

It is however not used after d77db816de.
2023-09-20 12:51:52 -06:00
Mads Kiilerich 368f0aec44 temporal: minor comment fixes
Some typos and copy editing to remove a (pretty much) duplicated chunk.
2023-09-20 12:51:52 -06:00
Mads Kiilerich 69c5c6e1e8 temporal: drop old tempo-experiment.h 2023-09-20 12:51:52 -06:00
Mads Kiilerich f244972b5a temporal: simplify DEBUG_EARLY_SCTS_USE
There is no need for scts_set now. "Early" use of SCTS will just give the
value 0. DEBUG_EARLY_SCTS_USE can thus just check that
_superclock_ticks_per_second doesn't have the initial value of 0.
2023-09-20 12:30:53 -06:00
Mads Kiilerich f3aedc55d9 temporal: fix superclock DEBUG_EARLY_SCTS_USE
If DEBUG_EARLY_SCTS_USE somehow was set, compilation would fail because
of includes inside a namespace.

(Even without DEBUG_EARLY_SCTS_USE, any early use of superclock will
probably fail clearly with division by zero. There is thus not much need
for DEBUG_EARLY_SCTS_USE now.)
2023-09-20 12:30:53 -06:00
Mads Kiilerich 91314b68a5 temporal: always use Temporal::reset() for superclock and TempoMap default values
Make sure all code paths that use Temporal will initialize and reset it
properly. Some code paths (in tet runners) doesn't use Sessions, so
Temporal::reset() has to be invoked directly.

Just set the static superclock variable to 0 as initial value.
TempoMap will still be initialized early as a singleton, but we
introduce a new constructor so it is created empty (and thus not really
usable until Temporal::reset() or similar has populated it).

We can thus drop the static initialization of superclock. The default
superclock rate of 282240000 will now only live in Temporal::reset().

With this change there should no longer be any uninitialized use of
superclock_ticks_per_second(), and there should not be any problems for
DEBUG_EARLY_SCTS_USE to catch. (It is however broken in other ways -
that will be fixed next.)
2023-09-20 12:30:53 -06:00
Mads Kiilerich 622876c8ab temporal: reset global superclock rate when creating a new session
The superclock rate is variable and is stored in session files since
7.0 . It is set globally when reading from a session file, and it really
should be reset to a known state whenever a new blank session is
created from an existing one. Currently, that doesn't happen. We fix
that by resetting it in Temporal::reset().

For now, we are duplicating the default superclock rate 282240000 from
superclock.h , but we can drop that when all code paths that use
superclock also use Temporal::reset().

This will provide an (extra) guarantee that
set_superclock_ticks_per_second() always is invoked before creating
TempoMap or using superclock_ticks_per_second() in other ways. The
DEBUG_EARLY_SCTS_USE in superclock.h is thus closer to passing.
2023-09-20 12:30:53 -06:00
Mads Kiilerich 80ffa58c81 temporal: introduce Temporal::reset() with TempoMap initialization
Ardour uses some global variables and singletons. These global variables
can be initialized with a value prior to program execution (especially
if they are const), but some of the static variables are modified, and
it is crucial that they always are reset when switching to another
session. To keep things simple and explicit and consistent, we thus
introduce Temporal::reset() to reset TempoMap (and later on also the
superclock rate). This is somewhat similar to Temporal::init(), which
usually only is invoked once (on program start) to initialize singletons
(such as the TempoMap).

9964f20c added TempoMap initialization to Session::create() ... but only
when not using a template. This create method is mainly preparing the
filesystem for a new session, and TempoMap initialization doesn't seem
like a perfect fit for it. It also seemed odd that it only initialized
TempoMap for clean new sessions, while existing sessions and templates
initialized it elsewhere.

Instead, invoke the TempoMap initialization early in the Session
creation process. This might introduce an extra and unnecessary TempoMap
initialization when loading an existing session or using a template, but
that will be cheap and do no harm, while providing a guarantee that we
always use the same default value.
2023-09-20 12:30:53 -06:00
Mads Kiilerich 51333165e8 session: clarify comment about reading sample rate from templates 2023-09-20 12:30:53 -06:00
Paul Davis 2f502b28c7 temporal: fix weird typo in tempo map cut/copy code 2023-09-19 14:16:18 -06:00
Paul Davis 50a4ad4470 on windows and macos, disable translation by default 2023-09-19 14:16:18 -06:00