static void SinkInfo(pa_context *c, const pa_sink_info *i, int eol, void *userdata) { SinkInfoStruct *sinkStruct = (SinkInfoStruct *)userdata; if (i && i->name) { bool add = false; if(sinkStruct->passthrough) { #if PA_CHECK_VERSION(1,0,0) for(int idx = 0; idx < i->n_formats; ++idx) { if(!pa_format_info_is_pcm(i->formats[idx])) { add = true; break; } } #endif } else add = true; if (add) { CStdString desc, sink; desc.Format("%s (PulseAudio)", i->description); sink.Format("pulse:%s@default", i->name); sinkStruct->list->push_back(AEDevice(desc, sink)); CLog::Log(LOGDEBUG, "PulseAudio: Found %s with devicestring %s", desc.c_str(), sink.c_str()); } } pa_threaded_mainloop_signal(sinkStruct->mainloop, 0); }
void CCoreAudioAEHALIOS::EnumerateOutputDevices(AEDeviceList &devices, bool passthrough) { IOSCoreAudioDeviceList deviceList; CIOSCoreAudioHardware::GetOutputDevices(&deviceList); // Add default output device if GetOutputDevices return nothing devices.push_back(AEDevice("Default", "IOSCoreAudio:default")); std::string deviceName; for (int i = 0; !deviceList.empty(); i++) { std::string deviceName_Internal = std::string("IOSCoreAudio:") + deviceName; devices.push_back(AEDevice(deviceName, deviceName_Internal)); deviceList.pop_front(); } }
void CCoreAudioAEHALOSX::EnumerateOutputDevices(AEDeviceList &devices, bool passthrough) { CoreAudioDeviceList deviceList; CCoreAudioHardware::GetOutputDevices(&deviceList); devices.push_back(AEDevice("Default", "CoreAudio:default")); std::string deviceName; for (int i = 0; !deviceList.empty(); i++) { CCoreAudioDevice device(deviceList.front()); deviceName = device.GetName(); std::string deviceName_Internal = std::string("CoreAudio:"); deviceName_Internal.append(deviceName); devices.push_back(AEDevice(deviceName, deviceName_Internal)); deviceList.pop_front(); } }
void CPulseAE::EnumerateOutputDevices(AEDeviceList &devices, bool passthrough) { if (!m_MainLoop || ! m_Context) return; pa_threaded_mainloop_lock(m_MainLoop); SinkInfoStruct sinkStruct; sinkStruct.passthrough = passthrough; sinkStruct.mainloop = m_MainLoop; sinkStruct.list = &devices; CStdString def; def.Format("%s (PulseAudio)",g_localizeStrings.Get(409).c_str()); devices.push_back(AEDevice(def, "pulse:default@default")); WaitForOperation(pa_context_get_sink_info_list(m_Context, SinkInfo, &sinkStruct), m_MainLoop, "EnumerateAudioSinks"); pa_threaded_mainloop_unlock(m_MainLoop); }
void CAESinkProfiler::EnumerateDevices (AEDeviceList &devices, bool passthrough) { devices.push_back(AEDevice("Profiler", "Profiler")); }