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

C++ alcGetContextsDevice函数代码示例

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

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



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

示例1: gst_openal_sink_open

static gboolean
gst_openal_sink_open (GstAudioSink * audiosink)
{
  GstOpenALSink *sink = GST_OPENAL_SINK (audiosink);

  if (sink->user_device) {
    ALCint value = -1;
    alcGetIntegerv (sink->user_device, ALC_ATTRIBUTES_SIZE, 1, &value);
    if (value > 0) {
      if (!sink->user_context
          || alcGetContextsDevice (sink->user_context) == sink->user_device)
        sink->default_device = sink->user_device;
    }
  } else if (sink->user_context)
    sink->default_device = alcGetContextsDevice (sink->user_context);
  else
    sink->default_device = alcOpenDevice (sink->device_name);
  if (!sink->default_device) {
    GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE,
        ("Could not open device."), GST_ALC_ERROR (sink->default_device));
    return FALSE;
  }

  return TRUE;
}
开发者ID:jhgorse,项目名称:gst-plugins-bad,代码行数:25,代码来源:gstopenalsink.c


示例2: gst_openal_sink_open

static gboolean
gst_openal_sink_open (GstAudioSink * asink)
{
    GstOpenALSink *openal = GST_OPENAL_SINK (asink);

    if (openal->custom_dev) {
        ALCint val = -1;
        alcGetIntegerv (openal->custom_dev, ALC_ATTRIBUTES_SIZE, 1, &val);
        if (val > 0) {
            if (!openal->custom_ctx ||
                    alcGetContextsDevice (openal->custom_ctx) == openal->custom_dev)
                openal->device = openal->custom_dev;
        }
    } else if (openal->custom_ctx)
        openal->device = alcGetContextsDevice (openal->custom_ctx);
    else
        openal->device = alcOpenDevice (openal->devname);
    if (!openal->device) {
        GST_ELEMENT_ERROR (openal, RESOURCE, OPEN_WRITE,
                           ("Could not open audio device for playback."),
                           GST_ALC_ERROR (openal->device));
        return FALSE;
    }

    return TRUE;
}
开发者ID:kanongil,项目名称:gst-plugins-bad,代码行数:26,代码来源:gstopenalsink.c


示例3: lime_alc_get_contexts_device

	value lime_alc_get_contexts_device (value context) {
		
		ALCcontext* alcContext = (ALCcontext*)val_data (context);
		ALCdevice* alcDevice = alcGetContextsDevice (alcContext);
		return CFFIPointer (alcDevice);
		
	}
开发者ID:Leander1P,项目名称:lime,代码行数:7,代码来源:OpenALBindings.cpp


示例4: lime_alc_get_contexts_device

value lime_alc_get_contexts_device (value context) {

    ALCcontext* alcContext = (ALCcontext*)(intptr_t)val_float (context);
    ALCdevice* alcDevice = alcGetContextsDevice (alcContext);
    return alloc_float ((intptr_t)alcDevice);

}
开发者ID:darkdarkdragon,项目名称:lime,代码行数:7,代码来源:OpenALBindings.cpp


示例5: alSourceStop

void OpenALStream::Stop()
{
  m_run_thread.Clear();
  // kick the thread if it's waiting
  soundSyncEvent.Set();

  soundTouch.clear();

  thread.join();

  alSourceStop(uiSource);
  alSourcei(uiSource, AL_BUFFER, 0);

  // Clean up buffers and sources
  alDeleteSources(1, &uiSource);
  uiSource = 0;
  alDeleteBuffers(numBuffers, uiBuffers);

  ALCcontext* pContext = alcGetCurrentContext();
  ALCdevice* pDevice = alcGetContextsDevice(pContext);

  alcMakeContextCurrent(nullptr);
  alcDestroyContext(pContext);
  alcCloseDevice(pDevice);
}
开发者ID:jloehr,项目名称:dolphin,代码行数:25,代码来源:OpenALStream.cpp


示例6: checkForErrors

static void
checkForErrors (void)
{
  {
    ALenum error = alutGetError ();
    if (error != ALUT_ERROR_NO_ERROR)
      {
        die ("ALUT", alutGetErrorString (error));
      }
  }
  {
    ALCdevice *device = alcGetContextsDevice (alcGetCurrentContext ());
    ALCenum error = alcGetError (device);
    if (error != ALC_NO_ERROR)
      {
        die ("ALC", (const char *) alcGetString (device, error));
      }
  }
  {
    ALenum error = alGetError ();
    if (error != AL_NO_ERROR)
      {
        die ("AL", (const char *) alGetString (error));
      }
  }
}
开发者ID:JyothishM,项目名称:openal-svn-mirror,代码行数:26,代码来源:openal-info.c


