mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 11:19:19 +02:00
audio device list, customizable relay reset cab controls, pantograph control ai hint, minor vehicle initialization tweaks, minor ai logic tweaks
This commit is contained in:
@@ -463,6 +463,21 @@ openal_renderer::fetch_source() {
|
||||
bool
|
||||
openal_renderer::init_caps() {
|
||||
|
||||
if( ::alcIsExtensionPresent( nullptr, "ALC_ENUMERATION_EXT" ) == AL_TRUE ) {
|
||||
// enumeration supported
|
||||
WriteLog( "available audio devices:" );
|
||||
auto const *devices { ::alcGetString( nullptr, ALC_DEVICE_SPECIFIER ) };
|
||||
auto const
|
||||
*device { devices },
|
||||
*next { devices + 1 };
|
||||
while( (device) && (*device != '\0') && (next) && (*next != '\0') ) {
|
||||
WriteLog( { device } );
|
||||
auto const len { std::strlen( device ) };
|
||||
device += ( len + 1 );
|
||||
next += ( len + 2 );
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: default value of audio renderer variable is empty string, meaning argument of NULL i.e. 'preferred' device
|
||||
m_device = ::alcOpenDevice( Global.AudioRenderer.c_str() );
|
||||
if( m_device == nullptr ) {
|
||||
|
||||
Reference in New Issue
Block a user