Commit Graph

935 Commits

Author SHA1 Message Date
Paul Davis ff89d998b2 triggerbox: steps toward sane trigger stopping API and design 2021-12-22 17:27:26 -07:00
Paul Davis 12847b0125 remove Session::bbt_time() and use TempoMap::use()->bbt_at() explicitly everywhere 2021-12-14 21:59:33 -07:00
Ben Loftis e7569eabe7 Trigger Cues: implement master Stop button (libardour part) 2021-12-13 07:26:47 -06:00
Ben Loftis 11543b1c9b Deinterlace MIDI: split a midi region into per-channel regions (libardour part)
code is similar-but-different-from Importing with split-midi-channels enabled
2021-11-19 10:28:37 -06: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 f3481df9d4 Add new static Session signal will be emitted after port reconnection on session load. 2021-11-03 15:03:40 -06:00
Robin Gareus 84b75f6627
Retain MIDI monitor connection -- #8816
A physical input port must remain connected to ardour's
physical_midi_input_monitor_enable port, otherwise reading
its input can cause crashes.

Previously a MIDI input port was disconnected from all other
targets when "MIDI input follows selection" was enabled.
2021-10-31 16:37:37 +01:00
Paul Davis 55209b5df7 triggerbox: respond to changes in default trigger input port 2021-10-09 16:58:58 -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
Paul Davis e52eead1b6 Add Session::start_transport_from_processor() (for process() context use only) 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 04b4fc531d remove default args to Session::new_midi_track() (libs edition) 2021-08-13 12:51:36 -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 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 60d1c5f722 remove tempo map from Session 2021-08-13 12:51:30 -06:00
Paul Davis c9055547f3 set thread-local variable infrastructure for process thread & process graph 2021-08-13 12:51:29 -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
Paul Davis f4490f54c5 change Timecode::BBT_Time to use Temporal namespace, plus a couple of other minor changes to enable compilation
This still uses the tempo map object in libs/ardour, not the new one in libs/temporal, and isn't likely to be functional
(though it could be)
2021-08-13 12:51:28 -06:00
Paul Davis cd7c222942 Do not queue TransportStateChanged events (and thus signals) when locating from the end of a loop.
There is no event processing after the locate, and so the event that is (was)
queued at the loop start will not be processed, and each time we reach the
loop end, we will try (and fail) to queue an identical event (fail because
duplicate events are not allowed). We don't need this event (or signal) at
all, because locates (and then ::start_transport() while looping do not
represent a state change that any UI needs to know about.
2021-07-26 17:27:43 -06:00
Paul Davis e01f898f3b libardour: adjust names for default speed APIs and make ::set_default_play_speed() private 2021-07-18 19:48:13 -06:00
Paul Davis 3bdf009e11 libardour: provide infrastructure for requesting default play speed 2021-07-18 19:40:21 -06:00
Ben Loftis f11350cd31
Default_Play_Speed: nuke shuttle Wheel mode (libardour part) 2021-07-03 19:06:02 +02: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 d31a7c292f Default_Play_Speed: nuke shuttle Wheel mode (libardour part) 2021-06-25 11:51:34 -05: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
Robin Gareus 80c11a763a
Notify GUI of x-run counter resets 2021-06-14 03:09:46 +02:00
Paul Davis 1777cf8f69 add some initial timing points for dsp stats 2021-06-11 18:55:24 -06:00
Robin Gareus d839e9cf14
Consistent _nth_ API call 0-based index 2021-05-26 02:33:31 +02: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
Paul Davis 3d10f44b30 remove PostTransportRoll enum.
The decision to roll or not, and the handling of the decision, is the responsibility of the TransportFSM. No enum required
2021-05-03 17:40:41 -06:00
Paul Davis c7c5379fac remove "flush" argument from Session and TransportFSM locate APIs (it does nothing) 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 dc19aa866b change API for Session::set_transport_speed() to include "at-next-start" option 2021-04-19 16:14:08 -06:00
Paul Davis aeed50b1cc add Session::reset_transport_speed() 2021-04-19 16:14:08 -06:00
Paul Davis ec367f49e1 add Session::request_transport_roll()
Start separation of API for controlling rolling state from that used for speed
2021-04-19 16:13:38 -06: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 9fb21a0905
Add API to determine undo status
This is is useful to determine if an undoable action was
performed before adding additional information (e.g. selection
changes) to the undo transaction.
2021-03-10 13:51:35 +01:00
Robin Gareus 0b00eabb19
Store recently used backend with session
This is in preparation to warn a user in case the session
is loaded with a different device and connections may be lost.
2021-02-23 19:22:22 +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
Robin Gareus 2556f47c2b
Move method exclusive/momentary-solo setup to libardour
This allows to re-use the method in various places, outside of
RouteUI (e.g. control surfaces, recorder page)
2021-02-22 00:59:58 +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 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
Damien Zammit 5d0de7e037 pt import: Fix progress bar to span the whole import 2021-01-17 13:19:54 +11:00
Damien Zammit 12d62cd16e pt import: Fix race condition/threading, don't call new_audio_track() in bg thread 2021-01-17 13:19:54 +11:00
Robin Gareus 5974e61854
Add option to skip MIDI track input auto-connect 2021-01-08 22:50:45 +01:00
Robin Gareus f8b5424d9f
Fix deadlock during export
When using the export-tool, the very first callback may already be
freewheeling. In this case the first call to the butler also happens
directly from the freewheel process-callback and initial session events
are handled there. Setting PostTransportAdjustPlaybackBuffering
took the process-lock, which caused a deadlock:


Glib::Threads::Mutex::Lock::Lock(Glib::Threads::Mutex&) at /usr/include/glibmm-2.4/glibmm/threads.h:687
ARDOUR::Session::butler_transport_work() at ../libs/ardour/session_transport.cc:1157
ARDOUR::Session::process_export_fw(unsigned int) at ../libs/ardour/session_export.cc:303
ARDOUR::AudioEngine::process_callback(unsigned int) at ../libs/ardour/audioengine.cc:486
ARDOUR::DummyAudioBackend::main_process_thread() at ../libs/backends/dummy/dummy_audiobackend.cc:951
2020-12-08 01:09:57 +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 84bf97aa49
Update ControlProtocol API, use CoreSelection
* replace signal-emission with direct calls to CoreSelecton
  using BaseUI's session pointer
* remove unused leftmost strip API
* use CoreSelection for first-selected strip
* Accessing CoreSelection does not modify the session
  (allow access from const callbacks)
* replace static calls in P2 surface

This removes indirection and dependency on the GUI for
managing strip selection.
2020-10-18 14:44:38 +02:00
Robin Gareus bebca37447
Cache the latency of the metronome's port 2020-09-22 21:42:52 +02:00
Robin Gareus 1a3da7e132
Keep processing while locating #8392
Previously when locating process_can_proceed() was set to true,
and routes were not processed while transport states are cleared.
As a result live input was also not processed.

This is no longer needed because the DiskReader handles seeking
directly.
2020-09-05 05:32:22 +02:00
Robin Gareus b49656213d
Prefer const reference (amend f564c92493) 2020-07-26 17:15:15 +02:00
Ben Loftis f564c92493 Prompt user for name of Range and Region bounces (libardour part) 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 f6c0b02d9f
Overhaul MIDI auto-connect #8317, #8307
This consolidates instrument creation for midi tracks & routes.
If an instrument is added, output auto-connect is postponed until
after the instrument plugin is added. Also when a multi-channel
instrument is fanned-out, the track outputs are not auto-connected.

This also subscribes MIDI-Busses to auto-connect when an instrument
is loaded or replaced at a later time.
2020-07-18 23:27:11 +02:00
Robin Gareus 9fcb51de2e
Use signed int for atomic operations part II -- #8314 2020-07-16 18:07:14 +02:00
Robin Gareus 9d390f38bf
Cache MIDI generator port latency
This reduces excessive, expensive calls to get_connected_latency_range()
2020-07-12 01:50:01 +02:00
Robin Gareus d33cc4a3dd
Document transport state semantics
This also adds transport_state_rolling() which can be used
from a TransportStateChanged callback.
2020-06-12 05:02:06 +02:00
Robin Gareus 72d45c154a
Do not allow ctrl chars in file (or session) names (1/2) 2020-06-09 20:30:51 +02:00
Robin Gareus ef94663d1c
Overhaul MIDI Clock generator
* Fix absolute time alignment, sync clock ticks on exact beats
* Fix start/cont sync to MIDI Clock **Beats** (MIDI Clock / 6)
* Send timecode from engine (not session) - vari-speed independent
* Special case MClk port, don't /resample/
* Support pre-roll, sync start.
2020-05-31 23:46:28 +02:00
Robin Gareus 3a9bf57af9
Don't save the session when creating busses
Most calls to new_audio_route() used save = false, only directly
creating busses saved the session. Probably for historical reasons.
2020-05-19 18:02:23 +02:00
Robin Gareus 749291245c
NO-OP: replace `save_state("")` with `save_state()` 2020-05-19 17:14:47 +02:00
Paul Davis 7232ac2f67 update DiskReader loop delick objects when loop changes 2020-05-13 18:52:29 -06:00
Paul Davis abbcc755c1 reinstate Session::loop_changing to avoid problems when locating to start of loop for loop play 2020-05-13 18:52:29 -06:00
Paul Davis 156a31ac4f remove Session::loop_changing
Since we now (correctly) do not locate for loop changes, this member
is unnecessary
2020-05-12 11:34:38 -06:00
Robin Gareus ace8a0d7b9
LTC Generator: prefer LatencyUpdated signal 2020-05-09 00:34:15 +02:00
Paul Davis 490fac1632 add new template methods for "foreach {route,track}" and use them
Also remove redundant double call to Track::set_block_size(). This dates back to 2010
when there used be an additional traversal of the Diskstream RCU-managed list, before
they became owned by Tracks
2020-05-07 17:40:20 -06:00
Robin Gareus a5faef9379
Remove unused variable 2020-05-07 20:43:26 +02:00
Robin Gareus 8ffcdc9d02
Send LTC timecode from engine context 2020-05-07 20:43:22 +02:00
Robin Gareus 7b28aabb43
Change LTC Generator from IO to Port
This is done in order to set the TransportGenerator flag
2020-05-07 20:43:04 +02:00
Robin Gareus 8aa4ae825d
Skip delayline updates if no change is required 2020-04-27 14:08:37 +02:00
Robin Gareus 31c39ed869
Remove duplicate i/o latency calculation
Port and connection changes always imply a latency_callback from
the engine. Worst I/O latency is updated directly in
Session::update_latency() which is called from
AudioEngine::latency_callback.

Explicit subscriptions to route->output()->changed() is not needed
to update the worst I/O latency.

Only set_block_size() needs to to update the I/O latency when
the buffer-size changes.
2020-04-26 21:34:26 +02:00
Paul Davis 58304b3a7e make Session::should_ignore_transport_request() non-const 2020-04-24 14:20:59 -06:00
Robin Gareus 9875a95829
RAII collect processor-change signals 2020-04-18 23:54:24 +02:00
Robin Gareus aa2ddb5ea2
API change: LatencyUpdated(), indicate playback/capture 2020-04-07 00:10:29 +02:00
Robin Gareus c16ab3a248
Allow to disable input auto-connect when creating tracks
Auto-connect is handled in a background thread, so newly created
tracks are not immediately connected.

This causes a race-condition when fan-out directly disconnects
and re-connects ports after track/bus creation.
2020-04-03 15:36:19 +02:00
Johannes Mueller 687b3078c3 Don't issue VersionMismatch when creating a new session
When we create a new session and are using a template from an old version of
Ardour, we should not issue the VersionMismatch dialog and not make a copy of
the session file for the old version.

We need to extend the signature of Session::load_state() to tell it if we are
creating a session from a template. Session::_is_new cannot be used for it
because it has a the semantics if to auto connect the the master bus.
2020-04-02 14:33:21 +02:00
Paul Davis 1157c7d457 if user chooses not to delete a scratch session, removed the file that identifies it as unnamed
This way they will not be asked again if they reload and then quit the session
2020-03-25 10:24:47 -06:00
Paul Davis 5f1d802307 when saving an unnamed session, rename it
Note that this is done at the GUI level, might need to double check if there are
other paths into a "save" that should be covered. Control surfaces use the action, but
Lua comes to mind
2020-03-24 14:10:39 -06:00
Paul Davis e9be6c23a8 a better approach to the name of the "unnamed" indicator file; remove file after successful save 2020-03-24 14:10:39 -06:00
Paul Davis 5766989319 introduce the idea of an "unnamed" session 2020-03-24 14:10:39 -06:00
Paul Davis b3a1cbbfa2 add in timing for disk buffer reload after locate, to replace hard-coded 0.05 seconds per track
Leave debug output in place for now to get some numbers from any testers
2020-03-23 17:05:45 -06:00
Paul Davis 8296a030a5 redesign chasing the transport master
Substantive comments associated with code in Session::plan_master_strategy.

Known not to work for reverse TC. Also, the JACK related code has not yet been tested
2020-03-20 17:38:38 -06:00
Paul Davis 1783305077 provide mechanism to report on destructive tracks presence in a session 2020-03-17 16:31:50 -06:00
Paul Davis 0738472fee NOOP: indent/whitespace 2020-03-17 16:31:49 -06:00
Paul Davis a4d7b45fe0 remove destructive/tape mode tracks 2020-03-17 16:31:49 -06:00
Paul Davis f5ec5ea929 add new API to TransportMasterManager to manage use of DiskReader::{inc,dec}_no_disk_output() 2020-03-13 13:52:38 -06:00
Robin Gareus 128a45954c
Do not de-click during freewheel export 2020-03-06 01:44:32 +01:00
Robin Gareus 1f6686c2a0
Separate pre-roll cycle calculation
This is also needed when exporting.
2020-03-06 01:44:32 +01:00
Robin Gareus 08559abc10
Add signals to indicate Punch/Loop constraints
This is in preparation for GUI sensitivity of Loop and Punch actions.
2020-02-27 22:16:12 +01:00