示例7: alSourceStop

COpenALSound::~COpenALSound()
{
	if (noSound) {
		delete[] Sources;
		return;
	}
	LoadedFiles.clear();
	for (int i = 0; i < maxSounds; i++) {
		alSourceStop(Sources[i]);
		alDeleteSources(1,&Sources[i]);
	}
	delete[] Sources;
	while (!Buffers.empty()) {
		alDeleteBuffers(1,&Buffers.back());
		Buffers.pop_back();
	}
	ALCcontext *curcontext = alcGetCurrentContext();
	ALCdevice *curdevice = alcGetContextsDevice(curcontext);
	alcSuspendContext(curcontext);
	/*
	 * FIXME
	 * Technically you're supposed to detach and destroy the
	 * current context with these two lines, but it deadlocks.
	 * As a not-quite-as-clean shortcut, if we skip this step
	 * and just close the device, OpenAL theoretically
	 * destroys the context associated with that device.
	 * 
	 * alcMakeContextCurrent(NULL);
	 * alcDestroyContext(curcontext);
	 */
	alcCloseDevice(curdevice);
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:32,代码来源:OpenALSound.cpp


示例8: OPENAL_Close

AL_API void OPENAL_Close()
{
    if (!initialized) return;

    ALCcontext *ctx = alcGetCurrentContext();
    if (ctx)
    {
        for (int i = 0; i < num_channels; i++)
        {
            alSourceStop(channels[i].sid);
            alSourcei(channels[i].sid, AL_BUFFER, 0);
            alDeleteSources(1, &channels[i].sid);
        }
        ALCdevice *dev = alcGetContextsDevice(ctx);
        alcMakeContextCurrent(NULL);
        alcSuspendContext(ctx);
        alcDestroyContext(ctx);
        alcCloseDevice(dev);
    }

    num_channels = 0;
    delete[] channels;
    channels = NULL;

    unload_alsyms();
    initialized = false;
}
开发者ID:Vlakulor,项目名称:lugaru,代码行数:27,代码来源:openal_wrapper.cpp


示例9: alCleanUp

void alCleanUp(void){
	context = alcGetCurrentContext();
	device = alcGetContextsDevice(context);
	alcMakeContextCurrent(NULL);
	alcDestroyContext(context);
	alcCloseDevice(device);
}
开发者ID:CovertIII,项目名称:Tron-Clone,代码行数:7,代码来源:main_client.c


示例10: alcGetCurrentContext

	void CaptureThread::initializeSound()
	{
		
		_pContext = NULL;
		_pDevice = NULL;	

		// Check for Capture Extension support
		_pContext = alcGetCurrentContext();
		_pDevice = alcGetContextsDevice( _pContext );
		if( alcIsExtensionPresent( _pDevice, "ALC_EXT_CAPTURE") == AL_FALSE ) {
			return;
		}

		// Get list of available Capture Devices
		const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
		if ( pDeviceList )
		{
			while (*pDeviceList)
			{
				pDeviceList += strlen(pDeviceList) + 1;
			}
		}

		// Get the name of the 'default' capture device
		_szDefaultCaptureDevice = alcGetString( NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER );

		//pCaptureDevice = alcCaptureOpenDevice( szDefaultCaptureDevice, 44100, AL_FORMAT_MONO16, BUFFERSIZE );
		this->changeDevice( QString( _szDefaultCaptureDevice ) );
	}
开发者ID:Cnotinfor,项目名称:TopQX_Sound,代码行数:29,代码来源:capturethread.cpp


示例11: alcGetContextsDevice

// virtual
std::string LLAudioEngine_OpenAL::getDriverName(bool verbose)
{
	ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext());
	std::ostringstream version;

	version <<
		"OpenAL";

	if (verbose)
	{
		version <<
			", version " <<
			ll_safe_string(alGetString(AL_VERSION)) <<
			" / " <<
			ll_safe_string(alGetString(AL_VENDOR)) <<
			" / " <<
			ll_safe_string(alGetString(AL_RENDERER));
		
		if (device)
			version <<
				": " <<
				ll_safe_string(alcGetString(device,
				    ALC_DEFAULT_DEVICE_SPECIFIER));
	}

	return version.str();
}
开发者ID:Nora28,项目名称:imprudence,代码行数:28,代码来源:audioengine_openal.cpp


示例12: _releaseALData

