X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Faudioengine.h;h=e1d5e50cc22f96a73190fde0d34f45f6f071639f;hb=44fd104ada0fbd8b76d34150e941d85d6de6f81b;hp=a95bc0472bc83640f74be13dda2ea648505e9b31;hpb=a8da89d745c6a7e7d4c20dfcfb16b2537d767428;p=ardour.git diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index a95bc0472b..e1d5e50cc2 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -42,6 +42,7 @@ namespace ARDOUR { class Session; class Port; +class InternalPort; class AudioEngine : public sigc::trackable { @@ -51,7 +52,7 @@ class AudioEngine : public sigc::trackable AudioEngine (std::string client_name); virtual ~AudioEngine (); - jack_client_t* jack() const { return _jack; } + jack_client_t* jack() const; bool connected() const { return _jack != 0; } bool is_realtime () const; @@ -105,7 +106,13 @@ class AudioEngine : public sigc::trackable class PortRegistrationFailure : public std::exception { public: - virtual const char *what() const throw() { return "failed port registration"; } + PortRegistrationFailure (const char* why = "") { + reason = why; + } + virtual const char *what() const throw() { return reason; } + + private: + const char* reason; }; class NoBackendAvailable : public std::exception { @@ -113,8 +120,8 @@ class AudioEngine : public sigc::trackable virtual const char *what() const throw() { return "could not connect to engine backend"; } }; - Port *register_input_port (DataType type, const std::string& portname); - Port *register_output_port (DataType type, const std::string& portname); + Port *register_input_port (DataType, const std::string& portname, bool publish); + Port *register_output_port (DataType, const std::string& portname, bool publish); int unregister_port (Port &); int connect (const std::string& source, const std::string& destination); @@ -126,6 +133,8 @@ class AudioEngine : public sigc::trackable uint32_t n_physical_outputs () const; uint32_t n_physical_inputs () const; + bool can_request_hardware_monitoring (); + void get_physical_outputs (std::vector&); void get_physical_inputs (std::vector&); @@ -139,10 +148,11 @@ class AudioEngine : public sigc::trackable nframes_t get_port_total_latency (const Port&); void update_total_latencies (); + void update_total_latency (const Port&); /** Caller may not delete the object pointed to by the return value */ - Port *get_port_by_name (const std::string& name, bool keep = true); + Port *get_port_by_name (const std::string& name, bool keep = true) const; enum TransportState { TransportStopped = JackTransportStopped, @@ -194,30 +204,37 @@ class AudioEngine : public sigc::trackable std::string make_port_name_non_relative (std::string); private: - ARDOUR::Session *session; - jack_client_t *_jack; - std::string jack_client_name; - Glib::Mutex _process_lock; - Glib::Cond session_removed; - bool session_remove_pending; - bool _running; - bool _has_run; - nframes_t _buffer_size; - nframes_t _frame_rate; - nframes_t monitor_check_interval; - nframes_t last_monitor_check; - nframes_t _processed_frames; - bool _freewheeling; - bool _freewheel_thread_registered; - sigc::slot freewheel_action; - bool reconnect_on_halt; - int _usecs_per_cycle; + ARDOUR::Session *session; + jack_client_t *_jack; + std::string jack_client_name; + mutable Glib::Mutex _process_lock; + Glib::Cond session_removed; + bool session_remove_pending; + bool _running; + bool _has_run; + nframes_t _buffer_size; + nframes_t _frame_rate; + /// number of frames between each check for changes in monitor input + nframes_t monitor_check_interval; + /// time of the last monitor check in frames + nframes_t last_monitor_check; + /// the number of frames processed since start() was called + nframes_t _processed_frames; + bool _freewheeling; + bool _freewheel_thread_registered; + sigc::slot freewheel_action; + bool reconnect_on_halt; + int _usecs_per_cycle; SerializedRCUManager ports; + Port *register_port (DataType type, const std::string& portname, bool input, bool publish); + int process_callback (nframes_t nframes); void remove_all_ports (); + Port* get_port (const std::string& short_name); + typedef std::pair PortConnection; typedef std::list PortConnections; @@ -226,6 +243,8 @@ class AudioEngine : public sigc::trackable std::string get_nth_physical (DataType type, uint32_t n, int flags); + void port_registration_failure (const std::string& portname); + static int _xrun_callback (void *arg); static int _graph_order_callback (void *arg); static int _process_callback (nframes_t nframes, void *arg);