예제 #1
0
파일: mmdevapi.c 프로젝트: jims/openal-soft
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;
}
예제 #2
0
파일: sndio.c 프로젝트: BitPuffin/NeoEditor
void alc_sndio_probe(enum DevProbe type)
{
    switch(type)
    {
        case ALL_DEVICE_PROBE:
            AppendAllDevicesList(sndio_device);
            break;
        case CAPTURE_DEVICE_PROBE:
            break;
    }
}
예제 #3
0
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;
    }
}
예제 #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;
    }
}
예제 #5
0
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;
    }
}
예제 #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;
    }
}
예제 #7
0
static inline void AppendAllDevicesList2(const al_string *name)
{
    if(!al_string_empty(*name))
        AppendAllDevicesList(al_string_get_cstr(*name));
}