//Cleanup of OPENAL system
void SoundManager::_releaseAL()
{
	bool success = true;

	SingletonLogMgr::Instance()->AddNewLine("SoundManager::releaseAL","Releasing sound system..",LOGNORMAL);
	
	//Clear all data
	_releaseALData();
	
	ALCcontext* pCurContext;
	ALCdevice* pCurDevice;

	// Get the current context.
	pCurContext = alcGetCurrentContext();

	// Get the device used by that context.
	pCurDevice = alcGetContextsDevice(pCurContext);

	// Reset the current context to NULL.
	if(!alcMakeContextCurrent(NULL))
		success = false;

	// Release the context and the device.
	alcDestroyContext(pCurContext);
	
	if(!alcCloseDevice(pCurDevice))
		success = false;
	
	if(!success)
		SingletonLogMgr::Instance()->AddNewLine("SoundManager::releaseAL","Sound system released INCORRECLY",LOGEXCEPTION);
	else
		SingletonLogMgr::Instance()->AddNewLine("SoundManager::releaseAL","Sound system released correctly",LOGNORMAL);
	
}
开发者ID:DarthMike,项目名称:Monkey-Madness,代码行数:35,代码来源:SoundManager.cpp


示例13: alDeleteSources

//Function to clean and delete sound files
void Openal::clean_al()
{
	//clear source 
	alDeleteSources(1, &alSource[0]);
	alDeleteSources(1, &alSource[1]);
	alDeleteSources(1, &alSource[2]);
	alDeleteSources(1, &alSource[3]);
	alDeleteSources(1, &alSource[4]);
	alDeleteSources(1, &alSource[5]);


	//clear buffer
	alDeleteBuffers(1, &alBuffer0);
	alDeleteBuffers(1, &alBuffer1);
	alDeleteBuffers(1, &alBuffer2);
	alDeleteBuffers(1, &alBuffer3);
	alDeleteBuffers(1, &alBuffer4);
	alDeleteBuffers(1, &alBuffer5);
	
	for (int i = 0; i < 5; i++) {
		alDeleteSources(1, &dinoSour[i]);
		alDeleteBuffers(1, &dinoBuff[i]);
	}

	ALCcontext *Context = alcGetCurrentContext();
	ALCdevice *Device = alcGetContextsDevice(Context);
	alcMakeContextCurrent(NULL);
	alcDestroyContext(Context);
	alcCloseDevice(Device);
}
开发者ID:cs335fps,项目名称:p,代码行数:31,代码来源:lizandroP.cpp


示例14: alSourceStop

