diff options
Diffstat (limited to 'src/server/JackDriver.hpp')
-rw-r--r-- | src/server/JackDriver.hpp | 71 |
1 files changed, 31 insertions, 40 deletions
diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp index 8bb7cff3..4c8e779e 100644 --- a/src/server/JackDriver.hpp +++ b/src/server/JackDriver.hpp @@ -18,43 +18,35 @@ #define INGEN_ENGINE_JACKAUDIODRIVER_HPP #include "Driver.hpp" -#include "EnginePort.hpp" // IWYU pragma: keep +#include "EnginePort.hpp" #include "types.hpp" -#include "ingen/URI.hpp" -#include "ingen/memory.hpp" // IWYU pragma: keep -#include "lv2/atom/forge.h" -#include "raul/Semaphore.hpp" +#include <ingen/URI.hpp> +#include <ingen/memory.hpp> +#include <lv2/atom/forge.h> +#include <raul/Semaphore.hpp> +#include <boost/intrusive/options.hpp> #include <boost/intrusive/slist.hpp> -#include <jack/jack.h> -#include <jack/thread.h> +#include <jack/transport.h> // IWYU pragma: keep #include <jack/types.h> +#include <jack/thread.h> + #include <atomic> -#include <cstddef> #include <cstdint> #include <exception> #include <memory> #include <string> -namespace raul { -class Path; -} // namespace raul - -namespace boost::intrusive { -template <bool Enabled> struct cache_last; -} // namespace boost::intrusive - namespace ingen { class Atom; namespace server { -class Buffer; -class DuplexPort; class Engine; +class FrameTimer; class RunContext; /** The Jack Driver. @@ -103,12 +95,10 @@ public: jack_client_t* jack_client() const { return _client; } SampleCount block_length() const override { return _block_length; } - size_t seq_size() const override { return _seq_size; } + uint32_t seq_size() const override { return _seq_size; } SampleCount sample_rate() const override { return _sample_rate; } - SampleCount frame_time() const override { - return _client ? jack_frame_time(_client) : 0; - } + SampleCount frame_time() const override; class PortRegistrationFailedException : public std::exception {}; @@ -121,7 +111,7 @@ private: // Static JACK callbacks which call the non-static callbacks (methods) static void shutdown_cb(void* const jack_driver) { - return static_cast<JackDriver*>(jack_driver)->_shutdown_cb(); + static_cast<JackDriver*>(jack_driver)->_shutdown_cb(); } static int process_cb(jack_nframes_t nframes, void* const jack_driver) { @@ -152,23 +142,24 @@ protected: using AudioBufPtr = std::unique_ptr<float, FreeDeleter<float>>; - Engine& _engine; - Ports _ports; - AudioBufPtr _fallback_buffer; - LV2_Atom_Forge _forge; - raul::Semaphore _sem{0}; - std::atomic<bool> _flag{false}; - jack_client_t* _client{nullptr}; - jack_nframes_t _block_length{0}; - size_t _seq_size{0}; - jack_nframes_t _sample_rate{0}; - uint32_t _midi_event_type; - bool _is_activated{false}; - jack_position_t _position{}; - jack_transport_state_t _transport_state{}; - double _old_bpm{120.0}; - jack_nframes_t _old_frame{0}; - bool _old_rolling{false}; + Engine& _engine; + Ports _ports; + AudioBufPtr _fallback_buffer; + LV2_Atom_Forge _forge; + raul::Semaphore _sem{0}; + std::unique_ptr<FrameTimer> _timer; + std::atomic<bool> _flag{false}; + jack_client_t* _client{nullptr}; + jack_nframes_t _block_length{0}; + uint32_t _seq_size{0}; + jack_nframes_t _sample_rate{0}; + uint32_t _midi_event_type; + bool _is_activated{false}; + jack_position_t _position{}; + jack_transport_state_t _transport_state{}; + double _old_bpm{120.0}; + jack_nframes_t _old_frame{0}; + bool _old_rolling{false}; }; } // namespace server |