|
|
|
|
@ -83,7 +83,6 @@ class MAGNUM_AUDIO_EXPORT Extension {
|
|
|
|
|
*/ |
|
|
|
|
class MAGNUM_AUDIO_EXPORT Context { |
|
|
|
|
public: |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief HRTF status |
|
|
|
|
* |
|
|
|
|
@ -127,6 +126,14 @@ class MAGNUM_AUDIO_EXPORT Context {
|
|
|
|
|
UnsupportedFormat = ALC_HRTF_UNSUPPORTED_FORMAT_SOFT |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief All device specifier strings |
|
|
|
|
* |
|
|
|
|
* @see @ref deviceSpecifierString(), @ref Configuration::setDeviceSpecifier() |
|
|
|
|
* @fn_al{GetString} with @def_alc{DEVICE_SPECIFIER} |
|
|
|
|
*/ |
|
|
|
|
static std::vector<std::string> deviceSpecifierStrings(); |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Whether there is any current context |
|
|
|
|
* |
|
|
|
|
@ -202,17 +209,27 @@ class MAGNUM_AUDIO_EXPORT Context {
|
|
|
|
|
return alcGetString(_device, ALC_HRTF_SPECIFIER_SOFT); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Device specifier string |
|
|
|
|
* |
|
|
|
|
* @see @ref deviceSpecifierStrings(), @ref vendorString(), @ref rendererString(), |
|
|
|
|
* @fn_al{GetString} with @def_alc{DEVICE_SPECIFIER} |
|
|
|
|
*/ |
|
|
|
|
std::string deviceSpecifierString() const { return alcGetString(_device, ALC_DEVICE_SPECIFIER); } |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Vendor string |
|
|
|
|
* |
|
|
|
|
* @see @ref rendererString(), @fn_al{GetString} with @def_al{VENDOR} |
|
|
|
|
* @see @ref deviceSpecifierString(), @ref rendererString(), |
|
|
|
|
* @fn_al{GetString} with @def_al{VENDOR} |
|
|
|
|
*/ |
|
|
|
|
std::string vendorString() const { return alGetString(AL_VENDOR); } |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Renderer string |
|
|
|
|
* |
|
|
|
|
* @see @ref vendorString(), @fn_al{GetString} with @def_al{RENDERER} |
|
|
|
|
* @see @ref deviceSpecifierString(), @ref vendorString(), |
|
|
|
|
* @fn_al{GetString} with @def_al{RENDERER} |
|
|
|
|
*/ |
|
|
|
|
std::string rendererString() const { return alGetString(AL_RENDERER); } |
|
|
|
|
|
|
|
|
|
@ -314,8 +331,22 @@ class MAGNUM_AUDIO_EXPORT Context::Configuration {
|
|
|
|
|
Disabled = 2 /**< Disabled */ |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/** @brief Constructor */ |
|
|
|
|
explicit Configuration() {} |
|
|
|
|
explicit Configuration(); |
|
|
|
|
~Configuration(); |
|
|
|
|
|
|
|
|
|
/** @brief Device specifier */ |
|
|
|
|
const std::string& deviceSpecifier() const { return _deviceSpecifier; } |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Set device specifier |
|
|
|
|
* @return Reference to self (for method chaining) |
|
|
|
|
* |
|
|
|
|
* If set to empty string (the default), default device specifier is |
|
|
|
|
* used. |
|
|
|
|
* @see @ref Context::deviceSpecifierStrings() |
|
|
|
|
*/ |
|
|
|
|
Configuration& setDeviceSpecifier(const std::string& specifier); |
|
|
|
|
Configuration& setDeviceSpecifier(std::string&& specifier); /**< @overload */ |
|
|
|
|
|
|
|
|
|
/** @brief Sampling rate in Hz */ |
|
|
|
|
Int frequency() const { return _frequency; } |
|
|
|
|
@ -392,6 +423,8 @@ class MAGNUM_AUDIO_EXPORT Context::Configuration {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
std::string _deviceSpecifier; |
|
|
|
|
|
|
|
|
|
Int _frequency{-1}; |
|
|
|
|
Hrtf _hrtf{}; |
|
|
|
|
|
|
|
|
|
|