Esempio n. 1
0
static void printALCInfo(ALCdevice *device)
{
    ALCint major, minor;

    if(device)
    {
        const ALCchar *devname = NULL;
        printf("\n");
        if(alcIsExtensionPresent(device, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE)
            devname = alcGetString(device, ALC_ALL_DEVICES_SPECIFIER);
        if(checkALCErrors(device) != ALC_NO_ERROR || !devname)
            devname = alcGetString(device, ALC_DEVICE_SPECIFIER);
        printf("** Info for device \"%s\" **\n", devname);
    }
    alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);
    alcGetIntegerv(device, ALC_MINOR_VERSION, 1, &minor);
    if(checkALCErrors(device) == ALC_NO_ERROR)
        printf("ALC version: %d.%d\n", major, minor);
    if(device)
    {
        printf("ALC extensions:");
        printList(alcGetString(device, ALC_EXTENSIONS), ' ');
        checkALCErrors(device);
    }
}
Esempio n. 2
0
static void printHRTFInfo(ALCdevice *device)
{
    LPALCGETSTRINGISOFT alcGetStringiSOFT;
    ALCint num_hrtfs;

    if(alcIsExtensionPresent(device, "ALC_SOFT_HRTF") == ALC_FALSE)
    {
        printf("HRTF extension not available\n");
        return;
    }

    alcGetStringiSOFT = alcGetProcAddress(device, "alcGetStringiSOFT");

    alcGetIntegerv(device, ALC_NUM_HRTF_SPECIFIERS_SOFT, 1, &num_hrtfs);
    if(!num_hrtfs)
        printf("No HRTFs found\n");
    else
    {
        ALCint i;
        printf("Available HRTFs:\n");
        for(i = 0;i < num_hrtfs;++i)
        {
            const ALCchar *name = alcGetStringiSOFT(device, ALC_HRTF_SPECIFIER_SOFT, i);
            printf("    %s\n", name);
        }
    }
    checkALCErrors(device);
}
Esempio n. 3
0
static void printEFXInfo(ALCdevice *device)
{
    ALCint major, minor, sends;
    static const ALchar filters[][32] = {
        "AL_FILTER_LOWPASS", "AL_FILTER_HIGHPASS", "AL_FILTER_BANDPASS", ""
    };
    char filterNames[] = "Low-pass,High-pass,Band-pass,";
    static const ALchar effects[][32] = {
        "AL_EFFECT_EAXREVERB", "AL_EFFECT_REVERB", "AL_EFFECT_CHORUS",
        "AL_EFFECT_DISTORTION", "AL_EFFECT_ECHO", "AL_EFFECT_FLANGER",
        "AL_EFFECT_FREQUENCY_SHIFTER", "AL_EFFECT_VOCAL_MORPHER",
        "AL_EFFECT_PITCH_SHIFTER", "AL_EFFECT_RING_MODULATOR",
        "AL_EFFECT_AUTOWAH", "AL_EFFECT_COMPRESSOR", "AL_EFFECT_EQUALIZER", ""
    };
    static const ALchar dedeffects[][64] = {
        "AL_EFFECT_DEDICATED_DIALOGUE",
        "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT", ""
    };
    char effectNames[] = "EAX Reverb,Reverb,Chorus,Distortion,Echo,Flanger,"
                         "Frequency Shifter,Vocal Morpher,Pitch Shifter,"
                         "Ring Modulator,Autowah,Compressor,Equalizer,"
                         "Dedicated Dialog,Dedicated LFE,";
    char *current;
    int i;

    if(alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_FALSE)
    {
        printf("EFX not available\n");
        return;
    }

    alcGetIntegerv(device, ALC_EFX_MAJOR_VERSION, 1, &major);
    alcGetIntegerv(device, ALC_EFX_MINOR_VERSION, 1, &minor);
    if(checkALCErrors(device) == ALC_NO_ERROR)
        printf("EFX version: %d.%d\n", major, minor);
    alcGetIntegerv(device, ALC_MAX_AUXILIARY_SENDS, 1, &sends);
    if(checkALCErrors(device) == ALC_NO_ERROR)
        printf("Max auxiliary sends: %d\n", sends);

    current = filterNames;
    for(i = 0;filters[i][0];i++)
    {
        char *next = strchr(current, ',');
        ALenum val;

        val = alGetEnumValue(filters[i]);
        if(alGetError() != AL_NO_ERROR || val == 0 || val == -1)
            memmove(current, next+1, strlen(next));
        else
            current = next+1;
    }
    printf("Supported filters:");
    printList(filterNames, ',');

    current = effectNames;
    for(i = 0;effects[i][0];i++)
    {
        char *next = strchr(current, ',');
        ALenum val;

        val = alGetEnumValue(effects[i]);
        if(alGetError() != AL_NO_ERROR || val == 0 || val == -1)
            memmove(current, next+1, strlen(next));
        else
            current = next+1;
    }
    if(alcIsExtensionPresent(device, "ALC_EXT_DEDICATED"))
    {
        for(i = 0;dedeffects[i][0];i++)
        {
            char *next = strchr(current, ',');
            ALenum val;

            val = alGetEnumValue(dedeffects[i]);
            if(alGetError() != AL_NO_ERROR || val == 0 || val == -1)
                memmove(current, next+1, strlen(next));
            else
                current = next+1;
        }
    }
    else
    {
        for(i = 0;dedeffects[i][0];i++)
        {
            char *next = strchr(current, ',');
            memmove(current, next+1, strlen(next));
        }
    }
    printf("Supported effects:");
    printList(effectNames, ',');
}