COpenALSound::~COpenALSound()
{
	for (int i = 0; i < maxSounds; i++) {
		alSourceStop(Sources[i]);
		alDeleteSources(1,&Sources[i]);
	}
	delete[] Sources;
	map<string, ALuint>::iterator it;
	for (it = soundMap.begin(); it != soundMap.end(); ++it) {
		alDeleteBuffers(1, &it->second);
	}
	ALCcontext *curcontext = alcGetCurrentContext();
	ALCdevice *curdevice = alcGetContextsDevice(curcontext);
	alcSuspendContext(curcontext);
	/*
	 * FIXME
	 * Technically you're supposed to detach and destroy the
	 * current context with these two lines, but it deadlocks.
	 * As a not-quite-as-clean shortcut, if we skip this step
	 * and just close the device, OpenAL theoretically
	 * destroys the context associated with that device.
	 *
	 * alcMakeContextCurrent(NULL);
	 * alcDestroyContext(curcontext);
	 */
	/*
	 * FIXME
	 * Technically you're supposed to close the device, but
	 * the OpenAL sound thread crashes if we do this manually.
	 * The device seems to be closed automagically anyway.
	 *
	 *  alcCloseDevice(curdevice);
	 */
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:34,代码来源:OpenALSound.cpp


示例15: _alutSanityCheck

ALboolean
_alutSanityCheck (void)
{
  ALCcontext *context;

  if (initialisationState == Unintialized)
    {
      _alutSetError (ALUT_ERROR_INVALID_OPERATION);
      return AL_FALSE;
    }

  context = alcGetCurrentContext ();
  if (context == NULL)
    {
      _alutSetError (ALUT_ERROR_NO_CURRENT_CONTEXT);
      return AL_FALSE;
    }

  if (alGetError () != AL_NO_ERROR)
    {
      _alutSetError (ALUT_ERROR_AL_ERROR_ON_ENTRY);
      return AL_FALSE;
    }

  if (alcGetError (alcGetContextsDevice (context)) != ALC_NO_ERROR)
    {
      _alutSetError (ALUT_ERROR_ALC_ERROR_ON_ENTRY);
      return AL_FALSE;
    }

  return AL_TRUE;
}
开发者ID:AlphaO,项目名称:Starfox,代码行数:32,代码来源:alutInit.c


示例16: alSourceStop

void HGE_Impl::_SoundDone()
{
	CStreamList *stmItem=streams, *stmNext;

	if(hOpenAL)
	{
		for (int i = 0; i < sidcount; i++)
			alSourceStop(sids[i]);
		alDeleteSources(sidcount, sids);
		sidcount = 0;
		memset(sids, '\0', sizeof (sids));

		ALCcontext *ctx = alcGetCurrentContext();
		ALCdevice *dev = alcGetContextsDevice(ctx);
		alcMakeContextCurrent(NULL);
		alcSuspendContext(ctx);
		alcDestroyContext(ctx);
		alcCloseDevice(dev);

		hOpenAL=0;

		while(stmItem)
		{
			stmNext=stmItem->next;
			Resource_Free(stmItem->data);
			delete stmItem;
			stmItem=stmNext;
		}
		streams=0;
	}
}
开发者ID:Valloric,项目名称:hge-multi,代码行数:31,代码来源:sound_openal.cpp


示例17: printALCInfo

static void
printALCInfo (void)
{
  ALCint major, minor;
  ALCdevice *device;

  if (alcIsExtensionPresent (NULL, (const ALCchar *) "ALC_ENUMERATION_EXT") ==
      AL_TRUE)
    {
      printDevices (ALC_DEVICE_SPECIFIER, "");
      printDevices (ALC_CAPTURE_DEVICE_SPECIFIER, "capture ");
    }
  else
    {
      printf ("no device enumeration available\n");
    }

  device = alcGetContextsDevice (alcGetCurrentContext ());
  checkForErrors ();

  printf ("default device: %s\n",
          getStringALC (device, ALC_DEFAULT_DEVICE_SPECIFIER));

  printf ("default capture device: %s\n",
          getStringALC (device, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));

  alcGetIntegerv (device, ALC_MAJOR_VERSION, 1, &major);
  alcGetIntegerv (device, ALC_MAJOR_VERSION, 1, &minor);
  checkForErrors ();
  printf ("ALC version: %d.%d\n", (int) major, (int) minor);

  printExtensions ("ALC extensions", ' ',
                   getStringALC (device, ALC_EXTENSIONS));
}
开发者ID:JyothishM,项目名称:openal-svn-mirror,代码行数:34,代码来源:openal-info.c


示例18: alcGetCurrentContext

ALboolean QOpenALEngine::ALFWIsEFXSupported()
{
    ALCdevice *pDevice = NULL;
    ALCcontext *pContext = NULL;
    ALboolean bEFXSupport = AL_FALSE;

    pContext = alcGetCurrentContext();
    pDevice = alcGetContextsDevice(pContext);

    if (alcIsExtensionPresent(pDevice, (ALCchar*)ALC_EXT_EFX_NAME))
    {
        // Get function pointers
        alGenEffects = (LPALGENEFFECTS)alGetProcAddress("alGenEffects");
        alDeleteEffects = (LPALDELETEEFFECTS )alGetProcAddress("alDeleteEffects");
        alIsEffect = (LPALISEFFECT )alGetProcAddress("alIsEffect");
        alEffecti = (LPALEFFECTI)alGetProcAddress("alEffecti");
        alEffectiv = (LPALEFFECTIV)alGetProcAddress("alEffectiv");
        alEffectf = (LPALEFFECTF)alGetProcAddress("alEffectf");
        alEffectfv = (LPALEFFECTFV)alGetProcAddress("alEffectfv");
        alGetEffecti = (LPALGETEFFECTI)alGetProcAddress("alGetEffecti");
        alGetEffectiv = (LPALGETEFFECTIV)alGetProcAddress("alGetEffectiv");
        alGetEffectf = (LPALGETEFFECTF)alGetProcAddress("alGetEffectf");
        alGetEffectfv = (LPALGETEFFECTFV)alGetProcAddress("alGetEffectfv");
        alGenFilters = (LPALGENFILTERS)alGetProcAddress("alGenFilters");
        alDeleteFilters = (LPALDELETEFILTERS)alGetProcAddress("alDeleteFilters");
        alIsFilter = (LPALISFILTER)alGetProcAddress("alIsFilter");
        alFilteri = (LPALFILTERI)alGetProcAddress("alFilteri");
        alFilteriv = (LPALFILTERIV)alGetProcAddress("alFilteriv");
        alFilterf = (LPALFILTERF)alGetProcAddress("alFilterf");
        alFilterfv = (LPALFILTERFV)alGetProcAddress("alFilterfv");
        alGetFilteri = (LPALGETFILTERI )alGetProcAddress("alGetFilteri");
        alGetFilteriv= (LPALGETFILTERIV )alGetProcAddress("alGetFilteriv");
        alGetFilterf = (LPALGETFILTERF )alGetProcAddress("alGetFilterf");
        alGetFilterfv= (LPALGETFILTERFV )alGetProcAddress("alGetFilterfv");
        alGenAuxiliaryEffectSlots = (LPALGENAUXILIARYEFFECTSLOTS)alGetProcAddress("alGenAuxiliaryEffectSlots");
        alDeleteAuxiliaryEffectSlots = (LPALDELETEAUXILIARYEFFECTSLOTS)alGetProcAddress("alDeleteAuxiliaryEffectSlots");
        alIsAuxiliaryEffectSlot = (LPALISAUXILIARYEFFECTSLOT)alGetProcAddress("alIsAuxiliaryEffectSlot");
        alAuxiliaryEffectSloti = (LPALAUXILIARYEFFECTSLOTI)alGetProcAddress("alAuxiliaryEffectSloti");
        alAuxiliaryEffectSlotiv = (LPALAUXILIARYEFFECTSLOTIV)alGetProcAddress("alAuxiliaryEffectSlotiv");
        alAuxiliaryEffectSlotf = (LPALAUXILIARYEFFECTSLOTF)alGetProcAddress("alAuxiliaryEffectSlotf");
        alAuxiliaryEffectSlotfv = (LPALAUXILIARYEFFECTSLOTFV)alGetProcAddress("alAuxiliaryEffectSlotfv");
        alGetAuxiliaryEffectSloti = (LPALGETAUXILIARYEFFECTSLOTI)alGetProcAddress("alGetAuxiliaryEffectSloti");
        alGetAuxiliaryEffectSlotiv = (LPALGETAUXILIARYEFFECTSLOTIV)alGetProcAddress("alGetAuxiliaryEffectSlotiv");
        alGetAuxiliaryEffectSlotf = (LPALGETAUXILIARYEFFECTSLOTF)alGetProcAddress("alGetAuxiliaryEffectSlotf");
        alGetAuxiliaryEffectSlotfv = (LPALGETAUXILIARYEFFECTSLOTFV)alGetProcAddress("alGetAuxiliaryEffectSlotfv");

        if (alGenEffects &&	alDeleteEffects && alIsEffect && alEffecti && alEffectiv &&	alEffectf &&
                alEffectfv && alGetEffecti && alGetEffectiv && alGetEffectf && alGetEffectfv &&	alGenFilters &&
                alDeleteFilters && alIsFilter && alFilteri && alFilteriv &&	alFilterf && alFilterfv &&
                alGetFilteri &&	alGetFilteriv && alGetFilterf && alGetFilterfv && alGenAuxiliaryEffectSlots &&
                alDeleteAuxiliaryEffectSlots &&	alIsAuxiliaryEffectSlot && alAuxiliaryEffectSloti &&
                alAuxiliaryEffectSlotiv && alAuxiliaryEffectSlotf && alAuxiliaryEffectSlotfv &&
                alGetAuxiliaryEffectSloti && alGetAuxiliaryEffectSlotiv && alGetAuxiliaryEffectSlotf &&
                alGetAuxiliaryEffectSlotfv)
            bEFXSupport = AL_TRUE;
    }

    return bEFXSupport;
}
开发者ID:shujaatak,项目名称:QFFmpeg,代码行数:59,代码来源:QOpenALEngine.cpp


示例19: alcGetCurrentContext

	void Audio::Cleanup()
	{
		ALCcontext *alcContext = alcGetCurrentContext();
		ALCdevice *alcDevice = alcGetContextsDevice(alcContext);
		alcMakeContextCurrent(NULL);
		alcDestroyContext(alcContext);
		alcCloseDevice(alcDevice);
	}
开发者ID:Boushi,项目名称:centhra-engine,代码行数:8,代码来源:Audio.cpp


示例20: ShutdownOpenAL

void ShutdownOpenAL(void) {
    ALCcontext *Context = alcGetCurrentContext();
    ALCdevice *Device = alcGetContextsDevice(Context);

    alcMakeContextCurrent(NULL);
    alcDestroyContext(Context);
    alcCloseDevice(Device);
}
开发者ID:vincentdoba,项目名称:LPlayer,代码行数:8,代码来源:gui.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ alcGetCurrentContext函数代码示例发布时间:2022-05-30
下一篇:
C++ alcDestroyContext函数代码示例发布时间: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