aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/base.h
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-05 13:52:12 +0100
committerSven Göthel <[email protected]>2024-01-05 13:52:12 +0100
commitec98cdacc85ff0202852472c7756586437912f22 (patch)
tree42414746a27ab35cb8cdbc95af521d74821e57f4 /alc/backends/base.h
parentfd5269bec9a5fe4815974b1786a037e6a247bfd2 (diff)
parentb82cd2e60edb8fbe5fdd3567105ae76a016a554c (diff)
Merge remote-tracking branch 'upstream/master'HEADmaster
Diffstat (limited to 'alc/backends/base.h')
-rw-r--r--alc/backends/base.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/alc/backends/base.h b/alc/backends/base.h
index eea0d238..6726cd9a 100644
--- a/alc/backends/base.h
+++ b/alc/backends/base.h
@@ -52,18 +52,6 @@ enum class BackendType {
};
-/* Helper to get the current clock time from the device's ClockBase, and
- * SamplesDone converted from the sample rate.
- */
-inline std::chrono::nanoseconds GetDeviceClockTime(DeviceBase *device)
-{
- using std::chrono::seconds;
- using std::chrono::nanoseconds;
-
- auto ns = nanoseconds{seconds{device->SamplesDone}} / device->Frequency;
- return device->ClockBase + ns;
-}
-
/* Helper to get the device latency from the backend, including any fixed
* latency from post-processing.
*/
@@ -76,6 +64,8 @@ inline ClockLatency GetClockLatency(DeviceBase *device, BackendBase *backend)
struct BackendFactory {
+ virtual ~BackendFactory() = default;
+
virtual bool init() = 0;
virtual bool querySupport(BackendType type) = 0;
@@ -86,9 +76,6 @@ struct BackendFactory {
virtual std::string probe(BackendType type) = 0;
virtual BackendPtr createBackend(DeviceBase *device, BackendType type) = 0;
-
-protected:
- virtual ~BackendFactory() = default;
};
namespace al {
@@ -103,15 +90,15 @@ class backend_exception final : public base_exception {
backend_error mErrorCode;
public:
-#ifdef __USE_MINGW_ANSI_STDIO
- [[gnu::format(gnu_printf, 3, 4)]]
+#ifdef __MINGW32__
+ [[gnu::format(__MINGW_PRINTF_FORMAT, 3, 4)]]
#else
[[gnu::format(printf, 3, 4)]]
#endif
backend_exception(backend_error code, const char *msg, ...);
~backend_exception() override;
- backend_error errorCode() const noexcept { return mErrorCode; }
+ [[nodiscard]] auto errorCode() const noexcept -> backend_error { return mErrorCode; }
};
} // namespace al