diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-01 14:43:12 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-01 14:43:12 -0400 |
commit | 682ebad62bdc85df151ad0b81dc27cc9f3e71cec (patch) | |
tree | 3e283d18fa8609a1f98502a038b9388f8404285a /libs/ardour/ardour | |
parent | 18c68bfd12130b8a3e95c99d3c0472c8b7f377bc (diff) |
full compilation and linking (coding not finished, will not run)
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_backend.h | 15 | ||||
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 18 | ||||
-rw-r--r-- | libs/ardour/ardour/jack_audiobackend.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/jack_portengine.h | 25 | ||||
-rw-r--r-- | libs/ardour/ardour/port_engine.h | 21 | ||||
-rw-r--r-- | libs/ardour/ardour/port_manager.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/slave.h | 6 |
7 files changed, 52 insertions, 36 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h index 44525c8353..3b68432b6f 100644 --- a/libs/ardour/ardour/audio_backend.h +++ b/libs/ardour/ardour/audio_backend.h @@ -296,18 +296,17 @@ class AudioBackend { * It is extremely likely that any implementation will use a DLL, since * this function can be called from any thread, at any time, and must be * able to accurately determine the correct sample time. + * + * Can be called from any thread. */ virtual pframes_t sample_time () = 0; - /** return the time according to the sample clock in use when the current - * buffer process cycle began. - * - * Can ONLY be called from within a process() callback tree (which - * implies that it can only be called by a process thread) + /** Return the time according to the sample clock in use when the most + * recent buffer process cycle began. Can be called from any thread. */ virtual pframes_t sample_time_at_cycle_start () = 0; - /** return the time since the current buffer process cycle started, + /** Return the time since the current buffer process cycle started, * in samples, according to the sample clock in use. * * Can ONLY be called from within a process() callback tree (which @@ -315,7 +314,7 @@ class AudioBackend { */ virtual pframes_t samples_since_cycle_start () = 0; - /** return true if it possible to determine the offset in samples of the + /** Return true if it possible to determine the offset in samples of the * first video frame that starts within the current buffer process cycle, * measured from the first sample of the cycle. If returning true, * set @param offset to that offset. @@ -339,6 +338,8 @@ class AudioBackend { * when that function returns. */ virtual int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize) = 0; + + virtual void update_latencies () = 0; protected: AudioEngine& engine; diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 9e9da62ce0..0bbbe90ef4 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -108,6 +108,16 @@ public: bool is_realtime() const; bool connected() const; + int set_device_name (const std::string&); + int set_sample_rate (float); + int set_buffer_size (uint32_t); + int set_sample_format (SampleFormat); + int set_interleaved (bool yn); + int set_input_channels (uint32_t); + int set_output_channels (uint32_t); + int set_systemic_input_latency (uint32_t); + int set_systemic_output_latency (uint32_t); + /* END BACKEND PROXY API */ bool freewheeling() const { return _freewheeling; } @@ -115,7 +125,9 @@ public: Glib::Threads::Mutex& process_lock() { return _process_lock; } - int request_buffer_size (pframes_t); + int request_buffer_size (pframes_t samples) { + return set_buffer_size (samples); + } framecnt_t processed_frames() const { return _processed_frames; } @@ -165,10 +177,6 @@ public: PBD::Signal0<void> Running; PBD::Signal0<void> Stopped; - std::string make_port_name_relative (std::string) const; - std::string make_port_name_non_relative (std::string) const; - bool port_is_mine (const std::string&) const; - static AudioEngine* instance() { return _instance; } static void destroy(); void died (); diff --git a/libs/ardour/ardour/jack_audiobackend.h b/libs/ardour/ardour/jack_audiobackend.h index 0855b8e90f..7104b814c2 100644 --- a/libs/ardour/ardour/jack_audiobackend.h +++ b/libs/ardour/ardour/jack_audiobackend.h @@ -99,6 +99,8 @@ class JACKAudioBackend : public AudioBackend { int set_time_master (bool /*yn*/); bool get_sync_offset (pframes_t& /*offset*/) const; + void update_latencies (); + private: boost::shared_ptr<JackConnection> _jack_connection; //< shared with JACKPortEngine bool _running; diff --git a/libs/ardour/ardour/jack_portengine.h b/libs/ardour/ardour/jack_portengine.h index 80e34f3c92..bee87532d3 100644 --- a/libs/ardour/ardour/jack_portengine.h +++ b/libs/ardour/ardour/jack_portengine.h @@ -38,8 +38,8 @@ class JACKPortEngine : public PortEngine { public: JACKPortEngine (PortManager&, boost::shared_ptr<JackConnection>); + ~JACKPortEngine(); - bool connected() const; void* private_handle() const; const std::string& my_name() const; @@ -48,10 +48,6 @@ class JACKPortEngine : public PortEngine std::string get_port_name (PortHandle) const; PortHandle* get_port_by_name (const std::string&) const; - std::string make_port_name_relative (const std::string& name) const; - std::string make_port_name_non_relative (const std::string& name) const; - bool port_is_mine (const std::string& fullname) const; - int get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>&) const; DataType port_data_type (PortHandle) const; @@ -62,19 +58,16 @@ class JACKPortEngine : public PortEngine bool connected (PortHandle); bool connected_to (PortHandle, const std::string&); bool physically_connected (PortHandle); - int get_connections (PortHandle, std::vector<std::string>&); - int connect (PortHandle, const std::string&); int disconnect (PortHandle, const std::string&); int disconnect_all (PortHandle); - int connect (const std::string& src, const std::string& dst); int disconnect (const std::string& src, const std::string& dst); /* MIDI */ - void midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index); + int midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index); int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size); uint32_t get_midi_event_count (void* port_buffer); void midi_clear (void* port_buffer); @@ -91,7 +84,8 @@ class JACKPortEngine : public PortEngine void set_latency_range (PortHandle, bool for_playback, LatencyRange); LatencyRange get_latency_range (PortHandle, bool for_playback); - LatencyRange get_connected_latency_range (PortHandle, int dir); + + /* Physical ports */ bool port_is_physical (PortHandle) const; void get_physical_outputs (DataType type, std::vector<std::string>&); @@ -99,9 +93,13 @@ class JACKPortEngine : public PortEngine ChanCount n_physical_outputs () const; ChanCount n_physical_inputs () const; + /* Getting access to the data buffer for a port */ + void* get_buffer (PortHandle, pframes_t); - framecnt_t last_frame_time () const; + /* Miscellany */ + + pframes_t sample_time_at_cycle_start (); private: boost::shared_ptr<JackConnection> _jack_connection; @@ -110,10 +108,11 @@ class JACKPortEngine : public PortEngine static void _registration_callback (jack_port_id_t, int, void *); static void _connect_callback (jack_port_id_t, jack_port_id_t, int, void *); - int graph_order_callback (); - void connect_callback (jack_port_id_t, jack_port_id_t, int); + ChanCount n_physical (unsigned long flags) const; + void get_physical (DataType type, unsigned long flags, std::vector<std::string>& phy) const; + }; } // namespace diff --git a/libs/ardour/ardour/port_engine.h b/libs/ardour/ardour/port_engine.h index 5992a48a85..e63c52630d 100644 --- a/libs/ardour/ardour/port_engine.h +++ b/libs/ardour/ardour/port_engine.h @@ -77,7 +77,7 @@ class PortManager; class PortEngine { public: PortEngine (PortManager& pm) : manager (pm) {} - virtual ~PortEngine(); + virtual ~PortEngine() {} /* We use void* here so that the API can be defined for any implementation. * @@ -89,7 +89,6 @@ class PortEngine { typedef void* PortHandle; - virtual bool connected() const = 0; virtual void* private_handle() const = 0; virtual const std::string& my_name() const = 0; @@ -125,10 +124,10 @@ class PortEngine { /* MIDI */ - virtual void midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index) = 0; + virtual int midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index) = 0; virtual int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size) = 0; - virtual uint32_t get_midi_event_count (void* port_buffer); - virtual void midi_clear (void* port_buffer); + virtual uint32_t get_midi_event_count (void* port_buffer) = 0; + virtual void midi_clear (void* port_buffer) = 0; /* Monitoring */ @@ -142,7 +141,6 @@ class PortEngine { virtual void set_latency_range (PortHandle, bool for_playback, LatencyRange) = 0; virtual LatencyRange get_latency_range (PortHandle, bool for_playback) = 0; - virtual LatencyRange get_connected_latency_range (PortHandle, int dir) = 0; /* Discovering physical ports */ @@ -158,7 +156,16 @@ class PortEngine { virtual void* get_buffer (PortHandle, pframes_t) = 0; - virtual framecnt_t last_frame_time() const = 0; + /* MIDI ports (the ones in libmidi++) need this to be able to correctly + * schedule MIDI events within their buffers. It is a bit odd that we + * expose this here, because it is also exposed by AudioBackend, but they + * only have access to a PortEngine object, not an AudioBackend. + * + * Return the time according to the sample clock in use when the current + * buffer process cycle began. + * + */ + virtual pframes_t sample_time_at_cycle_start () = 0; protected: PortManager& manager; diff --git a/libs/ardour/ardour/port_manager.h b/libs/ardour/ardour/port_manager.h index 5838ac66af..d88143d110 100644 --- a/libs/ardour/ardour/port_manager.h +++ b/libs/ardour/ardour/port_manager.h @@ -59,7 +59,6 @@ class PortManager int connect (const std::string& source, const std::string& destination); int disconnect (const std::string& source, const std::string& destination); int disconnect (boost::shared_ptr<Port>); - bool has_connections (const std::string&); int reestablish_ports (); int reconnect_ports (); diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 88c9a09be7..4408da2d25 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -48,6 +48,7 @@ namespace ARDOUR { class TempoMap; class Session; +class AudioEngine; /** * @class Slave @@ -492,7 +493,7 @@ class MIDIClock_Slave : public Slave { class JACK_Slave : public Slave { public: - JACK_Slave (jack_client_t*); + JACK_Slave (AudioEngine&); ~JACK_Slave (); bool speed_and_position (double& speed, framepos_t& pos); @@ -502,11 +503,10 @@ class JACK_Slave : public Slave bool ok() const; framecnt_t resolution () const { return 1; } bool requires_seekahead () const { return false; } - void reset_client (jack_client_t* jack); bool is_always_synced() const { return true; } private: - jack_client_t* jack; + AudioEngine& engine; double speed; bool _starting; }; |