Commit Graph

20362 Commits

Author SHA1 Message Date
19c44fe814
Fix restoring metronome connections (duplicate IO set_state)
When a session is loaded, click_io->set_state is called twice.
setup_click() is called when the engine re/starts, and
possibly again from Session::set_state.

During session construction, Port connections are not directly
made. Port::set_state just creates a list, which is later
applied by Port::reconnect from Session::hookup_io.

However, the second call to IO::set_state() calls IO::ensure_ports
again. Since the port already exists, this calls
Port::disconnect_all (while holding the process lock).

Even though the port is not connected at this point in time,
this triggers a ARDOUR::PortManager::connect_callback which
is emitted from the Audioengine when the process-lock is released.

While IO::set_state() continues to set Port::state, and fill
the Port::_[ext_]connections lists, this data is invalidated
moments later when the engine resumes and ::connect_callback
calls ARDOUR::Port::port_connected_or_disconnected.

The solution is to simply not call Port::disconnect_all
if the connection is not yet made (Session::InitialConnecting)
2023-06-22 13:28:18 +02:00
6261bb3a40
Add dedicated RouteProcessorChange for manual pin config 2023-06-22 04:47:35 +02:00
ac801e8455
Improve port-connect error messages 2023-06-22 02:47:30 +02:00
a10e3edb53
Remove unused backend API 2023-06-21 23:59:49 +02:00
341cd455d8
CoreAudio: unconditionally apply device latency 2023-06-21 23:54:55 +02:00
877a2f3611
LuaProc: remove ill-defined bar time variable 2023-06-20 22:26:09 +02:00
fd749173cf
Fix use-after free when deleting locations 2023-06-20 18:19:33 +02:00
cd4fff863a
Dummy backend: add realtime option
On windows this is still limited by the timer resolution, but
it's a start. This is mainly intended to be used with NDI or
other external sources without actual audio hardware.
2023-06-20 01:36:44 +02:00
0dc1c3f008
LuaProc: refine time API
See https://discourse.ardour.org/t/lua-arpeggiator-plugin-anyone/108862/8
2023-06-19 22:07:53 +02:00
8c513ceca7
LuaProc: expose sample-position of last beat 2023-06-19 05:12:47 +02:00
ebcaffd19f
VST3, Lua: fix barPositionMusic
"last bar start position, in quarter notes", starts at zero
to match projectTimeMusic.
2023-06-18 23:00:42 +02:00
34789ff22f
LuaProc: add option to set time information 2023-06-18 22:39:45 +02:00
bb12ac8ec8
Add Lua bindings for pre-roll/count-in recording 2023-06-18 02:41:49 +02:00
00b2f5696c
PortAudio: implement MIDI device config 2023-06-18 02:35:03 +02:00
2d5ac04ae1
pthread_setname_np is available with GNU/mingw 2023-06-17 23:49:47 +02:00
9b797dc4c1
PortAudio: fix latency reporting, disable custom MIDI cfg
This correctly sets audio port I/O latency using the
portaudio API.

