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

Function getDeviceIndex

src/OpenLoco/src/Audio/Audio.cpp:193–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 static size_t getDeviceIndex(const std::string_view& deviceName)
194 {
195 if (deviceName.empty())
196 {
197 return 0;
198 }
199
200 if (_devices.empty())
201 {
202 getDevices();
203 }
204
205 auto fr = std::find(_devices.begin(), _devices.end(), deviceName);
206 if (fr != _devices.end())
207 {
208 return fr - _devices.begin();
209 }
210 return std::numeric_limits<size_t>().max();
211 }
212
213 void initialiseDSound()
214 {

Callers 1

getCurrentDeviceFunction · 0.85

Calls 4

findFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected