• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ALCcontext_DecRef函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ALCcontext_DecRef函数的典型用法代码示例。如果您正苦于以下问题:C++ ALCcontext_DecRef函数的具体用法?C++ ALCcontext_DecRef怎么用?C++ ALCcontext_DecRef使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ALCcontext_DecRef函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: alEffecti

AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value)
{
    ALCcontext *Context;
    ALCdevice  *Device;
    ALeffect   *ALEffect;

    Context = GetContextRef();
    if(!Context) return;

    Device = Context->Device;
    if((ALEffect=LookupEffect(Device, effect)) == NULL)
        alSetError(Context, AL_INVALID_NAME);
    else
    {
        if(param == AL_EFFECT_TYPE)
        {
            ALboolean isOk = (value == AL_EFFECT_NULL);
            ALint i;
            for(i = 0;!isOk && EffectList[i].val;i++)
            {
                if(value == EffectList[i].val &&
                   !DisabledEffects[EffectList[i].type])
                    isOk = AL_TRUE;
            }

            if(isOk)
                InitEffectParams(ALEffect, value);
            else
                alSetError(Context, AL_INVALID_VALUE);
        }
        else
        {
            /* Call the appropriate handler */
            V(ALEffect,setParami)(Context, param, value);
        }
    }

    ALCcontext_DecRef(Context);
}
开发者ID:100GPing100,项目名称:Loveprint,代码行数:39,代码来源:alEffect.c


示例2: alGetFilterfv

AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *values)
{
    ALCcontext *Context;
    ALCdevice  *Device;
    ALfilter   *ALFilter;

    Context = GetContextRef();
    if(!Context) return;

    Device = Context->Device;
    LockFilterList(Device);
    if((ALFilter=LookupFilter(Device, filter)) == NULL)
        alSetError(Context, AL_INVALID_NAME, "Invalid filter ID %u", filter);
    else
    {
        /* Call the appropriate handler */
        ALfilter_getParamfv(ALFilter, Context, param, values);
    }
    UnlockFilterList(Device);

    ALCcontext_DecRef(Context);
}
开发者ID:F4r3n,项目名称:FarenMediaLibrary,代码行数:22,代码来源:alFilter.c


示例3: alMidiResetSOFT

AL_API void AL_APIENTRY alMidiResetSOFT(void)
{
    ALCdevice *device;
    ALCcontext *context;
    MidiSynth *synth;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    synth = device->Synth;

    WriteLock(&synth->Lock);
    V(synth,setState)(AL_INITIAL);

    ALCdevice_Lock(device);
    V0(synth,reset)();
    ALCdevice_Unlock(device);
    WriteUnlock(&synth->Lock);

    ALCcontext_DecRef(context);
}
开发者ID:BitPuffin,项目名称:NeoEditor,代码行数:22,代码来源:alMidi.c


示例4: alGetInteger

AL_API ALint AL_APIENTRY alGetInteger(ALenum pname)
{
    ALCcontext *Context;
    ALint value = 0;

    Context = GetContextRef();
    if(!Context) return 0;

    switch(pname)
    {
        case AL_DOPPLER_FACTOR:
            value = (ALint)Context->DopplerFactor;
            break;

        case AL_DOPPLER_VELOCITY:
            value = (ALint)Context->DopplerVelocity;
            break;

        case AL_DISTANCE_MODEL:
            value = (ALint)Context->DistanceModel;
            break;

        case AL_SPEED_OF_SOUND:
            value = (ALint)Context->flSpeedOfSound;
            break;

        case AL_DEFERRED_UPDATES_SOFT:
            value = (ALint)Context->DeferUpdates;
            break;

        default:
            alSetError(Context, AL_INVALID_ENUM);
            break;
    }

    ALCcontext_DecRef(Context);

    return value;
}
开发者ID:Abce,项目名称:OpenAL,代码行数:39,代码来源:alState.c


示例5: alGetPresetivSOFT

AL_API void AL_APIENTRY alGetPresetivSOFT(ALuint id, ALenum param, ALint *values)
{
    ALCdevice *device;
    ALCcontext *context;
    ALsfpreset *preset;
    ALsizei i;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    if((preset=LookupPreset(device, id)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
        case AL_MIDI_PRESET_SOFT:
            values[0] = preset->Preset;
            break;

        case AL_MIDI_BANK_SOFT:
            values[0] = preset->Bank;
            break;

        case AL_FONTSOUNDS_SIZE_SOFT:
            values[0] = preset->NumSounds;
            break;

        case AL_FONTSOUNDS_SOFT:
            for(i = 0;i < preset->NumSounds;i++)
                values[i] = preset->Sounds[i]->id;
            break;

        default:
            SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}
开发者ID:Banderi,项目名称:OpenTomb,代码行数:39,代码来源:alPreset.c


示例6: alMidiSysExSOFT

AL_API void AL_APIENTRY alMidiSysExSOFT(ALuint64SOFT time, const ALbyte *data, ALsizei size)
{
    ALCdevice *device;
    ALCcontext *context;
    ALenum err;

    context = GetContextRef();
    if(!context) return;

    if(!data || size < 0)
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

    device = context->Device;
    ALCdevice_Lock(device);
    err = MidiSynth_insertSysExEvent(device->Synth, time, data, size);
    ALCdevice_Unlock(device);
    if(err != AL_NO_ERROR)
        alSetError(context, err);

done:
    ALCcontext_DecRef(context);
}
开发者ID:TeslaRus,项目名称:OpenTomb,代码行数:22,代码来源:alMidi.c


示例7: alMidiStopSOFT

AL_API void AL_APIENTRY alMidiStopSOFT(void)
{
    ALCdevice *device;
    ALCcontext *context;
    MidiSynth *synth;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    synth = device->Synth;

    WriteLock(&synth->Lock);
    MidiSynth_setState(synth, AL_STOPPED);

    ALCdevice_Lock(device);
    V0(synth,stop)();
    ALCdevice_Unlock(device);
    WriteUnlock(&synth->Lock);

    ALCcontext_DecRef(context);
}
开发者ID:TeslaRus,项目名称:OpenTomb,代码行数:22,代码来源:alMidi.c


示例8: alDeleteAuxiliaryEffectSlots

AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots)
{
    ALCcontext *Context;
    ALeffectslot *slot;
    ALsizei i;

    Context = GetContextRef();
    if(!Context) return;

    al_try
    {
        CHECK_VALUE(Context, n >= 0);
        for(i = 0;i < n;i++)
        {
            if((slot=LookupEffectSlot(Context, effectslots[i])) == NULL)
                al_throwerr(Context, AL_INVALID_NAME);
            if(slot->ref != 0)
                al_throwerr(Context, AL_INVALID_OPERATION);
        }

        // All effectslots are valid
        for(i = 0;i < n;i++)
        {
            if((slot=RemoveEffectSlot(Context, effectslots[i])) == NULL)
                continue;
            FreeThunkEntry(slot->id);

            RemoveEffectSlotArray(Context, slot);
            ALeffectState_Destroy(slot->EffectState);

            memset(slot, 0, sizeof(*slot));
            al_free(slot);
        }
    }
    al_endtry;

    ALCcontext_DecRef(Context);
}
开发者ID:clarkdonald,项目名称:eecs494explore3d,代码行数:38,代码来源:alAuxEffectSlot.c


示例9: alDeleteAuxiliaryEffectSlots

AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint *effectslots)
{
    ALCcontext *context;
    ALeffectslot *slot;
    ALsizei i;

    context = GetContextRef();
    if(!context) return;

    LockEffectSlotsWrite(context);
    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
    for(i = 0;i < n;i++)
    {
        if((slot=LookupEffectSlot(context, effectslots[i])) == NULL)
            SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
        if(ReadRef(&slot->ref) != 0)
            SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
    }

    // All effectslots are valid
    for(i = 0;i < n;i++)
    {
        if((slot=RemoveEffectSlot(context, effectslots[i])) == NULL)
            continue;
        FreeThunkEntry(slot->id);

        RemoveEffectSlotList(context, slot);
        DeinitEffectSlot(slot);

        memset(slot, 0, sizeof(*slot));
        al_free(slot);
    }

done:
    UnlockEffectSlotsWrite(context);
    ALCcontext_DecRef(context);
}
开发者ID:IsemanTech,项目名称:openal-soft,代码行数:38,代码来源:alAuxEffectSlot.c


示例10: alGetIntegerv

