Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::Engine_TransportMaster Class Reference

#include <transport_master.h>

Inheritance diagram for ARDOUR::Engine_TransportMaster:
[legend]

Public Member Functions

 Engine_TransportMaster (AudioEngine &)
 
 ~Engine_TransportMaster ()
 
void pre_process (pframes_t nframes, samplepos_t now, std::optional< samplepos_t >)
 
bool speed_and_position (double &speed, samplepos_t &pos, samplepos_t &, samplepos_t &, samplepos_t)
 
bool starting () const
 
void reset (bool with_position)
 
bool locked () const
 
bool ok () const
 
bool usable () const
 
samplecnt_t update_interval () const
 
samplecnt_t resolution () const
 
bool requires_seekahead () const
 
bool sample_clock_synced () const
 
void init ()
 
void check_backend ()
 
bool allow_request (TransportRequestSource, TransportRequestType) const
 
std::string position_string () const
 
std::string delta_string () const
 
void create_port ()
 
- Public Member Functions inherited from ARDOUR::TransportMaster
 TransportMaster (SyncSource t, std::string const &name)
 
virtual ~TransportMaster ()
 
virtual samplecnt_t seekahead_distance () const
 
virtual void set_sample_clock_synced (bool)
 
sampleoffset_t current_delta () const
 
virtual bool can_loop () const
 
virtual Locationloop_location () const
 
bool has_loop () const
 
SyncSource type () const
 
TransportRequestSource request_type () const
 
std::string name () const
 
void set_name (std::string const &)
 
int set_state (XMLNode const &, int)
 
XMLNodeget_state () const
 
virtual void set_session (Session *)
 
std::shared_ptr< Portport () const
 
bool check_collect ()
 
virtual void set_collect (bool)
 
bool collect () const
 
std::string allowed_request_string () const
 
TransportRequestType request_mask () const
 
void set_request_mask (TransportRequestType)
 
bool removeable () const
 
void set_removeable (bool yn)
 
std::string display_name (bool sh=true) const
 
virtual void unregister_port ()
 
void connect_port_using_state ()
 
- Public Member Functions inherited from PBD::Stateful
 Stateful ()
 
virtual ~Stateful ()
 
virtual bool apply_change (PropertyBase const &)
 
PropertyChange apply_changes (PropertyList const &)
 
const OwnedPropertyListproperties () const
 
void add_property (PropertyBase &s)
 
void add_extra_xml (XMLNode &)
 
XMLNodeextra_xml (const std::string &str, bool add_if_missing=false)
 
void save_extra_xml (const XMLNode &)
 
const PBD::IDid () const
 
bool set_id (const XMLNode &)
 
void set_id (const std::string &)
 
void reset_id ()
 
void clear_changes ()
 
virtual void clear_owned_changes ()
 
PropertyListget_changes_as_properties (PBD::Command *) const
 
virtual void rdiff (std::vector< PBD::Command * > &) const
 
bool changed () const
 
virtual PropertyListproperty_factory (const XMLNode &) const
 
virtual void suspend_property_changes ()
 
virtual void resume_property_changes ()
 
bool property_changes_suspended () const
 

Private Attributes

AudioEngineengine
 
bool _starting
 

Additional Inherited Members

- Static Public Member Functions inherited from ARDOUR::TransportMaster
static std::shared_ptr< TransportMasterfactory (SyncSource, std::string const &, bool removeable)
 
static std::shared_ptr< TransportMasterfactory (XMLNode const &)
 
static void make_property_quarks ()
 
- Public Attributes inherited from PBD::Stateful
PBD::Signal< void(const PropertyChange &)> PropertyChanged
 
- Static Public Attributes inherited from ARDOUR::TransportMaster
static const std::string state_node_name
 
- Static Public Attributes inherited from PBD::Stateful
static int current_state_version
 
static int loading_state_version
 
- Protected Member Functions inherited from ARDOUR::TransportMaster
virtual void connection_handler (std::weak_ptr< ARDOUR::Port >, std::string name1, std::weak_ptr< ARDOUR::Port >, std::string name2, bool yn)
 
