Commit Graph

382 Commits

Author SHA1 Message Date
Paul Davis 851388e0b4 remove "rename_playlist" argument from Route::set_name_in_state().
We no longer find playlists by name when constructing tracks, so
the name of the playlist is not relevant
2019-03-20 20:02:07 -07:00
Paul Davis 63fdfd9e85 remove PostTransportWorkCurveReallocate (no longer used) 2019-02-22 14:54:34 -07:00
Robin Gareus 8006057279
Avoid dynamic-cast, prefer virtual inheritance for performance reasons 2019-02-21 16:10:45 +01:00
Len Ovens f27ca29d6c Changed send/deliver role "Personal" to "Foldback" so bus type can match 2018-11-12 22:30:32 -08:00
Len Ovens 777fe3c68f Add personal monitor sends 2018-10-19 08:51:29 -07:00
Robin Gareus f4c1166651 Fix track rename oddity, don't skip over current name.
ensure_track_or_route_name() can produce the current name.

This fixes the following issue:
Create a two audio tracks. Their names are "Audio" and "Audio 1".
Try to rename "Audio 1" to "Audio", its name becomes "Audio 2".
2018-08-06 19:52:51 +02:00
Robin Gareus cdec333bfe move rt-stop to route
currently this is only used to resolve midi events for plugins
(this is conceptually not correct, note offs should be resolved by
the disk-reader only), but it calls into all processors now (incl
disk-reader if present), which is handy (e.g. flush delaylins)
2018-07-09 17:30:38 +02:00
Robin Gareus 249640267c Remove global declick API
De-click will be per disk-reader, latency compensated and buffer-size
independent. Cue-monitoring should not be affected by de-click.
2018-07-09 17:30:38 +02:00
Ben Loftis 208c781248 Auto-monitor == Cue for MIDI tracks. 2018-02-14 18:04:57 -06:00
Ben Loftis e6da4c4846 SoloSelection: libardour part. 2018-02-11 09:39:36 -06:00
Robin Gareus 79b1275b7c Fix set_loop() return value (amend 00a4ad) 2017-10-31 22:00:22 +01:00
Robin Gareus 00a4ad712c Move Loop Location to Processors
The processors will becomes responsible to know about loop-positions
and map latency-compensated start_sample, end_sample into the loop-range
as needed.
2017-10-31 18:32:26 +01:00
Robin Gareus 9a2433eacf Migrate to Polarity-inversion processor & fix proc positions
* invert polarity after disk i/o proc or return
* fix position of export-proc (after polarity)
* fix input-meter (before disk-writer or after return)
2017-10-31 03:18:59 +01:00
Ben Loftis 23c2b751aa US2400: map knobs for mixbus strips, when selected. 2017-10-19 11:53:55 -05:00
Ben Loftis 28d8f2f6b9 US2400: send_pan_azimuth lookup function (currently mb-only) 2017-10-05 09:59:03 -05:00
Robin Gareus e31f5d9998 Clean up State API:
* Processor implement get_state(), classes derived from Processor
  implement protected ::state() -- as documented in processor.h
* likewise for Route, Track: make ::state() a protected interface
* removal of "full_state", use explicit "template_save"
* use RAII/Unwind to skip saving automation-state
2017-10-04 00:54:55 +02:00
Robin Gareus eb0dded095 Immediate-event/out-of-band injection update & tweak clearing buffers
Immediate events are used for MIDI-Panic and to inject GUI generated
events e.g. patch-changes, note-events from the track-header
(scroomer-keyboard) and patch-change audition.

Current behavior:

- snapshot copy immediate events from ringbuffer into a buffer at
  the beginning of each the cycle.
