// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Audio module" // For conditions of distribution and use, see copyright notice in Export.hpp #pragma once #ifndef NAZARA_AUDIO_OPENALLIBRARY_HPP #define NAZARA_AUDIO_OPENALLIBRARY_HPP #if defined(NAZARA_AUDIO_OPENAL) || defined(NAZARA_AUDIO_BUILD) #include #include #include #include #include #include #include namespace Nz { class OpenALDevice; class NAZARA_AUDIO_API OpenALLibrary { public: inline OpenALLibrary(); OpenALLibrary(const OpenALLibrary&) = delete; OpenALLibrary(OpenALLibrary&&) = delete; inline ~OpenALLibrary(); inline bool IsLoaded() const; bool Load(); std::vector QueryInputDevices(); std::vector QueryOutputDevices(); std::shared_ptr OpenDevice(const char* name = nullptr); void Unload(); OpenALLibrary& operator=(const OpenALLibrary&) = delete; OpenALLibrary& operator=(OpenALLibrary&&) = delete; #define NAZARA_AUDIO_AL_ALC_FUNCTION(name) decltype(&::name) name; #define NAZARA_AUDIO_AL_EXT_FUNCTION(name) #include private: std::vector ParseDevices(const char* deviceString); DynLib m_library; bool m_hasCaptureSupport; bool m_isLoaded; }; } #include #endif // NAZARA_AUDIO_OPENAL #endif // NAZARA_AUDIO_OPENALLIBRARY_HPP