virtual void register_properties ()
 
virtual std::string format_delta_time (sampleoffset_t) const
 
- Protected Member Functions inherited from PBD::Stateful
void add_instant_xml (XMLNode &, const std::string &directory_path)
 
XMLNodeinstant_xml (const std::string &str, const std::string &directory_path)
 
void add_properties (XMLNode &) const
 
PropertyChange set_values (XMLNode const &)
 
virtual void post_set (const PropertyChange &)
 
virtual void send_change (const PropertyChange &)
 
virtual void mid_thaw (const PropertyChange &)
 
bool regenerate_xml_or_string_ids () const
 
- Protected Attributes inherited from ARDOUR::TransportMaster
SyncSource _type
 
PBD::Property< std::string > _name
 
Session_session
 
sampleoffset_t _current_delta
 
bool _pending_collect
 
bool _removeable
 
PBD::Property< TransportRequestType_request_mask
 
PBD::Property< bool > _sclock_synced
 
PBD::Property< bool > _collect
 
PBD::Property< bool > _connected
 
SafeTime current
 
int transport_direction
 
int dll_initstate
 
double t0
 
double t1
 
double e2
 
double b
 
double c
 
std::shared_ptr< Port_port
 
XMLNode port_node
 
PBD::ScopedConnection port_connection
 
PBD::ScopedConnection backend_connection
 
- Protected Attributes inherited from PBD::Stateful
XMLNode_extra_xml
 
XMLNode_instant_xml
 
PBD::PropertyChange _pending_changed
 
Glib::Threads::Mutex _lock
 
std::string _xml_node_name
 name of node to use for this object in XML More...
 
OwnedPropertyList_properties
 

Detailed Description

Definition at line 734 of file transport_master.h.

Constructor & Destructor Documentation

◆ Engine_TransportMaster()

ARDOUR::Engine_TransportMaster::Engine_TransportMaster ( AudioEngine )

◆ ~Engine_TransportMaster()

ARDOUR::Engine_TransportMaster::~Engine_TransportMaster ( )

Member Function Documentation

◆ allow_request()

bool ARDOUR::Engine_TransportMaster::allow_request ( TransportRequestSource  ,
TransportRequestType   
) const
virtual

Reimplemented from ARDOUR::TransportMaster.

◆ check_backend()

void ARDOUR::Engine_TransportMaster::check_backend ( )
virtual

Reimplemented from ARDOUR::TransportMaster.

◆ create_port()

void ARDOUR::Engine_TransportMaster::create_port ( )
inlinevirtual

Implements ARDOUR::TransportMaster.

Definition at line 771 of file transport_master.h.

◆ delta_string()

std::string ARDOUR::Engine_TransportMaster::delta_string ( ) const
virtual
Returns
- current time-delta between engine and sync-source

Reimplemented from ARDOUR::TransportMaster.

◆ init()

void ARDOUR::Engine_TransportMaster::init ( )
virtual

◆ locked()

bool ARDOUR::Engine_TransportMaster::locked ( ) const
virtual

reports to ARDOUR whether the TransportMaster is currently synced to its external time source.

Returns
- when returning false, the transport will stop rolling

Implements ARDOUR::TransportMaster.

◆ ok()

bool ARDOUR::Engine_TransportMaster::ok ( ) const
virtual

reports to ARDOUR whether the slave is in a sane state

Returns
- when returning false, the transport will be stopped and the slave disconnected from ARDOUR.

Implements ARDOUR::TransportMaster.

◆ position_string()

std::string ARDOUR::Engine_TransportMaster::position_string ( ) const
virtual

◆ pre_process()

void ARDOUR::Engine_TransportMaster::pre_process ( pframes_t  nframes,
samplepos_t  now,
std::optional< samplepos_t  
)
virtual

◆ requires_seekahead()