- Inject immediate events into input-buffer directly after reading the input
- process "normally"
- pass immediate event-buffer to disk-writer, so it can skip them
  (don't write immediate events to disk)
- if the Route is not monitoring input: clear buffer before disk-reader
  and re-inject (original) immediate events after the disk-reader
- immediate events process normally and are also sent to outputs.
2017-09-30 23:16:04 +02:00
Robin Gareus dec10f2f3c First part of consolidating ::roll(), ::no_roll()
This moves common code (get and fill buffers) into ::passthru()
and renames ::passthru() to ::run_route().

passthru_silence() is no longer used (it was only needed A5 style
Track::no_roll_unlocked for no-roll + disk-monitoring)
2017-09-30 18:53:02 +02:00
Robin Gareus 0fc3bbddb2 remove unused Route::_silent 2017-09-30 18:46:24 +02:00
Robin Gareus 5fa9f8b399 Towards fixing no_roll()
Currently ::roll() may actually be a ::no_roll() under some circumstances.

This can also happen during count-in:
  transport_stopped () == transport_rolling()

and during latency-preroll:
   Global session-transport speed != 0, some tracks already roll,
   read data from disk and feed latent plugins.
   but other non-latent tracks or busses don't roll and still have to
   behave like the switch from no_roll() to roll() has not yet happened.

This changes the game WRT to monitoring as well, previously, Route:roll()
called Route::no_roll_unlocked () for conditions outlined above.
Now Track::no_roll_unlocked is called and in some cases wrongly clears
the buffers before the signal hits the disk-writer. (more work is needed
related to 61f8e53b)

On the upside this also fixes an issue with MidiTrack::no_roll not keeping
a lock while pushing data into the step-edit-ringbuffer.

This is also a step towards consolidating all entry points:
::roll(), ::no_roll(), ::silent_roll() in the Route class.
2017-09-30 16:45:45 +02:00
Robin Gareus 8139becb18 Ongoing work on latency compensation
The general goal is to align transport-sample to be the audible frame
and use that as "anchor" for all processing.

transport_sample cannot become negative (00:00:00:00 is the first audible
frame).

Internally transport pre-rolls (read-ahead) before the transport starts
to move. This allows inputs and disk to prefill the pipeline.

When starting to roll, the session counts down a global "remaning preroll"
counter, which is the worst-latency from in-to-out.
Each route in turn will start processing at its own output-latency.

Route::process_output_buffers() - which does the actual processing
incl disk i/o - begins by offsetting the "current sample" by the
route's process-latency and decrements the offset for each latent
processor.  At the end of the function the output will be aligned
and match  transport-sample - downstream-playback-latency (if any).

PS. This commit is a first step only: transport looping & vari-speed have
not yet been implemented/updated.
2017-09-29 05:03:48 +02:00
Robin Gareus 69b9ad6bcc Prepare removal of initial_delay 2017-09-29 05:03:48 +02:00
Robin Gareus 3d1e1d7213 clean up route header, NO-OP (except variable re-order) 2017-09-29 05:03:48 +02:00
Robin Gareus abb7cb90e7 NO-OP: Whitespace 2017-09-29 05:03:48 +02:00
Robin Gareus 13cf4da011 Consolidate check for internal/non-removable processors 2017-09-23 00:34:01 +02:00
Paul Davis 48d11000e5 attempt to fix roll delay logic by moving it into DiskReader (the only place it matters) 2017-09-19 18:53:27 -04:00
Paul Davis 40aebce699 consolidate roll methods into Route::roll()
We want Track to shrink, and logic consolidation is always good. Route already knew about
disk_reader and disk_writer, now it knows about _monitoring_control too
2017-09-18 21:28:02 -04:00
Robin Gareus 10b76ae631 Various updates and fixes for Latency Compensation
* centralize signal_latency_at_***_position to processors
* update initial-delay/roll-delay when processor order changes
* consolidate signal-latency calculation: use the same method
  for processor-changes and session's post_playback_latency.
* include relative output-delay in roll-delay
* fix capture processor position & optimize stem-export latency

(roll-delay fixes pending Route:roll() update)
2017-09-19 02:11:22 +02:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Paul Davis 13d44c4d76 move disk_{writer,reader} into Route to allow for simple, sensible implementation of DiskIOPoint 2017-09-18 11:40:53 -04:00
Paul Davis 4bfc5ddf71 mechanism to allow Track (or other Route-derived type) to add its own processors at the right time 2017-09-18 11:40:53 -04:00
Paul Davis dc4f730ac9 initial (incomplete) framework for DiskIOPoint manipulation 2017-09-18 11:40:53 -04:00
Paul Davis 274726084d fix up error in manual rebase correction 2017-09-18 11:40:53 -04:00
Paul Davis d4280997fb the return of MIDI recording, plus refactor to move post-capture playlist manipulations into Track 2017-09-18 11:40:53 -04:00
Paul Davis 2a1dccabc9 get diskreader working, and remove per-track varispeed API and mechanism 2017-09-18 11:40:53 -04:00
Paul Davis a4a87f56e9 mega-commit to save state of first "it compilesand links" state for separated disk i/o changes.
THIS WILL NOT RUN. THIS REQUIRES MANY CHANGES
2017-09-18 11:40:52 -04:00
Robin Gareus 5637bdd29b Prepare for singleton patch-selector per midi-track UI (mixer, editor,..) 2017-09-09 18:20:36 +02:00
Johannes Mueller 245154d06a Let user add a route template description on saving route templates 2017-08-20 21:09:30 +02:00
Robin Gareus 24e92c1861 NO-OP: consistent [internal] API name for Automatables 2017-07-22 04:45:48 +02:00
Robin Gareus 9334c99b35 Update Slavable API
Do not use AutomationType to identify parameters, use complete
Evoral::Parameter and Automatable.

For "batch connections", a Slavables needs to implement an API to return
the relevant controls.

This is only a first step towards a more generic Master/Slave framework.
2017-06-22 22:04:10 +02:00
Robin Gareus faa52a3349 NO-OP: whitespace 2017-06-22 22:04:10 +02:00
Robin Gareus 3d26a29e8a Sanitize "well-known" ctrl API 2017-05-14 00:17:11 +02:00
Ben Loftis efc2660fec MCP: Mixbus32C: Restore missing filter controls to the Dyn page. 2017-05-12 15:44:01 +02:00
Paul Davis bcbdd858fa Selection::get_stripables() needs to recurse into an Automatable's child Automatables when looking for for an Automation Control
It also needs renaming (to come)
2017-05-10 08:52:55 +01:00
Paul Davis 0c035778e1 libardour now has CoreSelection object to manage selection status of Stripables and AutomationControls 2017-05-05 18:56:25 +01:00
Robin Gareus d64ca9be08 Properly expose "well known" comp_redux output. 2017-04-12 21:14:50 +02:00
Robin Gareus 7a36ce4925 Instrument insert options:
* allow to directly fan-out when adding a multi-channel instrument
 * Mixbus: move multi-channel instruments after Comp & EQ.
2017-01-21 00:38:43 +01:00
Robin Gareus 4f8fdf0af7 Allow to get a route reference from SessionObject*
The motivation is to allow a Processor (here Lua) to get a pointer
to the owning Route without resorting to iterative lookup.
2016-10-10 17:34:18 +02:00
Paul Davis bd80b2f144 fix issue with solo-in-place
Monitor outs cannot be muted by other soloing. Duh.
2016-07-21 13:16:05 -04:00
Julien "_FrnchFrgg_" RIVAUD 8af589b322 Consolidate delivery buffer flushing of all route types
Route::no_roll(), Route::roll(), Track::no_roll(), AudioTrack::roll()
and MidiTrack::roll() all had the exact same loop for flushing buffers
of their Delivery processors. That was a lot of replicated code that had
to be kept synchronised by hand. Put that code into a protected method
Route::flush_processor_buffers_locked() which is called instead.
2016-07-14 21:55:49 -04:00
Robin Gareus 0d050de94e move latency-recompute into dedicated thread.
this fixes an issue with jack1 and jack_latency_recompute() since must not
send a server request from inside the server callback.
2016-07-09 17:42:58 +02:00
Paul Davis fcf49de774 move gui_changed() signal from Route to Stripable 2016-06-08 11:03:13 -04:00
Robin Gareus a03217c27f update lua bindings for API changes
luaBridge implicit inheritance uses a single direct parent
(other parents object need casts). This motivates
 Route -> Stripable -> SessionObject
2016-05-31 23:51:22 +02:00
Paul Davis b2df48263b add generic ::slaved() method to Route 2016-05-31 15:30:43 -04:00
Paul Davis e0ff70cf86 first vaguely working version using PresentationInfo
remote control ID and "order keys" have been removed.
2016-05-31 15:30:42 -04:00
Paul Davis f485cfa324 rearrange inheritance so that Automatable IS-A Slavable
Share assign code via Slavable; add visibility tags to Slavable+SlavableAutomationControl
2016-05-31 15:30:41 -04:00
Paul Davis 83e51ee69b add Slavable API for VCA assign/unassign 2016-05-31 15:30:41 -04:00
Paul Davis 5b5e64d860 remove Route::listening_via_monitor()
This is better tested with direct use of the solo_control and
Config->get_solo_controls_are_listen_controls()
2016-05-31 15:30:41 -04:00
Paul Davis 69250b64ea move ever close to working master/slave logic, this time with audio testing 2016-05-31 15:30:41 -04:00
Paul Davis 6de4953be8 a variety of changes that get closer to correctly functioning behaviour for VCA solo+mute (BUT ARE NOT DONE YET) 2016-05-31 15:30:41 -04:00
Paul Davis 653ae4acd6 universal change in the design of the way Route/Track controls are designed and used. The controls now own their own state, rather than proxy for state in their owners.
Massive changes all over the code to accomodate this. Many things are not finished. Consider this a backup safety commit
2016-05-31 15:30:40 -04:00
Paul Davis 194b213456 add implicit mute state to MuteMaster and use when a master of a mute control is enabled/disabled. Add AutomationControl::master_changed() as a virtual method to handle ... master value changes 2016-05-31 15:30:40 -04:00
Paul Davis 5531c83496 change API of Controllable::Changed signal to include (from_self, GroupControlDisposition)
This allows the signal to convey more information, which may be required by some handlers of a control's Changed signal
2016-05-31 15:30:40 -04:00
Paul Davis 1c0c9b40b7 new API for route solo/mute state mgmt
Route now calls back into Session when solo/mute/listen state changes. All other interested
parties must use the Route::{solo,mute,...}_control()->Changed() to be notified of changes.

The Session requires more information than the Changed signal can provide, in order to
propagate solo/mute changes across the entire Session correctly.

Note that this uses an experimental use of CRTP to isolate a public API within Session
2016-05-31 15:30:40 -04:00
Paul Davis 8eb45c518d rearrange AutomationControl and RouteAutomationControl to get more shared logic and consistent master/slave behaviour 2016-05-31 15:30:40 -04:00
Paul Davis 04e26fe7e6 move VCA assignment up to Route level 2016-05-31 15:30:39 -04:00
Paul Davis 1f6800d421 redesign Route and VCA objects to inherit from ARDOUR::Stripable 2016-05-31 15:30:39 -04:00
Paul Davis acaaa98bd0 start shaping up VCA assign process 2016-05-31 15:30:38 -04:00
Robin Gareus b4d4cb805e prepare plugin configuration and replacing instruments 2016-05-19 16:29:08 +02:00
Robin Gareus d53d9b01ab prepare route pin display (shared mixer + editor-mixer window proxy) 2016-05-10 20:54:11 +02:00
Robin Gareus 6236c201bd NO-OP, whitespace 2016-05-04 12:57:30 +02:00
Robin Gareus 633f218911 fix a deadlock with jack2 when inserting a plugin adds ports.
When adding a processor, the processor may add ports leading to
a call to jack_port_register(). while Ardour holds a WritertLock on the
processor-list (this commit removes this WriterLock).

with jack2 that results in a graph-reorder callback (WHY?)

jack2 issues that graph-reorder in a separate thread BUT
port-registration does not return until the graph-reorder is complete.

On Ardour's side, graph_reordered() calls Session::resort_routes ()
which eventually checks Route::direct_feeds_according_to_reality()
which needs a ReadLock on the processor-list to check I/O.

Since jack_port_register() does not return, this constitutes a deadlock.

THE ACTUAL PROBLEM IS JACK2's THREAD DESIGN!
Why does jack_port_register() trigger a graph-order in jack2?
No connections are made.
..and why does it block jack_port_register() from returning if
that graph-order callback is in a different thread?
http://pastebin.com/DZANXJLz
2016-04-28 21:15:26 +02:00
Robin Gareus c30b47f0eb allow to customize variable i/o plugin inputs 2016-04-27 23:34:55 +02:00
Robin Gareus bb090c0012 add self-removing Sends (remove on disconnect)
The idea is to dynamically add/remove sends for feeding a sidechain
and re-use all existing "External Send" infrastructure in particular
latency compensation.
2016-04-17 14:01:09 +02:00
Robin Gareus 424cacfbc8 variable plugin port config.
* extend plugin API (query IO ports)
* collect possible variable plugin configurations (AU, Lua)
* prepare semi-automatic configuration (presets: mono, stereo, N)
2016-04-15 17:57:40 +02:00
Robin Gareus a95e7fe275 yet more documentation.. 2016-04-13 00:07:28 +02:00
Robin Gareus f5e4d3b032 NO-OP; document some more parameters.
Since headers only provide the declaration, function
parameters need to be documented.
2016-04-12 11:06:35 +02:00
Robin Gareus 021a52cc75 Route API to query all outputs (incl sends) and graph-feeds 2016-04-06 02:01:17 +02:00
Robin Gareus daa10a6a38 Fix graph ordering incl. Inserts, Returns and SideChains
When building the process graph. Ardour usess
   Route::direct_feeds_according_to_reality()
This function only tests if the current route (or any ioprocessors)
is feeding another route's *input*.

Inserts, Return and now Sidechains are ignored as destinations on the
destination route are not taken into account.

This is now resolved by adding an IOVector, a collection of all inputs
of the destination route.
2016-04-03 22:45:23 +02:00
Robin Gareus 6739b6a1e3 handle sidechain input changes 2016-04-03 05:16:54 +02:00
Robin Gareus 91b875148a expose plugin sidechain (via route):
Processor and Process lock are needed, and the plugin chain needs to be
reconfigured, so this cannot be directly performed by the plugin.
2016-04-03 03:11:18 +02:00
Robin Gareus c444105710 closing in on pin management.
overall the PluginInsert API is complete.
many implementation details remain.
2016-03-27 21:33:40 +02:00
Robin Gareus edaeaf57ba prepare strict-i/o configuration. 2016-03-25 20:00:48 +01:00
Robin Gareus e41d4e8248 prepare Instrument slots -- replace processor in place 2016-03-19 16:41:59 +01:00
Len Ovens 7d5671a411 mackie control: Fix crash when selecting Track on MIDI strip, don't create phase control if there is none. 2016-02-03 10:35:35 -08:00
Paul Davis b728d3c9ff clean up mess in Route/Track controllables caused by not understanding the significance of ParameterDescriptor 2016-02-01 15:15:02 -05:00
Paul Davis c56058b9de provide route solo isolate and solo safe automation controls 2016-01-31 21:49:18 -05:00
Paul Davis 9128fbd68f add a new constructor for RouteAutomationControllable that takes a ParameterDescriptor 2016-01-31 21:45:36 -05:00
Paul Davis fd291d1fa5 add new Route API ::master_send_enable_controllable() to provide generic access to a mixbus-centric control 2016-01-29 12:58:15 -05:00
Paul Davis 4a5b81a838 add new API to Route to get name of "well-known" nth-send
Route::nth_send() has the wrong semantics in Mixbus for this purpose. Probably
need to revisit this at some point
2016-01-28 23:05:28 -05:00
Paul Davis 708d80029b make Route::nth_send() and Route::nth_processor() be const 2016-01-27 11:37:54 -05:00
Paul Davis c79243c805 add stubs and enums to access "well-known" send controls 2016-01-27 11:16:22 -05:00
Paul Davis 22a20c7333 change exposed type of various objects' gain controls; remove Amp::gain() as a shortcut 2016-01-25 11:47:21 -05:00
Paul Davis 9e5b7db89f first compiling, mostly working version of group controls changes 2016-01-22 11:58:31 -05:00
Paul Davis 64c9198d60 add group disposition argument to Route::set_gain() and use it in various UIs
Executive decisions were necessary in a couple of places about the correct group disposition
behaviour, notably faderport and OSC surfaces
2016-01-18 12:11:09 -05:00
Paul Davis 1948b50a68 working version of new gain control design 2016-01-18 12:11:08 -05:00
Paul Davis d1033819bd change ownership of the AutomationControl used by Amp.
It used to be owned by Amp. Now it is owned by Amp's owner
2016-01-18 12:11:08 -05:00
Paul Davis 9e3299f97d change Controllable::set_value() API to include grouped control consideration.
This also removes Route::group_gain_control() and associated machinery.
Not yet tested with Mackie or other surfaces. More work to done to
start using the group capabilities, and also potentially to add
or derive more controls as RouteAutomationControls
2016-01-02 04:58:30 -05:00
Robin Gareus d9eb5e00c5 cont'd work on plugin-state templates - #6709
Refactor and consolidate code and re-use it for session-templates.
This avoids recursive copying of the plugin-dir()
2015-12-19 14:46:15 +01:00
Paul Davis ab3f0f75a8 new route API to discover/access well-known automation controls for panning, EQ and compression.
The EQ and compression parts do nothing for Ardour, where there is no identifiable and understood plugin to perform their
roles. They do work on mixbus, which also serves as a model for how to do this.
2015-12-16 06:00:56 -05:00