Ardour
9.0-pre0-582-g084a23a80d
|
The TransportMaster interface can be used to sync ARDOURs tempo to an external source like MTC, MIDI Clock, etc. as well as a single internal pseudo master we call "UI" because it is controlled from any of the user interfaces for Ardour (GUI, control surfaces, OSC, etc.) More...
#include <transport_master.h>
Public Member Functions | |
TransportMaster (SyncSource t, std::string const &name) | |
virtual | ~TransportMaster () |
virtual void | pre_process (pframes_t nframes, samplepos_t now, std::optional< samplepos_t >)=0 |
virtual bool | speed_and_position (double &speed, samplepos_t &position, samplepos_t &lp, samplepos_t &when, samplepos_t now) |
virtual void | reset (bool with_position)=0 |
virtual bool | locked () const =0 |
virtual bool | ok () const =0 |
virtual bool | usable () const |
virtual bool | starting () const |
virtual samplecnt_t | resolution () const =0 |
virtual samplecnt_t | update_interval () const =0 |
virtual bool | requires_seekahead () const =0 |
virtual samplecnt_t | seekahead_distance () const |
virtual bool | sample_clock_synced () const |
virtual void | set_sample_clock_synced (bool) |
virtual std::string | delta_string () const |
sampleoffset_t | current_delta () const |
virtual std::string | position_string () const =0 |
virtual bool | can_loop () const |
virtual Location * | loop_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) |
XMLNode & | get_state () const |
virtual void | set_session (Session *) |
std::shared_ptr< Port > | port () const |
bool | check_collect () |
virtual void | set_collect (bool) |
bool | collect () const |
virtual void | init ()=0 |
virtual void | check_backend () |
virtual bool | allow_request (TransportRequestSource, TransportRequestType) 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 () |
virtual void | create_port ()=0 |
Public Member Functions inherited from PBD::Stateful | |
Stateful () | |
virtual | ~Stateful () |
virtual bool | apply_change (PropertyBase const &) |
PropertyChange | apply_changes (PropertyList const &) |
const OwnedPropertyList & | properties () const |
void | add_property (PropertyBase &s) |
void | add_extra_xml (XMLNode &) |
XMLNode * | extra_xml (const std::string &str, bool add_if_missing=false) |
void | save_extra_xml (const XMLNode &) |
const PBD::ID & | id () const |
bool | set_id (const XMLNode &) |
void | set_id (const std::string &) |
void | reset_id () |
void | clear_changes () |
virtual void | clear_owned_changes () |
PropertyList * | get_changes_as_properties (PBD::Command *) const |
virtual void | rdiff (std::vector< PBD::Command * > &) const |
bool | changed () const |
virtual PropertyList * | property_factory (const XMLNode &) const |
virtual void | suspend_property_changes () |
virtual void | resume_property_changes () |
bool | property_changes_suspended () const |
Static Public Member Functions | |
static std::shared_ptr< TransportMaster > | factory (SyncSource, std::string const &, bool removeable) |
static std::shared_ptr< TransportMaster > | factory (XMLNode const &) |
static void | make_property_quarks () |
Static Public Attributes | |
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 | |
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) |
XMLNode * | instant_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 | |
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 |
Additional Inherited Members | |
Public Attributes inherited from PBD::Stateful | |
PBD::Signal< void(const PropertyChange &)> | PropertyChanged |
The TransportMaster interface can be used to sync ARDOURs tempo to an external source like MTC, MIDI Clock, etc. as well as a single internal pseudo master we call "UI" because it is controlled from any of the user interfaces for Ardour (GUI, control surfaces, OSC, etc.)
Definition at line 146 of file transport_master.h.
ARDOUR::TransportMaster::TransportMaster | ( | SyncSource | t, |
std::string const & | name | ||
) |
|
virtual |
|
virtual |
Reimplemented in ARDOUR::Engine_TransportMaster.
std::string ARDOUR::TransportMaster::allowed_request_string | ( | ) | const |
|
inlinevirtual |
Definition at line 316 of file transport_master.h.
|
inlinevirtual |
Reimplemented in ARDOUR::Engine_TransportMaster.
Definition at line 381 of file transport_master.h.
bool ARDOUR::TransportMaster::check_collect | ( | ) |
|
inline |
Definition at line 370 of file transport_master.h.
void ARDOUR::TransportMaster::connect_port_using_state | ( | ) |
|
protectedvirtual |
Reimplemented in ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
pure virtual |
|
inline |
Definition at line 304 of file transport_master.h.
|
inlinevirtual |
Reimplemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
Definition at line 299 of file transport_master.h.
std::string ARDOUR::TransportMaster::display_name | ( | bool | sh = true | ) | const |
|
static |
|
static |
|
protectedvirtual |
|
virtual |
Implements PBD::Stateful.
|
inline |
Definition at line 325 of file transport_master.h.
|
pure virtual |
|
pure virtual |
reports to ARDOUR whether the TransportMaster is currently synced to its external time source.
Implemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
inlinevirtual |
Definition at line 321 of file transport_master.h.
|
static |
|
inline |
Definition at line 349 of file transport_master.h.
|
pure virtual |
reports to ARDOUR whether the slave is in a sane state
Implemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
inline |
Definition at line 363 of file transport_master.h.
|
pure virtual |
|
pure virtual |
|
protectedvirtual |
Reimplemented in ARDOUR::TimecodeTransportMaster.
|
inline |
Definition at line 395 of file transport_master.h.
|
inline |
Definition at line 385 of file transport_master.h.
|
inline |
Definition at line 334 of file transport_master.h.
|
pure virtual |
Implemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
pure virtual |
|
pure virtual |
Implemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
inlinevirtual |
Reimplemented in ARDOUR::Engine_TransportMaster.
Definition at line 290 of file transport_master.h.
|
inlinevirtual |
Reimplemented in ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
Definition at line 281 of file transport_master.h.
|
virtual |
void ARDOUR::TransportMaster::set_name | ( | std::string const & | ) |
|
inline |
Definition at line 399 of file transport_master.h.
void ARDOUR::TransportMaster::set_request_mask | ( | TransportRequestType | ) |
|
virtual |
Reimplemented in ARDOUR::LTC_TransportMaster.
|
virtual |
Reimplemented in ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
virtual |
Implements PBD::Stateful.
|
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:
After the method call the following postconditions should be met:
speed | - The transport speed requested |
position | - The transport position requested |
lp | last position (used for flywheel) |
when | last timestamp (used for flywheel) |
now | monotonic sample time |
Reimplemented in ARDOUR::Engine_TransportMaster.
|
inlinevirtual |
reports to ARDOUR whether the slave is in the process of starting to roll
Reimplemented in ARDOUR::Engine_TransportMaster.
Definition at line 251 of file transport_master.h.
|
inline |
Definition at line 330 of file transport_master.h.
|
virtual |
Reimplemented in ARDOUR::MIDIClock_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
pure virtual |
Implemented in ARDOUR::Engine_TransportMaster, ARDOUR::MIDIClock_TransportMaster, ARDOUR::LTC_TransportMaster, and ARDOUR::MTC_TransportMaster.
|
inlinevirtual |
reports to ARDOUR whether it is possible to use this slave
Only the JACK ("Engine") slave is ever likely to return false, if JACK is not being used for the Audio/MIDI backend.
Reimplemented in ARDOUR::Engine_TransportMaster.
Definition at line 240 of file transport_master.h.
|
protected |
Definition at line 419 of file transport_master.h.
|
protected |
Definition at line 420 of file transport_master.h.
|
protected |
Definition at line 414 of file transport_master.h.
|
protected |
Definition at line 412 of file transport_master.h.
|
protected |
Definition at line 415 of file transport_master.h.
|
protected |
Definition at line 434 of file transport_master.h.
|
protected |
Definition at line 416 of file transport_master.h.
|
protected |
Definition at line 417 of file transport_master.h.
|
protected |
Definition at line 418 of file transport_master.h.
|
protected |
Definition at line 413 of file transport_master.h.
|
protected |
Definition at line 411 of file transport_master.h.
|
protected |
Definition at line 432 of file transport_master.h.
|
protected |
Definition at line 441 of file transport_master.h.
|
protected |
Definition at line 432 of file transport_master.h.
|
protected |
Definition at line 422 of file transport_master.h.
|
protected |
Definition at line 427 of file transport_master.h.
|
protected |
Definition at line 431 of file transport_master.h.
|
protected |
Definition at line 440 of file transport_master.h.
|
mutableprotected |
Definition at line 436 of file transport_master.h.
|
static |
Definition at line 358 of file transport_master.h.
|
protected |
Definition at line 429 of file transport_master.h.
|
protected |
Definition at line 430 of file transport_master.h.
|
protected |
Definition at line 426 of file transport_master.h.