bool ARDOUR::Engine_TransportMaster::requires_seekahead ( ) const
inlinevirtual
Returns
- when returning true, ARDOUR will wait for seekahead_distance() before transport starts rolling

Implements ARDOUR::TransportMaster.

Definition at line 756 of file transport_master.h.

◆ reset()

void ARDOUR::Engine_TransportMaster::reset ( bool  with_position)
virtual

◆ resolution()

samplecnt_t ARDOUR::Engine_TransportMaster::resolution ( ) const
inlinevirtual
Returns
- the timing resolution of the TransportMaster - If the distance of ARDOURs transport to the slave becomes greater than the resolution, sound will stop

Implements ARDOUR::TransportMaster.

Definition at line 752 of file transport_master.h.

◆ sample_clock_synced()

bool ARDOUR::Engine_TransportMaster::sample_clock_synced ( ) const
inlinevirtual
Returns
- when returning true, ARDOUR will use transport speed 1.0 no matter what the slave returns

Reimplemented from ARDOUR::TransportMaster.

Definition at line 760 of file transport_master.h.

◆ speed_and_position()

bool ARDOUR::Engine_TransportMaster::speed_and_position ( double &  speed,
samplepos_t position,
samplepos_t lp,
samplepos_t when,
samplepos_t  now 
)
virtual

This is the most important function to implement: Each process cycle, Session::follow_slave will call this method. and after the method call they should

Session::follow_slave will then try to follow the given position using a delay locked loop (DLL), starting with the first given transport speed. If the values of speed and position contradict each other, ARDOUR will always follow the position and disregard the speed. Although, a correct speed is important so that ARDOUR can sync to the master time source quickly.

For background information on delay locked loops, see http://www.kokkinizita.net/papers/usingdll.pdf

The method has the following precondition:

  • TransportMaster::ok() should return true, otherwise playback will stop immediately and the method will not be called
  • when the references speed and position are passed into the TransportMaster they are uninitialized

After the method call the following postconditions should be met:

  • The first position value on transport start should be 0, otherwise ARDOUR will try to locate to the new position rather than move to it
  • the references speed and position should be assigned to the TransportMasters current requested transport speed and transport position.
  • TransportMaster::resolution() should be greater than the maximum distance of ARDOURs transport position to the slaves requested transport position.
  • TransportMaster::locked() should return true, otherwise Session::no_roll will be called
  • TransportMaster::starting() should be false, otherwise the transport will not move until it becomes true
Parameters
speed- The transport speed requested
position- The transport position requested
lplast position (used for flywheel)
whenlast timestamp (used for flywheel)
nowmonotonic sample time
Returns
- The return value is currently ignored (see Session::follow_slave)

Reimplemented from ARDOUR::TransportMaster.

◆ starting()

bool ARDOUR::Engine_TransportMaster::starting ( ) const
inlinevirtual

reports to ARDOUR whether the slave is in the process of starting to roll

Returns
- when returning false, transport will not move until this method returns true

Reimplemented from ARDOUR::TransportMaster.

Definition at line 743 of file transport_master.h.

◆ update_interval()

samplecnt_t ARDOUR::Engine_TransportMaster::update_interval ( ) const
virtual
Returns
- the expected update interval for the data source used by this transport master. Even if the data is effectively continuous, this number indicates how long it is between changes to the known position of the master.

Implements ARDOUR::TransportMaster.

◆ usable()

bool ARDOUR::Engine_TransportMaster::usable ( ) const
virtual

reports to ARDOUR whether it is possible to use this slave

Returns
- true if the slave can be used.

Only the JACK ("Engine") slave is ever likely to return false, if JACK is not being used for the Audio/MIDI backend.

Reimplemented from ARDOUR::TransportMaster.

Member Data Documentation

◆ _starting

bool ARDOUR::Engine_TransportMaster::_starting
private

Definition at line 775 of file transport_master.h.

◆ engine

AudioEngine& ARDOUR::Engine_TransportMaster::engine
private

Definition at line 774 of file transport_master.h.


The documentation for this class was generated from the following file: