mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
pa_sound: add api info to device names
This commit is contained in:
parent
1cd73332f4
commit
809cd841db
@ -132,15 +132,11 @@ int sound_pa::init(osd_interface &osd, osd_options const &options)
|
||||
|
||||
m_info.m_generation = 1;
|
||||
m_info.m_nodes.resize(Pa_GetDeviceCount());
|
||||
std::map<std::string, int> counters;
|
||||
for(PaDeviceIndex dev = 0; dev != Pa_GetDeviceCount(); dev++) {
|
||||
const PaDeviceInfo *di = Pa_GetDeviceInfo(dev);
|
||||
const PaHostApiInfo *ai = Pa_GetHostApiInfo(di->hostApi);
|
||||
auto &node = m_info.m_nodes[dev];
|
||||
int i1 = ++counters[di->name];
|
||||
if(i1 > 1)
|
||||
node.m_name = util::string_format("%s:%d", di->name, i1);
|
||||
else
|
||||
node.m_name = di->name;
|
||||
node.m_name = util::string_format("%s: %s", ai->name, di->name);
|
||||
node.m_id = dev + 1;
|
||||
node.m_rate.m_default_rate = node.m_rate.m_min_rate = node.m_rate.m_max_rate = di->defaultSampleRate;
|
||||
node.m_sinks = di->maxOutputChannels;
|
||||
|
@ -291,7 +291,7 @@ int sound_xaudio2::init(osd_interface &osd, osd_options const &options)
|
||||
m_sample_rate = options.sample_rate();
|
||||
m_audio_latency = options.audio_latency();
|
||||
if (m_audio_latency == 0)
|
||||
return m_audio_latency = 50;
|
||||
return m_audio_latency = 100;
|
||||
|
||||
// Create the IXAudio2 object
|
||||
HR_GOERR(OSD_DYNAMIC_CALL(XAudio2Create, m_xAudio2.GetAddressOf(), 0, XAUDIO2_DEFAULT_PROCESSOR));
|
||||
|
Loading…
Reference in New Issue
Block a user