MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / setDevice

Function setDevice

src/OpenLoco/src/Audio/Audio.cpp:300–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298 }
299
300 void setDevice(size_t index)
301 {
302 if (index < _devices.size())
303 {
304 auto& cfg = Config::get();
305#ifdef __HAS_DEFAULT_DEVICE__
306 if (index == 0)
307 {
308 cfg.audio.device = {};
309 }
310 else
311#endif
312 {
313 cfg.audio.device = _devices[index];
314 }
315 Config::write();
316 reinitialise();
317 }
318 }
319
320 void toggleSound()
321 {

Callers 1

audioDeviceDropdownFunction · 0.85

Calls 4

writeFunction · 0.85
reinitialiseFunction · 0.85
getFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected