Example #1
0
void alcMMDevApiProbe(enum DevProbe type)
{
    ThreadRequest req = { NULL, 0 };
    HRESULT hr = E_FAIL;

    switch(type)
    {
        case ALL_DEVICE_PROBE:
            req.FinishedEvt = CreateEvent(NULL, FALSE, FALSE, NULL);
            if(req.FinishedEvt == NULL)
                ERR("Failed to create event: %lu\n", GetLastError());
            else if(PostThreadMessage(ThreadID, WM_USER_Enumerate, (WPARAM)&req, type))
                hr = WaitForResponse(&req);
            if(SUCCEEDED(hr))
            {
                ALuint i;
                for(i = 0;i < NumPlaybackDevices;i++)
                {
                    if(PlaybackDeviceList[i].name)
                        AppendAllDevicesList(PlaybackDeviceList[i].name);
                }
            }
            break;

        case CAPTURE_DEVICE_PROBE:
            break;
    }
    if(req.FinishedEvt != NULL)
        CloseHandle(req.FinishedEvt);
    req.FinishedEvt = NULL;
}
Example #2
0
void alc_sndio_probe(enum DevProbe type)
{
    switch(type)
    {
        case ALL_DEVICE_PROBE:
            AppendAllDevicesList(sndio_device);
            break;
        case CAPTURE_DEVICE_PROBE:
            break;
    }
}
void alc_ca_probe(enum DevProbe type)
{
    switch(type)
    {
        case ALL_DEVICE_PROBE:
            AppendAllDevicesList(ca_device);
            break;
        case CAPTURE_DEVICE_PROBE:
            AppendCaptureDeviceList(ca_device);
            break;
    }
}
Example #4
0
void alc_wave_probe(enum DevProbe type)
{
    if(!MOB_ConfigValueExists(wave, file))
        return;

    switch(type)
    {
        case ALL_DEVICE_PROBE:
            AppendAllDevicesList(waveDevice);
            break;
        case CAPTURE_DEVICE_PROBE:
            break;
    }
}
void alcDSoundProbe(enum DevProbe type)
{
    HRESULT hr, hrcom;
    ALuint i;

    switch(type)
    {
        case ALL_DEVICE_PROBE:
            for(i = 0;i < NumPlaybackDevices;++i)
                free(PlaybackDeviceList[i].name);
            free(PlaybackDeviceList);
            PlaybackDeviceList = NULL;
            NumPlaybackDevices = 0;

            hr = DirectSoundEnumerateA(DSoundEnumPlaybackDevices, NULL);
            if(FAILED(hr))
                ERR("Error enumerating DirectSound playback devices (%#x)!\n", (unsigned int)hr);
            else
            {
                for(i = 0;i < NumPlaybackDevices;i++)
                    AppendAllDevicesList(PlaybackDeviceList[i].name);
            }
            break;

        case CAPTURE_DEVICE_PROBE:
            for(i = 0;i < NumCaptureDevices;++i)
                free(CaptureDeviceList[i].name);
            free(CaptureDeviceList);
            CaptureDeviceList = NULL;
            NumCaptureDevices = 0;

            /* Initialize COM to prevent name truncation */
            hrcom = CoInitialize(NULL);
            hr = DirectSoundCaptureEnumerateA(DSoundEnumCaptureDevices, NULL);
            if(FAILED(hr))
                ERR("Error enumerating DirectSound capture devices (%#x)!\n", (unsigned int)hr);
            else
            {
                for(i = 0;i < NumCaptureDevices;i++)
                    AppendCaptureDeviceList(CaptureDeviceList[i].name);
            }
            if(SUCCEEDED(hrcom))
                CoUninitialize();
            break;
    }
}
Example #6
0
void alc_pulse_probe(enum DevProbe type)
{
    ALuint i;

    switch(type)
    {
    case ALL_DEVICE_PROBE:
        for(i = 0; i < numDevNames; ++i)
        {
            free(allDevNameMap[i].name);
            free(allDevNameMap[i].device_name);
        }
        free(allDevNameMap);
        allDevNameMap = NULL;
        numDevNames = 0;

        probe_devices(AL_FALSE);

        for(i = 0; i < numDevNames; i++)
            AppendAllDevicesList(allDevNameMap[i].name);
        break;

    case CAPTURE_DEVICE_PROBE:
        for(i = 0; i < numCaptureDevNames; ++i)
        {
            free(allCaptureDevNameMap[i].name);
            free(allCaptureDevNameMap[i].device_name);
        }
        free(allCaptureDevNameMap);
        allCaptureDevNameMap = NULL;
        numCaptureDevNames = 0;

        probe_devices(AL_TRUE);

        for(i = 0; i < numCaptureDevNames; i++)
            AppendCaptureDeviceList(allCaptureDevNameMap[i].name);
        break;
    }
}
Example #7
0
static inline void AppendAllDevicesList2(const al_string *name)
{
    if(!al_string_empty(*name))
        AppendAllDevicesList(al_string_get_cstr(*name));
}