Commit Graph

1334 Commits

Author SHA1 Message Date
Robin Gareus f1ecd8c124
Vapor: mute master (not monitor), the latter is used for audition, etc 2024-03-13 22:19:17 +01:00
Robin Gareus b36323688a
Allow create Sessions with a specific sample-rate
This is in preparation to create sessions from AAF which may
have a sample-rate other than the running engine.
2024-02-15 01:44:31 +01:00
Robin Gareus 75e8f58952
Fix muting of monitor section when engaging surround 2024-01-18 20:44:01 +01:00
Robin Gareus b84cd4fb5a
Vapor: Implement Surround Send/Return 2024-01-06 20:24:23 +01:00
Robin Gareus 3de600625f
Consolidate internal bus checks (1/2) 2024-01-06 20:21:51 +01:00
Robin Gareus 88c796c8f2
Add dedicated Exception for Plugin/Processor errors 2024-01-06 20:21:00 +01:00
Robin Gareus bcfa591ed2
Fix crash (or stuck solo) when removing tracks 2024-01-06 20:20:00 +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 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 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
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
Robin Gareus 6b3f25eb2a
Update Lua instances (2/4)
This is effectively a NO-OP.
2023-10-04 02:48:26 +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
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
Robin Gareus f5fabb595a
Section operations need to use audio-time
cut/copy section does copy the tempo-map, so copying
a 4 Bar MIDI section will be 4 Bars after the paste.

This does not work the other way around:
With a tempo-map, 4 bars may correspond to 10 seconds
at the source position. While 4 bars at the target
position may correspond to a different audio-time
duration. This can lead to gaps or overlaps.
2023-09-18 17:14:40 +02:00
Robin Gareus 5c888f2b90
Fix deadlock when cut/pasting section to itself 2023-09-05 23:08:29 +02:00
Paul Davis 69cfe9d3f9 add missing ripple during cut/copy/paste of sections 2023-08-31 18:21:56 -06:00
Paul Davis 7aa1863c0f somewhat working tempo map cut/copy/paste 2023-08-30 14:16:21 -06:00
Paul Davis a5055a2227 various changes related to tempo map copy/cut/paste section
Tempo map is currently still excluded from the editor operation
2023-08-30 14:16:21 -06:00
Paul Davis 076cb86912 next iteration of changes to handle time domain bounces as undoable 2023-08-14 23:42:08 -06:00
Paul Davis 1b9f4999df locations now follow session time domain, always (probably) 2023-08-02 15:23:42 -06:00
Paul Davis df188996ec session has a default time domain 2023-08-02 15:22:52 -06:00
Paul Davis 3b565693c8 objects don't have a time domain, they have a time domain provider (libs) 2023-08-02 15:22:52 -06:00
Paul Davis 2bbf06c8cc class name change to clearly disambiguate Evoral::ControlList (a list of time/value pairs) from lists of Controls in libardour 2023-08-02 15:22:45 -06:00
Robin Gareus 25f5b275f4
Auto-connect metronome when using a device the first time 2023-06-26 21:46:24 +02:00
Paul Davis 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
Robin Gareus 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
Robin Gareus 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
Robin Gareus 49aa046824
Cut/Copy Section also needs to operate on unused playlists 2023-06-08 20:42:07 +02:00
Robin Gareus 4529a17617
Implement Section Delete/Insert 2023-06-06 02:42:43 +02:00
Robin Gareus ad5d355fb5
Fix remove_source assert()
With empty MIDI regions it can happen that the GUI
still retains a reference (rec_regions)
2023-06-04 21:26:41 +02:00
Robin Gareus f3ee7fdf88
Fix crash when trying to undo region operations across source deletion
Record, move recorded region(s), delete the recorded source, undo.

Undo would undo the region-move, of a region that no longer
exists and has no source.
2023-05-31 15:46:59 +02:00
Robin Gareus f07361b34e
Session::add_source cannot fail 2023-05-31 01:15:28 +02:00
Robin Gareus d7f631757a
Tweak Source removal
* Do not emit signal with source-lock mutex held
* explicitly drop references when called directly; notably from
  EditorSources::remove_selected_sources
2023-05-31 01:14:53 +02:00
Robin Gareus d5cc5b0586
Auto-connect master/monitor when switching backends 2023-05-27 00:08:48 +02:00
Robin Gareus 63e0ac11ad
Prepare cut/copy/paste tempo-map sections
This currently asserts in Range::subtract, also ripple
is not yet implemented.
2023-05-07 02:04:47 +02:00
Robin Gareus 161d82869a
CPM: Implement automatic ctrl-surface activision 2023-05-04 00:20:15 +02:00
Robin Gareus 2bdf51e02d
Implement cut/paste section markers
This does not include partial ranges (selection only
include either range-start or range-end).

Copy/paste also remains to be done
2023-05-02 23:36:51 +02:00
Robin Gareus 4ccaa81671
Fix cut/copy section: ripple requires a region split 2023-04-28 22:55:54 +02:00
Robin Gareus dd969dfe8c
Fix worst-case and I/O latency report
In case there are any unconnected tracks, the track's output is
assumed to align to the master bus (see Route::update_signal_latency).

For this to work correctly the master bus port's public latency
has to be set first.

This fixes e.g. the following issue: add a latent plugin to
the monitor section. Then toggle its bypass or remove it.
Previously the worst-case latency remained unchanged.
2023-04-27 01:43:20 +02:00
Damien Zammit 4620d138ee import_pt: Look up tracks by name instead of by number
This allows existing tracks with correct names to be the target for import.
2023-04-22 10:09:55 +10:00
Paul Davis 909a2ad639 Revert "modify API of MIDI Clock ticker to use ProcessedRange"
This reverts commit 720102f98a.
2023-04-18 13:48:59 -06:00
Robin Gareus dde366d6ef
Fix Wreturn-std-move 2023-04-09 00:52:29 +02:00
Robin Gareus 295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
Robin Gareus f3e13848fa
Do not modify read-only RCU copy of routelist
RCU reader returns a shared ptr to the current object which
can also be used in other places at the same time.

Sorting the shared-ptr list invalidates iterators which can
throw off other users of the same object.

This fixes a bug in PT-import which calls get_nth_audio_track().
2023-04-07 19:37:30 +02:00
Robin Gareus 8b59bf47df
Add a dedicated PlaylistSet type
This is to consolidate various locations that use
`typedef std::set<std::shared_ptr<Playlist>>`
throughout the codebase.
2023-04-06 02:12:32 +02:00
Paul Davis 720102f98a modify API of MIDI Clock ticker to use ProcessedRange
This solves the faulty MClk output when we locate due to a loop end.
2023-03-24 14:19:16 -06:00
Paul Davis a486fba3e9 std::atomic - 2nd batch of changes to convert from glib to std::atomic 2023-03-24 14:19:15 -06:00
Paul Davis 4ba4cd69ff switch from glib atomic to std::atomic (libs edition) 2023-03-24 14:19:15 -06:00