AL_API ALvoid AL_APIENTRY alGetIntegerv(ALenum pname,ALint *data)
{
    ALCcontext *Context;

    if(data)
    {
        switch(pname)
        {
            case AL_DOPPLER_FACTOR:
            case AL_DOPPLER_VELOCITY:
            case AL_DISTANCE_MODEL:
            case AL_SPEED_OF_SOUND:
            case AL_DEFERRED_UPDATES_SOFT:
                *data = alGetInteger(pname);
                return;
        }
    }

    Context = GetContextRef();
    if(!Context) return;

    if(data)
    {
        switch(pname)
        {
            default:
                alSetError(Context, AL_INVALID_ENUM);
                break;
        }
    }
    else
    {
        // data is a NULL pointer
        alSetError(Context, AL_INVALID_VALUE);
    }

    ALCcontext_DecRef(Context);
}
开发者ID:Abce,项目名称:OpenAL,代码行数:38,代码来源:alState.c


示例11: alGetListeneri

AL_API ALvoid AL_APIENTRY alGetListeneri(ALenum param, ALint *value)
{
    ALCcontext *Context;

    Context = GetContextRef();
    if(!Context) return;

    al_try
    {
        CHECK_VALUE(Context, value);
        switch(param)
        {
            case AL_PRIORITY_SLOTS:
                *value = (ALint)Context->PrioritySlots;
                break;
            default:
                al_throwerr(Context, AL_INVALID_ENUM);
        }
    }
    al_endtry;

    ALCcontext_DecRef(Context);
}
开发者ID:yaakuro,项目名称:XdevLSDK,代码行数:23,代码来源:alListener.c


示例12: alIsEnabled

AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
{
    ALCcontext *Context;
    ALboolean value=AL_FALSE;

    Context = GetContextRef();
    if(!Context) return AL_FALSE;

    switch(capability)
    {
        case AL_SOURCE_DISTANCE_MODEL:
            value = Context->SourceDistanceModel;
            break;

        default:
            alSetError(Context, AL_INVALID_ENUM);
            break;
    }

    ALCcontext_DecRef(Context);

    return value;
}
开发者ID:Abce,项目名称:OpenAL,代码行数:23,代码来源:alState.c


示例13: alGetBuffer3i

AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum param, ALint *value1, ALint *value2, ALint *value3)
{
    ALCdevice *device;
    ALCcontext *context;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    if(LookupBuffer(device, buffer) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);

    if(!(value1 && value2 && value3))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);
    switch(param)
    {
    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}
开发者ID:100GPing100,项目名称:Loveprint,代码行数:23,代码来源:alBuffer.c


示例14: alGetAuxiliaryEffectSlotf

AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *value)
{
    ALCcontext *context;
    ALeffectslot *slot;

    context = GetContextRef();
    if(!context) return;

    if((slot=LookupEffectSlot(context, effectslot)) == NULL)
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    switch(param)
    {
    case AL_EFFECTSLOT_GAIN:
        *value = slot->Gain;
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);
}
开发者ID:Banderi,项目名称:OpenTomb,代码行数:23,代码来源:alAuxEffectSlot.c


示例15: alGenEffects

AL_API ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects)
{
    ALCcontext *context;
    ALsizei cur;

    context = GetContextRef();
    if(!context) return;

    if(n < 0)
        alSetError(context, AL_INVALID_VALUE, "Generating %d effects", n);
    else for(cur = 0;cur < n;cur++)
    {
        ALeffect *effect = AllocEffect(context);
        if(!effect)
        {
            alDeleteEffects(cur, effects);
            break;
        }
        effects[cur] = effect->id;
    }

    ALCcontext_DecRef(context);
}
开发者ID:xxxbxxx,项目名称:openal-soft,代码行数:23,代码来源:alEffect.c


示例16: alIsEnabled

AL_API ALboolean AL_APIENTRY alIsEnabled(ALenum capability)
{
    ALCcontext *context;
    ALboolean value=AL_FALSE;

    context = GetContextRef();
    if(!context) return AL_FALSE;

    switch(capability)
    {
    case AL_SOURCE_DISTANCE_MODEL:
        value = context->SourceDistanceModel;
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }

done:
    ALCcontext_DecRef(context);

    return value;
}
开发者ID:Banderi,项目名称:OpenTomb,代码行数:23,代码来源:alState.c


示例17: alIsExtensionPresent

AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
{
    ALboolean ret = AL_FALSE;
    ALCcontext *Context;
    const char *ptr;
    size_t len;

    Context = GetContextRef();
    if(!Context) return AL_FALSE;

    al_try
    {
        CHECK_VALUE(Context, extName);

        len = strlen(extName);
        ptr = Context->ExtensionList;
        while(ptr && *ptr)
        {
            if(strncasecmp(ptr, extName, len) == 0 &&
               (ptr[len] == '\0' || isspace(ptr[len])))
            {
                ret = AL_TRUE;
                break;
            }
            if((ptr=strchr(ptr, ' ')) != NULL)
            {
                do {
                    ++ptr;
                } while(isspace(*ptr));
            }
        }
    }
    al_endtry;

    ALCcontext_DecRef(Context);
    return ret;
}
开发者ID:6779660,项目名称:OpenAL-MOB,代码行数:37,代码来源:alExtension.c


示例18: alGetListener3i

AL_API void AL_APIENTRY alGetListener3i(ALenum eParam, ALint *plValue1, ALint *plValue2, ALint *plValue3)
{
    ALCcontext *Context;

    Context = GetContextRef();
    if(!Context) return;

    if(plValue1 && plValue2 && plValue3)
    {
        switch (eParam)
        {
            case AL_POSITION:
                LockContext(Context);
                *plValue1 = (ALint)Context->Listener.Position[0];
                *plValue2 = (ALint)Context->Listener.Position[1];
                *plValue3 = (ALint)Context->Listener.Position[2];
                UnlockContext(Context);
                break;

            case AL_VELOCITY:
                LockContext(Context);
                *plValue1 = (ALint)Context->Listener.Velocity[0];
                *plValue2 = (ALint)Context->Listener.Velocity[1];
                *plValue3 = (ALint)Context->Listener.Velocity[2];
                UnlockContext(Context);
                break;

            default:
                alSetError(Context, AL_INVALID_ENUM);
                break;
        }
    }
    else
        alSetError(Context, AL_INVALID_VALUE);

    ALCcontext_DecRef(Context);
}
开发者ID:GlenDC,项目名称:love-native-android,代码行数:37,代码来源:alListener.c


示例19: alLoadSoundfontSOFT

AL_API void AL_APIENTRY alLoadSoundfontSOFT(ALuint id, size_t(*cb)(ALvoid*,size_t,ALvoid*), ALvoid *user)
{
    ALCdevice *device;
    ALCcontext *context;
    ALsoundfont *sfont;
    Reader reader;

    context = GetContextRef();
    if(!context) return;

    device = context->Device;
    if(id == 0)
        SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
    if(!(sfont=LookupSfont(device, id)))
        SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);

    WriteLock(&sfont->Lock);
    if(ReadRef(&sfont->ref) != 0)
    {
        WriteUnlock(&sfont->Lock);
        SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
    }
    if(sfont->NumPresets > 0)
    {
        WriteUnlock(&sfont->Lock);
        SET_ERROR_AND_GOTO(context, AL_INVALID_OPERATION, done);
    }

    reader.cb = cb;
    reader.ptr = user;
    reader.error = 0;
    loadSf2(&reader, sfont, context);
    WriteUnlock(&sfont->Lock);

done:
    ALCcontext_DecRef(context);
}
开发者ID:Sponk,项目名称:NeoEditor,代码行数:37,代码来源:alSoundfont.c


示例20: alDisable

AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
{
    ALCcontext *context;

    context = GetContextRef();
    if(!context) return;

    WriteLock(&context->PropLock);
    switch(capability)
    {
    case AL_SOURCE_DISTANCE_MODEL:
        context->SourceDistanceModel = AL_FALSE;
        break;

    default:
        SET_ERROR_AND_GOTO(context, AL_INVALID_ENUM, done);
    }
    if(!ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire))
        UpdateListenerProps(context);

done:
    WriteUnlock(&context->PropLock);
    ALCcontext_DecRef(context);
}
开发者ID:dns,项目名称:CLove,代码行数:24,代码来源:alState.c



注:本文中的ALCcontext_DecRef函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ALEMBIC_ABC_SAFE_CALL_BEGIN函数代码示例发布时间:2022-05-30
下一篇:
C++ AKeyEvent_getKeyCode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap