Commit Graph

1275 Commits

Author SHA1 Message Date
Paul Davis 22b50c1716 ensure that Session handles tempo map changes synchronously in the main RT process thread 2022-03-14 14:03:07 -06:00
Paul Davis 00d8b08300 triggerbox: track empty slot status and ignore stop-at-session-end when appropriate 2022-03-14 14:03:07 -06:00
Robin Gareus 020051772e
Extend Session::Exported signal
Indicate if exported file should-be re-imported.
2022-03-11 04:55:24 +01:00
Robin Gareus 2328df23e5
Collect and postpone send delayline updates
In order to detect if route delaylines need to be updated,
aux-send delaylines need to be updated first. This was previously
done directly in the latency-callback, which may be concurrent
with processing.

Now only the information (pending_delay) is set, and the actual
change happens later at the end of process().
2022-02-07 04:31:42 +01:00
Robin Gareus 31b7e18d7d
Fix edge-case race initialize_latencies() vs process()
Due to _init_countdown when the engine starts, it is
extremely unlikely that Session::initialize_latencies(),
which is invoked by AudioEngine::Running runs concurrently
with Session::process, but at least in theory it would be possible.
2022-02-06 00:45:49 +01:00
Robin Gareus 77bfba1281
Revert "Fix playback of initial notes during MIDI audition"
This reverts commit 617697a823.
2022-02-05 19:16:44 +01:00
Robin Gareus 617697a823
Fix playback of initial notes during MIDI audition 2022-02-04 19:32:34 +01:00
Robin Gareus 6900facef2
Fix potential deadlock
block_processing() may hold the process-lock, waiting
for the latency-lock. at the same time audio-engine
may hold the latter, trying to acquire the former.
2022-02-02 14:16:50 +01:00
Paul Davis 1ab49bcc32 change MidiStateTracker to MidiNoteTracker
The old name will become a bigger class/object that tracks all MIDI state,
not just notes
2022-02-01 18:06:40 -07:00
Robin Gareus f103b984ab
Fix bounce + callback concurrency
Prevent Session::write_one_track to commence while latency
callback is already in progress. See also
* 19067f8c87
* 2eaa0183ef
2022-02-02 00:27:35 +01:00
Ben Loftis 63e134097c Session::trigger_by_id finds a trigger from its pbd::id 2022-01-27 13:15:27 -06:00
Robin Gareus 729ff35faf
Mark session as modified when stripable order chanes
Previously this was handled by the Editor/Mixer Treeviews,
centralizing it in Session makes more sense.
2022-01-27 01:28:49 +01:00
Robin Gareus bdb91a434a
Simplify call to find_route_name()
Use std::string directly. There's no need to create a temporary
std::string from a char* when the API can use it directly.
2022-01-24 21:25:20 +01:00
Robin Gareus 670e1f9025
NO-OP: clarify variable name (1/2) 2022-01-15 00:06:26 +01:00
Robin Gareus 76facc0b13
Unconditionally create Triggerbox for each Track
This addresses and issue when loading old sessions or creating
tracks from [old] templates.
2022-01-14 22:46:50 +01:00
Paul Davis a187b5e1fb triggerbox: reimplement timeline cues without session events 2022-01-06 00:23:27 -07:00
Paul Davis 93b30976e5 cue events: some basic handling framework for syncing cue markers with session events that implement them
This doesn't actually do anything yet
2022-01-05 13:27:47 -07:00
Robin Gareus b72268f6e1
triggerbox: rename sidechain port when track's name chanes
Just like PluginInsert::update_sidechain_name, the name is
implicitly set, using the owning route's name, suffixed with the
[i18n localized] Processor name.

This fixes an issue if a track is renamed and a new track with
the old name is created. This commonly happens during File Import:
For each ImportAsTrack a generic named track (e.g. "Audio") is created
before it is renamed.

