From 613fc12e7325d15a586b5bf8013a78d3654e80d7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 Oct 2013 11:33:38 -0400 Subject: add default sample rate and buffer size methods to AudioBackend --- libs/ardour/ardour/audio_backend.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libs') diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h index cbe0bfce50..21f050afdd 100644 --- a/libs/ardour/ardour/audio_backend.h +++ b/libs/ardour/ardour/audio_backend.h @@ -117,6 +117,17 @@ class AudioBackend : public PortEngine { * at any time. */ virtual std::vector available_sample_rates (const std::string& device) const = 0; + + /* Returns the default sample rate that will be shown to the user when + * configuration options are first presented. If the derived class + * needs or wants to override this, it can. It also MUST override this + * if there is any chance that an SR of 44.1kHz is not in the list + * returned by available_sample_rates() + */ + virtual float default_sample_rate () const { + return 44100.0; + } + /** Returns a collection of uint32 identifying buffer sizes that are * potentially usable with the hardware identified by @param device. * Any of these values may be supplied in other calls to this backend @@ -126,6 +137,16 @@ class AudioBackend : public PortEngine { */ virtual std::vector available_buffer_sizes (const std::string& device) const = 0; + /* Returns the default buffer size that will be shown to the user when + * configuration options are first presented. If the derived class + * needs or wants to override this, it can. It also MUST override this + * if there is any chance that a buffer size of 1024 is not in the list + * returned by available_buffer_sizes() + */ + virtual uint32_t default_buffer_size () const { + return 1024; + } + /** Returns the maximum number of input channels that are potentially * usable with the hardware identified by @param device. Any number from 1 * to the value returned may be supplied in other calls to this backend as -- cgit v1.2.3