Per MIDI device port settings are not completely implemented.
En/disabling MIDI devices or setting custom MIDI port latency
is not functional as-is.
2023-06-17 05:49:11 +02:00
639696c1a8
ALSA: fix adding n_period playback latency
Use playback port, not capture port.
2023-06-17 00:53:22 +02:00
7b1da19581
Sort events when merging MIDI regions (#9313)
Sequence<Time>::append() expects events to be sorted.

Previously this only worked for non-overlapping region,
or if all events in the later region(s) are after than the
last even in any earlier region.
2023-06-16 21:31:07 +02:00
7dc9bf157b fix measure line drawing (convert to window coords for intersection check) 2023-06-16 09:16:53 -06:00
248e37ac0c canvas LineSet: fix rendering to get coordinates precisely correct 2023-06-15 20:10:32 -06:00
a2975bb4b7
Fix opaque MIDI region rendering
This issue was introduced in e79d8b00f9.
2023-06-14 19:42:00 +02:00
7aad0bbe15
CoreMIDI: use dedicated packet buffer on stack 2023-06-13 16:50:53 +02:00
bb97ade440 temporal: special case editing of the initial tempo (#9339) 2023-06-12 16:46:13 -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
12c3daa46b JACK: fix reported tempo & meter when functioning as JACK timebase master
TempoMap::metric_at() has a superclock_t variant that was being called
with a samplepos_t value. Full check (and removal, hopefully) coming up.
2023-06-12 12:10:26 -06:00
3a60de5d54
Add track playlist-state function for undo/redo 2023-06-10 15:03:46 +02:00
a3e64445de
Amend bb54bc0d (prevent bad_weak_ptr) 2023-06-10 04:00:46 +02:00
884b4f3046
Playlist cut/copy always produces hidden playlists 2023-06-10 03:33:51 +02:00
f95c9216b1
Fix playlist use-count 2/2
* Use an atomic reference count since the freeze-thread
  can call use_playlist.
* Remove explicit argument to construct unused playlist
  because playlists are unused by default. This also
  lead to use-count becoming negative (or rather UINT32_MAX)
2023-06-10 03:33:51 +02:00
8489810cfb
NO-OP: whitespace 2023-06-10 03:33:51 +02:00
bb54bc0d40
Yet another attempt at fixing #9361 2023-06-10 03:33:51 +02:00
3fbc89e4ee
Remove unused overloaded method 2023-06-10 03:33:51 +02:00
4abdb09c00
Remove unused API 2023-06-10 03:33:50 +02:00
5965fd15e5
Fix tiny memory leak 2023-06-10 03:33:39 +02:00
55afdc2aa4
amend 7c7bf6c88b, do not notify UI during cleanup
This fixes a rare crash where the signal causes a
cxa_pure_virtual in PBD::Signal1 during destruction.
2023-06-09 16:17:40 +02:00
ad49de022a
Too many drop-references handlers (#9363)
This fixes a random crash with stop-and-forget capture.

When aborting capture, the disk-writer can emit
 midi_write_source->drop_references ()
in the butler thread, which leads to a direct call to
Session::remove_source.

This can happen before or after Region::source_deleted
is called which is initiated from the same signal.

Furthermore it was possible that Region::source deleted
was called concurrently from the UI thread via SourceRemoved
for whole file regions, which lead to memory corruption.
2023-06-09 16:17:37 +02:00
03e0eea744
Playlist paste, always pastes on top 2023-06-09 00:48:42 +02:00
c61fc45689
Retain region layering for cut/copy/paste 2023-06-09 00:03:49 +02:00
7c7bf6c88b
Fix TransportMasterManager crash at exit
TransportMasterManager::destroy () destroys any remaining
TransportMasters which in turn unregister their ports.
However the PortEngine was already destroyed.
2023-06-08 22:50:15 +02:00
733d59c65b temporal: unit testing more like unit testing
But still not really.
2023-06-08 14:01:17 -06:00
01b8187cd3 temporal: add rudimentary paste test 2023-06-08 14:01:17 -06:00
1cf4f9293c temporal: paste needs to add to _points 2023-06-08 14:01:17 -06:00
24f6c51de6 temporal: more nuances for ::cut_copy() 2023-06-08 14:01:17 -06:00
a09a37049b temporal: get guard point values before altering the tempo map 2023-06-08 14:01:17 -06:00
6039cea3dc temporal: improve cut buffer slightly by using different meters 2023-06-08 14:01:17 -06:00
d0f5fdb224
Fix deadlock and remove debug message
get_extent() takes a RegionReadLock, but ::partition_internal
already holds a RegionWriteLock (use ::_get_extent)
2023-06-08 21:32:53 +02:00
49aa046824
Cut/Copy Section also needs to operate on unused playlists 2023-06-08 20:42:07 +02:00
61b41fd5d0
A user initiated locate cancels play-range (#9360) 2023-06-08 18:38:25 +02:00
6aa2ad26b5
Clear transport sub-state at RangeStop, disable play-range 2023-06-08 18:06:28 +02:00
cd2d0448a9
Fix Play Range (#9360)
When starting RangePlay while the transport is already rolling
the transport is now stopped (and de-clicked) before locating.

This should not clear the RangeStop event when it is caused
by a RangePlay request.
2023-06-08 16:51:24 +02:00