Commit Graph

154 Commits

Author SHA1 Message Date
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus 2c7f8eeb97
Indicate UTF8 literals - fixes glyph rendering with MSVC (1/2) 2023-01-16 21:41:09 +01: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 7b5d61b7a5
Fix transport master crash when switching backends
Port registration happens asynchronously. During the first process
callbacks the timecode/clock input ports may not have been
re-established.
2021-06-27 16:37:33 +02:00
Paul Davis 6b7be1083b no need to request stop if locating with MustStop 2021-04-19 16:14:08 -06:00
Robin Gareus 16f6e62249
Consolidate TansportMaster implementation
* share port_latency latency query for MTC and MIDIClock slaves
* propagate set_session()
* share session_connections for MasterViaMIDI

This is in preparation to allow MClk slave to access midi-port-latency
2020-05-27 23:40:09 +02:00
Robin Gareus 7289be59c9
Set timecode format from active master only 2020-05-13 17:39:06 +02:00
Robin Gareus fb203f3df8
Consolidate delta-string format, avoid markup 2020-05-12 14:59:44 +02:00
Robin Gareus ba1a60873a
Fix MTC delta report
This amends a6ffc6213b.
apply the offset before the DLL.
2020-05-12 01:49:45 +02:00
Robin Gareus 5e2755baa1
Slave delta display tweaks
* use left-aligned sign symbol with "sample" unit.
  When the delta value jitters in decimal places (e.g. MTC)
  it's otherwise no possible to discern + vs -.
* Use white text by default (not green)
2020-05-11 21:34:01 +02:00
Robin Gareus 58c5f75fc9
Fix TCM requiring port-reconnect when engine restarts
An engine restart sends dis-connect messages for the reverse
port-mapping (after making the connection):

Connect: system:midi_capture_41a56f90 -> ardour:MTC in
Connect: system:capture_1 -> ardour:LTC in
DisConnect: ardour:MTC in -> system:midi_capture_41a56f90
DisConnect: ardour:LTC in -> system:capture_1

This lead to TransportMaster being marked as inactive.
This is likely an issue that should be fixed elsewhere, but in
case of JACK, we likely do not have control over this.
2020-05-11 03:42:21 +02:00
Robin Gareus a6ffc6213b
Fix MTC latency compensation
Offset the detected timecode instead of the detection time.
The latter is used by the DLL and later also used to calculate
delta times which lead to a constant offset.
2020-05-11 02:04:40 +02:00
Robin Gareus f69a395893
Fix MTC slave port latency 2020-05-11 00:37:32 +02:00
Paul Davis 1e814d2573 remove debug output 2020-04-30 13:13:48 -06:00
Paul Davis 30a60f45df show MTC transport master latency when computed 2020-04-27 15:44:28 -06:00
Paul Davis c56e99cd09 nominal improvement for MTC master: use port latency to adjust sampletimes that MTC events "occured at" 2020-04-27 15:02:29 -06:00
Paul Davis ddf2c60c9a improve variable width and precision for MTC slave delta display 2020-03-23 18:33:45 -06:00
Paul Davis e6e0edbe90 fix condition under which out-of-window MTC should trigger locate 2020-03-20 17:38:38 -06:00
Paul Davis cf15b6ad7a prevent out-of-window MTC messages from moving transport if we're not using MTC
in 5.x, we would only run the MTC parsing code if slaved to MTC. That's no longer true in 6.0, and without
this change, MTC will cause a locate at startup
2020-03-13 13:52:38 -06:00
Paul Davis 3c00048b0c Session::request_locate() takes a tri-valued second argument for "roll-after-locate"
This allows callers to defer logic about auto-play/current rolling state and more to TransportFSM where it
can be cnentralized and is less ambiguous
2020-01-18 08:49:18 -07:00
Paul Davis 16c571c9b6 fix crash with -D slave caused by too-early use of a transport master's _port member 2019-11-15 16:04:58 -07:00
Paul Davis 0869f63866 transport master deletion is no longer in parallel with process() 2019-09-22 12:23:54 -06:00
Paul Davis bd229936ec add finite state machine to control/manage transport state 2019-09-17 18:26:03 -06:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Paul Davis 3cc3074dc7 use ::reset() not ::update() 2019-02-04 11:24:23 -07:00
Paul Davis 1be3301342 new approach to handling Transport Masters when engine is restarted
Trust that ::reset() works for all transport masters, and call it when engine is stopped. This way
the transport masters are ready to be called again as soon as the engine restarts.
2019-01-25 09:23:08 -07:00
Paul Davis 22061310c0 add new ::update_interval() method for transport masters, and use in shared ::speed_and_position() implementation 2018-10-04 00:42:14 -04:00
Paul Davis 1dc35d157e fix error introduced in MTC transport master 2018-10-04 00:42:14 -04:00
Paul Davis c4fcd0c268 consolidate all transport masters on a SafeTime object that is a member of the TransportMaster base class.
This seems to have broken some aspects of chasing/locking
2018-09-27 11:31:13 -04:00
Paul Davis 0f7123d33a more objectification for SafeTime 2018-09-27 11:31:13 -04:00
Paul Davis b6aefaf100 initial hacks towards a truly thread-safe SafeTime object, using boost::atomic 2018-09-27 11:31:13 -04:00
John Emmas a3a156520d Remove some namespace ambiguity
There are a couple of places where we're using both MIDI namespace as well as ARDOUR namespace (both of which declare 'pframes_t)
2018-09-22 08:48:41 +01:00
Paul Davis e6915e01de new transport slave/master implementation, libs/ edition 2018-09-18 19:06:04 -04: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
Robin Gareus 74e38365e9 Fix MTC slave implicit return on transport-stop
MTC returns not-locked (no flywheel) when the signal is lost, in which case
Session::follow_slave() jumps to no_roll and ignores the slave-position.
The MTC slave does explicitly request a transport-locate and transport-stop.

