diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-04 14:03:19 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-04 14:03:19 -0400 |
commit | 7218bd91de3b69032e515617449702f368db59d2 (patch) | |
tree | cd7baa12fd44ff005717975a61b4b9592acc3098 /libs/ardour/ardour | |
parent | 333a3c9d02ed7ff32846a687a77a09181163eeae (diff) |
start work on the changes to EngineControl (dialog) to integrate with new backend design, and add "requires-driver" concept to AudioBackend to handle JACK specifically
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_backend.h | 31 | ||||
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 10 | ||||
-rw-r--r-- | libs/ardour/ardour/jack_audiobackend.h | 6 |
3 files changed, 37 insertions, 10 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h index 18c8cb8931..08dd7fb0b5 100644 --- a/libs/ardour/ardour/audio_backend.h +++ b/libs/ardour/ardour/audio_backend.h @@ -68,6 +68,33 @@ class AudioBackend { /* Discovering devices and parameters */ + /** Return true if this backend requires the selection of a "driver" + * before any device can be selected. Return false otherwise. + * + * Intended mainly to differentiate between meta-APIs like JACK + * which can still expose different backends (such as ALSA or CoreAudio + * or FFADO or netjack) and those like ASIO or CoreAudio which + * do not. + */ + virtual bool requires_driver_selection() const { return false; } + + /** If the return value of requires_driver_selection() is true, + * then this function can return the list of known driver names. + * + * If the return value of requires_driver_selection() is false, + * then this function should not be called. If it is called + * its return value is an empty vector of strings. + */ + virtual std::vector<std::string> enumerate_drivers() const { return std::vector<std::string>(); } + + /** Returns zero if the backend can successfully use @param name as the + * driver, non-zero otherwise. + * + * Should not be used unless the backend returns true from + * requires_driver_selection() + */ + virtual int set_driver (const std::string& /*drivername*/) { return 0; } + /** Returns a collection of strings identifying devices known * to this backend. Any of these strings may be used to identify a * device in other calls to the backend, though any of them may become @@ -358,8 +385,8 @@ struct AudioBackendInfo { * configured and does not need (re)configuration in order * to be usable. Return false otherwise. * - * Note that this may return true if (re)configuration is possible, - * but not required. + * Note that this may return true if (re)configuration, even though + * not currently required, is still possible. */ bool (*already_configured)(); }; diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 5046206542..6fb13b7ae0 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -74,7 +74,8 @@ public: int discover_backends(); std::vector<const AudioBackendInfo*> available_backends() const; std::string current_backend_name () const; - int set_backend (const std::string&, const std::string& arg1, const std::string& arg2); + boost::shared_ptr<AudioBackend> set_backend (const std::string&, const std::string& arg1, const std::string& arg2); + boost::shared_ptr<AudioBackend> current_backend() const { return _backend; } bool setup_required () const; ProcessThread* main_thread() const { return _main_thread; } @@ -172,13 +173,6 @@ public: PBD::Signal0<void> Running; PBD::Signal0<void> Stopped; - /* these two are emitted as we create backends that - can actually be used to do stuff (e.g. register ports) - */ - - PBD::Signal0<void> BackendAvailable; - PBD::Signal0<void> BackendRemoved; - 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 4fef602119..59b5b88105 100644 --- a/libs/ardour/ardour/jack_audiobackend.h +++ b/libs/ardour/ardour/jack_audiobackend.h @@ -49,7 +49,12 @@ class JACKAudioBackend : public AudioBackend { bool connected() const; bool is_realtime () const; + bool requires_driver_selection() const; + std::vector<std::string> enumerate_drivers () const; + int set_driver (const std::string&); + std::vector<std::string> enumerate_devices () const; + std::vector<float> available_sample_rates (const std::string& device) const; std::vector<uint32_t> available_buffer_sizes (const std::string& device) const; uint32_t available_input_channel_count (const std::string& device) const; @@ -151,6 +156,7 @@ class JACKAudioBackend : public AudioBackend { /* pffooo */ + std::string _target_driver; std::string _target_device; float _target_sample_rate; uint32_t _target_buffer_size; |