Previously this lead to
Failed to register port "Audio 1-trig/midi_in 1", reason is unknown from here
2022-01-04 01:22:34 +01:00
Paul Davis ff89d998b2 triggerbox: steps toward sane trigger stopping API and design 2021-12-22 17:27:26 -07:00
Paul Davis f3fe31da27 session: fix for creation of new/default tempo map 2021-12-21 17:38:42 -07:00
Paul Davis 722a159ac1 Session constructor should create a new tempo map
This may be the wrong place to do this. It might be more appropriate in ::set_state(0
so that we either use existing XML state or a default tempo map
2021-12-21 17:38:42 -07:00
Robin Gareus 3b5dbf2252
Mark new Tracks with TB to present them 2021-12-01 23:10:07 +01:00
Robin Gareus ee8e8da614
Stop auto-connect thread before terminating ctrl surfaces
This works around a race-condition, calling d'tors from
two threads concurrently.

The GUI thread destroys ctrl surfaces. ~~MIDIControllable()
calls ::drop_external_control() -> ::midi_forget()
This unsubscribes from signals (notably MIDI::Parser events)
by calling ScopedConnection::disconnect(), Connection::disconnect().

At the same time auto_connect_thread can call
PortManager::clear_pending_port_deletions() which removes
the MIDI port and destorys the MIDI::Parser.

~Parser() calls Connection::signal_going_away() to invalidate
connected signals.

This can deadlock if it is called concurrently with
Connection::disconnect() on the same signal.

see also
https://discourse.ardour.org/t/ardour-session-close-hangs/106523/10
2021-11-20 23:14:42 +01:00
Paul Davis 91a28b78c4 modify and extend both Session and TriggerBox API to allow better transport control
This allows a stop transport request to first stop all active triggers and then stop the transport
2021-11-10 15:55:58 -07:00
Paul Davis 241948635b new session event type for triggering scene changes 2021-11-03 22:58:17 -06:00
Paul Davis 62c80e1430 Add the definition of Session::AfterConnect 2021-11-03 15:18:59 -06:00
Paul Davis 62f9edfc07 Remove TransportMasterManager::reconnect_ports().
PortManager::reconnect_ports() covers all ports, and this method was only
used directly after a call to PortManager::reconnect_ports().
2021-11-03 15:15:54 -06:00
Paul Davis 016206e18a Remove all IO code that handled deferred connections
When loading a session, we now just set up port state, which will
populate the Port::_connections member, and then once all ports have
been created, use PortManager::reconnect_ports() to get everything connected.
2021-11-03 15:06:16 -06:00
Paul Davis f3481df9d4 Add new static Session signal will be emitted after port reconnection on session load. 2021-11-03 15:03:40 -06:00
Paul Davis bedf09fbdb triggerbox: add new property called "order" and use it to decide whether to respond to a given MIDI note/pad (Push 2-centric for now) 2021-10-13 09:07:15 -06:00
Paul Davis cf392f73fc triggerbox: improve MIDI sidechain port naming 2021-10-10 17:35:15 -06:00
Paul Davis 6326222a48 triggerbox: change APIs so that we can add a triggerbox to either type of track 2021-10-08 13:45:27 -06:00
Robin Gareus 6199d08f71
Add API to report I/O Latency 2021-09-08 22:39:32 +02:00
Robin Gareus f301e692a7
Expose compensated port-latency, fix ambig. latency detection
Previously Ardour only announced processor latency.
Routes that had additional latency to compensate for those
have not published this delay.

This is of no concern with internal backends, however with JACK,
Ardour reported incorrect *individual* port-latencies of
routes that perform PDC.

Since public port latency now includes delay-compensation,
some extra work is required to unset it before recalculating
latency of paths that include external ports.
2021-09-08 22:39:32 +02:00
Robin Gareus eb0f353716
Session-cleanup: clear route references from graph
resort_routes() is a no-op during session destruction,
however _current_route_graph can still hold references
to routes. A GraphVertex is-a boost::shared_ptr<Route>.
2021-08-27 06:42:56 +02:00
Paul Davis a5ffed49cc triggerbox: regions get set after construction; provide ::set_from_path() 2021-08-13 12:51:37 -06:00
Paul Davis b41e240f10 potentially add a TriggerBox if with_triggers is true 2021-08-13 12:51:36 -06:00
Paul Davis e9401a945f add new argument @param with_triggers to Session::new_midi_track()
Lua binding for Session::new_midi_track() temporarily commented out due to some templating/types issue
2021-08-13 12:51:36 -06:00
Paul Davis b55bb41832 fix timeline type -> sample in ::write_one_track()
This needs to be modified to use Beats not samples.
2021-08-13 12:51:36 -06:00
Paul Davis 8d67be784a remove #ifdef'ed out initialization from session.cc (possible rebase leftover, but redundant no matter the origin 2021-08-13 12:51:35 -06:00
Paul Davis bcca1ad289 minor fixups post-rebase 2021-08-13 12:51:35 -06:00
Paul Davis 1f8290f154 generalize repeated code into a template method, add lots of const-ness to facilitate this 2021-08-13 12:51:35 -06:00
Paul Davis 38b1f5eee1 fixup mistakes from a manual conflict resolution during rebase on master 2021-08-13 12:51:34 -06:00
Paul Davis 6608700e82 no more need to update locations after a tempo map change 2021-08-13 12:51:33 -06:00
Paul Davis 9d4d3908e6 remove some nutempo #warnings and fix up Location time domain API 2021-08-13 12:51:33 -06:00
Paul Davis 495cc1e4bc plugins use their route's automation time domain 2021-08-13 12:51:33 -06:00
Paul Davis 1ab27fd98f libardour: session listens to tempo map change again 2021-08-13 12:51:32 -06:00
Paul Davis e38e828152 use explicit timepos_t() for region start property in property lists (libardour edition) 2021-08-13 12:51:31 -06:00
Paul Davis 82e84e6b92 change all Region::nt_*() methods to names without the nt_ prefix (library version) 2021-08-13 12:51:30 -06:00
Paul Davis 79763893b3 remove/hide Session::tempo_map() and use TempoMap::use() instead (thread local shared ptr) 2021-08-13 12:51:30 -06:00
Paul Davis f67029bd02 random commit to facilitate trivial move of work from laptop back to main system 2021-08-13 12:51:29 -06:00
Paul Davis 5f4afa6a0e Session: changes to support timeline types more easily/correctly 2021-08-13 12:51:29 -06:00
Paul Davis eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Ben Loftis 3114ef4de2
Default_Play_Speed: prep work (libardour)
* remove unused variables in session.h
* move default play speed (varispeed(sic)) into fsm
* request_transport_speed should -never- set the default_play_speed
2021-07-03 19:06:02 +02:00
Robin Gareus 83b9ab1bee
Temporarily revert ongoing varispeed development
This reverts bf88f3fe64
until 35813db0f4

in order to move development into a branch, until after the
upcoming 6.8 release
2021-06-26 18:58:24 +02:00
Ben Loftis 006055a2ff Default_Play_Speed: prep work (libardour)
* remove unused variables in session.h
* move default play speed (varispeed(sic)) into fsm
* request_transport_speed should -never- set the default_play_speed
2021-06-25 11:51:34 -05:00
Paul Davis f643e231f5 NOOP: add comment as a reminder for post-nutempo merge 2021-06-11 19:13:13 -06:00
Robin Gareus c01f68cfca
Fix MIDI bounce w/processing (event times + latency compensation)
see also 8f9c1df183
2021-06-12 02:34:22 +02:00
Robin Gareus 2e574a011a
Amend 6e82f3669f, set BaseUI thread priority early on
This is conceptually clearned compared to doing it as
part of the session.
2021-06-10 04:30:03 +02:00
Robin Gareus 6e82f3669f
Correctly set ctrl-surface thread priority 2021-06-10 03:17:55 +02:00
David Robillard 74e21e942e Remove unused variables (Wunused-variable) 2021-05-30 20:09:35 -04:00
Robin Gareus d839e9cf14
Consistent _nth_ API call 0-based index 2021-05-26 02:33:31 +02:00
Ben Loftis 6733a847ee Fix Bounced region+filename (lib part)
Prior implementation:
  Bouncing a range and naming it "chorus" resulted in:
     ..a region per track, and they were all named "chorus"
     ...a file per track, with the name "chorus-{playlist name}"

New implementation:
   Bouncing a range and naming it "chorus" results in:
     ..a region per track, with the name "chorus-{playlist name}"
     ...a file with the same name as the region
2021-05-20 11:42:48 -05:00
Robin Gareus 1173262503
Fix insert-position when adding route from template 2021-05-06 21:21:47 +02:00
Robin Gareus 5957e14259
Remove unused #include<> (2/2)
PBD::stacktrace() is not used nor needed by default.
It should be used sparingly.
2021-05-05 17:57:16 +02:00
Paul Davis 30c03c0c45 remove commented debug output 2021-05-04 11:30:38 -06:00
Paul Davis 4b87c3a6b1 complete removal of Session::_transport_speed, _default_transport_speed and takeover of transport state mgmt by TransportFSM
The TransportFSM is now responsible for deciding what to do at all transport state transitions. The Session (via the TransportAPI) merely
provides mechanism (locate, start, stop, set_speed). Default and most recent speed requests are managed by the TransportFSM too
2021-05-03 17:40:41 -06:00
Robin Gareus 94d79a3809
Count xruns during realtime export 2021-04-29 17:50:28 +02:00
Paul Davis 3fa027f19d correctly use a valid out-of-bounds value for Session::_requested_transport_speed 2021-04-19 16:14:08 -06:00
Robin Gareus c1f1cd5b3e
Prepare for foldback bus A/PF Listen 2021-03-24 17:47:53 +01:00
Robin Gareus cc7b8b1bc5
gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
Robin Gareus 31d56eb7fc
Unconditionally set diskstream name, fix setting take-name
Since 6.0 take-name was not updated correctly:
The name changes in Session::non_realtime_stop(). At that
time tracks are still record-armed and ignored name changes.

Newly created tracks also never had a diskstream name set
correctly. This only happened at session-load via set_name(),
or config change.
2021-03-15 22:36:58 +01:00
Robin Gareus bdec5aa88e
Keep I/O bundle names in sync with custom names
This fixes an issues that IObutton dropdown did not show
renamed inputs until after session-reload.
2021-03-14 18:14:56 +01:00
Robin Gareus d5a105e777
Keep track of capture duration 2021-02-22 01:00:01 +01:00
Robin Gareus b48ce43ade
Implement Input Monitoring 2021-02-22 00:59:59 +01:00
Paul Davis 767253bbd8 add new transport related member to Session, and initialize _last_transport_speed
The missing initialization didn't cause a visible problem, but was added for completeness
2021-02-12 09:36:52 -07:00
Paul Davis 220706459f fix problem with attempting to set virtual keyboard port pretty name from a port registration callback
The JACK API doesn't allow server calls from inside a server callback, even though JACK2 doesn't enforce this.

It would be nice to find a way to NOT call Session::setup_bundles() from every port registration callback, too.
2021-02-09 16:01:08 -07:00
Robin Gareus e67c925b1f
Auto-connect thread: only take process-lock if needed 2021-02-09 22:46:31 +01:00
Robin Gareus 7e74f9eb1e
Keep track of recently touched Controllable 2021-02-09 02:11:04 +01:00
Paul Davis c2aad41e46 libardour: default speed requires transport *and* engine speed
Retain engine speed across stop/start/locate, so that it is
possible to run a loop at non-unity speed. User must
explicitly reset to 1.0 if default speeds are set to !1.0
2021-02-05 22:24:02 -07:00
Robin Gareus 2e5ba08286
Add signal to indicate any track rec-arm change 2021-01-30 02:38:54 +01:00
Robin Gareus 0257804c57
Fix default track name patterns, remove additional space 2021-01-08 22:50:50 +01:00
Robin Gareus 5974e61854
Add option to skip MIDI track input auto-connect 2021-01-08 22:50:45 +01:00
Robin Gareus b043336c86
Fix monitor-sends with templates
This fixes an issues with missing monitor-sends when creating
a session from a template with monitor-section, or when creating
tracks from a route-template.
2020-11-27 00:11:41 +01:00
Robin Gareus a62fd0379e
Consolidate monitor-send setup 2020-11-26 23:58:15 +01:00
Paul Davis ab6a1d062d add new butler seek counter 2020-11-12 18:54:44 -07:00
Robin Gareus 2e98c57fb8
Finalize experiment: always propagate solo via sends
See also caf057f06d
2020-10-23 00:24:06 +02:00
Robin Gareus bebca37447
Cache the latency of the metronome's port 2020-09-22 21:42:52 +02:00
Robin Gareus 5193052d8a Fix OSX builds (i18n)
i18n must be included last, after all template  specialization.
Otherwise the following happens:

In file included from ../libs/pbd/pbd/i18n.h:22:
../libs/pbd/pbd/compose.h:122:6: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup
2020-08-06 21:38:00 +02:00
Ben Loftis 76894b0ac3 When consolidating a Range of midi, the resulting region should fill the Range (not stop at the end of midi content) 2020-07-28 12:29:27 -05:00
Robin Gareus b49656213d
Prefer const reference (amend f564c92493) 2020-07-26 17:15:15 +02:00
Ben Loftis a8c29991d6 Assign a take_id to Bounced regions, so a multitrack bounce can be sorted/recognized in a list 2020-07-26 09:53:47 -05:00
Ben Loftis 4f6c71f275 Use the Track name in captured_for property (was processor:playlist which was obtuse) 2020-07-26 09:53:47 -05:00
Ben Loftis f564c92493 Prompt user for name of Range and Region bounces (libardour part) 2020-07-26 09:53:47 -05:00
Ben Loftis 16c2df08ae When bouncing, use a TAG rather than changing the region name. 2020-07-26 09:53:47 -05:00
Robin Gareus ba0dac92f2
Add a main-outs volume control and dedicated master-volume
This is intended for loudness normalization - #8318 to add
additional gain as last step.
2020-07-21 02:18:38 +02:00
Paul Davis 15fcb5c782 Transport: engaging loop play while rolling with no audio tracks now works
At present only audio data from disk readers is declicked. MIDI tracks with audio output should
likely also be declicked, at which time Session::need_declick_before_locate() will require
amending
2020-07-18 17:30:06 -06:00
Robin Gareus c778ded411
Auto-connect MIDI track/bus when output ports change
previously this subscription was handle done in
Route::add_routes() -> add_routes_inner() for MIDI tracks only.

Since f6c0b02d9f this was only done when adding
tracks, after any instruments were loaded (and fanned out).
2020-07-19 01:07:57 +02:00
Robin Gareus f5727e50d1
Another attempt at fixing the auto-connect race condition 2020-07-19 01:05:35 +02:00
Robin Gareus 7f20e9c705
Fix auto-connect thread race-condition 2020-07-19 00:40:34 +02:00