Commit Graph

1275 Commits

Author SHA1 Message Date
Robin Gareus 38c613cd9a Towards arranging sections
This allows to move or copy whole sections of the timline (everything
you hear) to a differnt position on the timeline.

NB. Markers and tempo-map are not yet moved, and interpolated MIDI
events are lost.
2023-01-23 04:07:46 +01:00
Robin Gareus 79033d8ee5 Resample when engine and session sample-rates mismatch 2023-01-22 20:51:44 +01:00
Robin Gareus 22007bf882
Only use playlist-name when bounced region-name is unset 2022-11-18 22:49:15 +01:00
Robin Gareus 235d51a723
Revert "MixerScenes: implement 'undo' function for mixer scene recalls (libardour)"
This reverts commit a40c8d8e9a.
This reverts commit 01c7e14c6e.
This reverts commit 162a8c00b3.
2022-11-10 20:54:12 +01:00
Ben Loftis 162a8c00b3 fix merge error 2022-11-10 11:06:33 -06:00
Ben Loftis a40c8d8e9a MixerScenes: implement 'undo' function for mixer scene recalls (libardour)
* this allows the session to better report which scene was last recalled
* this potentially allows controllers (like OSC) to momentarily recall
2022-11-10 09:13:50 -06:00
Robin Gareus f047182e8b
Mixer scenes are a sparse array, do not use arbitrary id 2022-11-09 09:52:37 +01:00
Ben Loftis 44ff0e46ba MixerScenes: show last-selected scene (libardour part) 2022-11-08 17:29:40 -06:00
Ben Loftis 68dc07ecee Mixer Scenes: initialize with a datestamp, rather than no name at all 2022-11-07 10:28:30 -06:00
David Robillard bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Robin Gareus 2cf59a988c Handle tempo-map changes in sync from the calling thread
This is required to collect relevent undo/redo information, notably
automation-data changes from Playlist::update_after_tempo_map_change and
DiskReader::playlist_ranges_moved.

The realtime thread should not move regions to begin with, and debug
builds woudl also assert since no undo operation was started.
2022-10-27 08:40:09 -06:00
Robin Gareus 22829e96b1
Fix MIDI Clock sync
This fixes a deadlock, because tempo-map write copy
was not released. A later call to TempoMap::write_copy
will deadlock and in this case also hold the process lock.

This can happen if there is more than one tempo on the
timeline or if the tempo-difference is too large.
2022-10-18 20:44:16 +02:00
Robin Gareus 08a10b7e84
Replace AutomationControlSet with ControllableSet (1/2) 2022-10-18 00:08:27 +02:00
Robin Gareus aaddf5f385 Add API to restore mixer scenes for given set or Routes only 2022-10-17 06:44:29 +02:00
Robin Gareus f3423b8a77
Consolidate send/delivery gain control
This moves the _amp from send to delivery (which already
applies gain for the master-bus normalization). This generalizes
the use of a gain stage for use in port-inserts.
2022-10-14 02:21:49 +02:00
Robin Gareus 38a40d7c06
Session drop graph-nodes before ~Session
Previously active Routes were retained until the end of
Session d'tor and not dropped during Session::destroy.

While most resources were explicitly cleaned up via DropReferences,
Processor UIs are kept around until the actual destructor runs.
Likewise some controllable are kept around while the GraphNode (Route)
owning it is not released.
2022-10-13 17:49:34 +02:00
Paul Davis 4f7c1aba24 libardour: infrastructure for notifying routes of tempo map change
The call to the Session is made before we call ::process(), from the
AudioEngine. Currently, only MIDI triggers care about this.
2022-09-30 17:21:43 -06:00
Robin Gareus 1abf6a77d6
Even more Lua bindings 2022-09-27 20:00:50 +02:00
Robin Gareus 839400f438
Fix peak-thread race on session-load
Session dirs must exist when loading Sources of a project.
SourceFactory::init() starts the PeakFileBuilder background thread
early on when libardour is initialized.
This thread [re-]creates missing peak files when Sources are
created or loaded. However AudioSource::prepare_for_peakfile_writes
assumes the peak/ folder exists. This may not be true, which lead to
"AudioSource: cannot open _peakpath [..] (No such file or directory)"
errors.

Also drop creation from Source::get_transients_path() as this
may be called concurrently from Analyser background threads.
2022-08-12 01:36:43 +02:00
Robin Gareus 39513ac8ad
Cleanup session (drop references) when session-load fails 2022-08-06 22:38:10 +02:00
Robin Gareus 93e6f5a882
Prepare to allow engine reconfiguration when SR mismatches
Rather than fail to load the session or load with mismatching
sample-rate, this will allow a user to reconfigure the engine
and retry.
2022-08-06 22:32:02 +02:00
Robin Gareus 7ee4f116f2
Fix crash when load session w/o engine
1. Start Ardour, load a session.
2. Stop the engine
3. Session > Recent, pick a recent session
4. Engine dialog opens
5. Close engine dialog without starting the engine
6. Profit^WCrash
2022-08-06 22:09:22 +02:00
Robin Gareus fc54e9c583
Don't crash if the click is missing (amend d5113e6e91) 2022-08-05 20:37:03 +02:00
Todd Naugle d5113e6e91
Don't crash if the click is missing 2022-08-05 00:41:37 +02:00
Robin Gareus 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
Robin Gareus d037dff213
NO-OP: comments and cleanup 2022-06-15 14:16:16 +02:00
Robin Gareus c713841f39
Re-implement RTTaskList using Graph Threads
There is no longer an extra set of rt-threads, but existing
process-graph threads are reused.

There are two main benefits to this approach: graph-threads
have a SessioEvent pool and ProcessThread buffers. They are
also joined to work-groups (on macOS), or  JACK created threads
(cgroups).
2022-06-04 17:22:50 +02:00
Robin Gareus ef4bbae02e
Fix logic in nth_mixer_scene (amend 00bd313e6e)
_mixer_scenes[nth] may not exist, size check condition needs
to happen first. Writer lock is only required when changing the
vector.
2022-06-01 16:26:51 +02:00
Ben Loftis 00bd313e6e Mixer Scenes: fix code thinkos for sparsely-populated vector of scenes
* don't create a new MixerScene if one already exists
* only resize the vector when necessary
* adding a new scene at position N should not shrink the vector size
2022-06-01 08:53:50 -05:00
Robin Gareus ce7d8ed8a1
Fix consolidating to FLAC file(s)
FLAC file needs to be re-opened read-only. FLAC files do not have a
read/write mode.
2022-05-30 20:46:23 +02:00
Paul Davis cc2e6b3cf8 libardour: change API of Session::request_locate() to include "force" argument
No behavior should be changed by this modification; the argument has a default value of false, which
matches previous semantics, and every instance where the argument is specified, it is given as false.
2022-05-27 18:49:11 -06:00
Robin Gareus 927562678b
Do not emit MixerScene signal with locked mutex (fixes ndeadlck) 2022-05-26 16:18:00 +02:00
Robin Gareus baa30262b8
Be more specific about RouteProcessorChange signals
Session::route_processors_changed accumulates signals emitted
in realtime and processing is delegated to a dedicated rt-safe
thread. Previously this resulted in any changed to be converted
to a `GeneralChange`, which unconditionally triggered a route-reorder.

Record-arming a track causes a MeterPointChange (meters change to "in"),
and this caused routes to be resorted and a latency-update.

While the former is reasonable (Ardour prefers to process
rec-armed routes first), the latter certainly is not.
2022-05-24 02:26:56 +02:00
Robin Gareus 48fdfbab53
Implement Session support for Mixer Scenes 2022-05-19 23:31:54 +02:00
luz paz 1e640563d6
Fix source comment typos in `libs/ardour`
Found via `codespell`
2022-05-11 00:14:28 +02:00
Robin Gareus a97e910b70
Debug efficiency of latency and graph order callbacks 2022-05-09 17:39:05 +02:00
Robin Gareus 3f1420880b
Implement IOPlug processing using the Process Graph 2022-05-09 17:39:05 +02:00
Robin Gareus c45a6b80c7
Session support to add/remove save/load IOPlugs 2022-05-09 17:39:05 +02:00
Robin Gareus f5b280a850
Generalize graph processing
This allows to pass any GraphChain to the Graph to process.
It removes the need to use a mutex to swap two dedicated
chains (setup-chain <> active-chain, pending-chain).

Also various special cases pertaining to graph interaction
while auditioning and route-deletion can be removed.

This also unconditionally creates a graph-thread for GraphChains
to be processed, even if the main callback uses a special-cased
sorted RouteList if there is only one process thread.
2022-05-06 17:43:01 +02:00
Robin Gareus 9ad154f265
Untangle Graph from Route
The process-graph should only be concerned with GraphNodes,
which may or may not be Routes.

This also removes intrinsic connection information from
the graph-node. Connection information is to be kept separate
from the nodes.

When the graph is re-calculated in the background, old information
has to be retained until the new graph becomes active.

Previously *new* information was already stored in the nodes
while the graph is sorted, even though the new graph was not
active.
2022-05-06 14:02:34 +02:00
Robin Gareus 078e652859
Implement rt-safe deletion - delegate to butler 2022-05-06 14:02:32 +02:00
Robin Gareus 98bfede1fc
Restore connections when using templates
This also fixes an issue when duplicating tracks. Saved
connections were ignored and tracks were auto-connected.
2022-04-26 15:36:51 +02:00
Paul Davis 91e1083cb1 fix typo 2022-04-09 18:35:16 -06:00
Paul Davis bdc8264fda given 217519b1b4, revert 5bbfac23 and cleanup DEBUG_TRACE output 2022-04-09 18:33:24 -06:00
Paul Davis 7c3268d12f temporal: TempoMap::use() returns a const ptr to enforce semantics (library 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
Paul Davis bc38f8d424 MidiSource: change thread mutual exclusion object from Mutex to a RWLock
This allows two reader threads to proceed without blocking each other, as can
happen when the butler renders a MIDI track into an RT-safe buffer while the
GUI reads the same MidiModel/Source for visual display.
2022-04-05 20:52:09 -06:00
Paul Davis a803dd0df8 superclock_ticks_per_second: use an (inline) accessor, change value
We do not want a value as large as the previous one, which limits the time
range that can be represented in 62 bits unnecessarily. The new value is
9 times smaller than the previous value, and loses only 384000 as a significant
factor.

This commit also switches to using an (inline) accessor for superclock_ticks_per_second,
making it possible in debug/testing phases to spot early/illegal uses of the value.
2022-03-17 14:15:59 -06:00
Robin Gareus 3ae73eb242
Extend Session::Exported signal
Include timespan start position. This will allow to re-import
the file at the export-position.
2022-03-15 22:52:58 +01:00
Paul Davis a336e87df8 when loading a session, catch up on tb_with_filled_slots correctly 2022-03-14 14:10:29 -06:00
Paul Davis 2ea75e88a2 sync cue markers when tempo map changes
This generates the _cue_events list, which is timestamped in samples, from all
current locations that are cue markers
2022-03-14 14:03:07 -06:00