Yet, Session::realtime_stop() honors _requested_return_frame for whatever
reason
2017-01-10 10:39:22 +01:00
Robin Gareus 61c7af141d Clarify "frames" (video, timecode) vs "samples" (audio) 2016-12-08 12:45:44 +01:00
Paul Davis cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
Paul Davis 4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Paul Davis 16dccfcb8a Add some libardour support for indicating MTC active status.
The general design here is wrong, because it should be more general and cover all possible sync sources.
But it does work, it is used in Tracks, and my attempt to do it correctly revealed the problem to be
an EXTREMELY difficult design issue (as in: two weeks of work on it did not really solve the
fundamental issues with slave design).

So, here it is for now, c/o Grygorii
2015-06-29 14:18:12 -04:00
Tim Mayberry 9b5440ec03 Use PBD::pthread_name in MTC_Slave for portability 2013-12-02 21:21:54 +10:00
John Emmas cb18f914bd 'libs/ardour' - Further compiler specific changes 2013-09-18 12:28:08 +01:00
Paul Davis bb826f4bee incomplete merge of master into windows (requires upcoming changes to master to be complete) 2013-09-12 11:28:50 -04:00
Paul Davis a5a75d5e0d fixes to get MTC (and probably MIDI clock) slaving working again
incoming MIDI data has to be parsed EVERY process cycle, not just when Slave::speed_and_position() is called.
The private MIDI::Parser owned by the MTC and MClck slaves was irrelevant, since the port has its own.
See comments in midi_port.h on the strangled inheritance heirarchy.
2013-08-13 12:53:28 -04:00
Paul Davis a5a3f713d5 assorted extra debug output for MTC 2013-08-12 05:40:11 -04:00
Paul Davis ca76496ef3 more purging of JACK as an explicit name from libardour 2013-08-09 13:56:23 -04:00
Paul Davis 1ab61b8564 major redesign of MIDI port heirarchy and management (part 2) 2013-08-07 22:22:11 -04:00
John Emmas 490311bc08 'libs/ardour' - Main body of changes required for building with MSVC 2013-08-04 15:36:07 +01:00
Paul Davis 9ac6bb9bef part-way through getting the audioengine changes to compile 2013-07-24 19:29:45 -04:00
Paul Davis 3be0f0aa0b Use pthread_name instead of pthread_self for portability 2013-07-13 16:44:03 -04:00
Paul Davis 23bec25bf5 Remove non-portable and unnused header includes 2013-07-11 11:34:37 -04:00