当前位置: 首页>>代码示例>>C++>>正文


C++ LPDIRECTSOUND::Release方法代码示例

本文整理汇总了C++中LPDIRECTSOUND::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDIRECTSOUND::Release方法的具体用法?C++ LPDIRECTSOUND::Release怎么用?C++ LPDIRECTSOUND::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LPDIRECTSOUND的用法示例。


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

示例1: dsound_kill

void sound_direct_sound::dsound_kill()
{
	// release the object
	if (m_dsound)
		m_dsound->Release();
	m_dsound = nullptr;
}
开发者ID:bradhugh,项目名称:mame,代码行数:7,代码来源:direct_sound.cpp

示例2: ds_Release

//-----------------------------------------------------------------------------
//	Освобождение Direct Sound объекта
// на входе    :  direct   - указатель на Direct Sound объект
// на выходе   :	*
//-----------------------------------------------------------------------------
void ds_Release(LPDIRECTSOUND direct)
{
	// удаление объекта воспроизведения
	if (direct)
		direct->Release();

	// Освобождение COM
	CoUninitialize();
}
开发者ID:doveiya,项目名称:isilme,代码行数:14,代码来源:DirectSound.cpp

示例3: Release

ULONG STDMETHODCALLTYPE DirectSound::Release()
{
	ULONG result = m_ds->Release();
	if (!result)
	{
		delete this;
	}
	return result;
}
开发者ID:ThrDev,项目名称:dsbridge,代码行数:9,代码来源:DirectSound.cpp

示例4: Game_Shutdown

int Game_Shutdown(void *parms)
{
// this function is where you shutdown your game and
// release all resources that you allocated

// release the directsoundobject
if (lpds!=NULL)
   lpds->Release();


// return success
return(1);
} // end Game_Shutdown
开发者ID:calyx,项目名称:windows-game-source-code,代码行数:13,代码来源:demo10_2.cpp

示例5: DeleteDirectSoundResources

bool DeleteDirectSoundResources()
{
	if(lpDS)
	{
		lpDS->Release();
		lpDS = NULL;
		return true;
	}

	// Just incase something should go wrong.
	MessageBox(NULL, "Sound buffer freed without having been acquired.", "DirectSound Error", MB_OK | MB_ICONEXCLAMATION);
	return false;
}
开发者ID:ButchDean,项目名称:AntiVirusGame2,代码行数:13,代码来源:DirectSoundSource.cpp

示例6:

// DirectSound-Objekte freigeben
int	QuitDSound(void)
{
	if(lpDS!= NULL)
	  lpDS->Release();

	for (int i=0; i<ANZ_SOUNDS; i++) 
	{
	   if(SoundArray[i]!= NULL)
			SoundArray[i]->Release();
	}

	return 0;
}
开发者ID:perezite,项目名称:cheesy,代码行数:14,代码来源:sound.cpp

示例7: DSUtil_InitDirectSound

//-----------------------------------------------------------------------------
// Name: DSUtil_InitDirectSound()
// Desc: 
//-----------------------------------------------------------------------------
HRESULT DSUtil_InitDirectSound( HWND hWnd )
{
    if( FAILED( DirectSoundCreate( NULL, &g_pDS, NULL ) ) )
        return E_FAIL;

    if( FAILED( g_pDS->SetCooperativeLevel( hWnd, DSSCL_NORMAL ) ) )
    {
        g_pDS->Release();
        g_pDS = NULL;
        return E_FAIL;
    }

    return S_OK;
}
开发者ID:grakidov,项目名称:Render3D,代码行数:18,代码来源:dsutil.cpp

示例8: DS_Shutdown

//===========================================================================
// DS_Shutdown
//===========================================================================
void DS_Shutdown(void)
{
	if(!initOk) return;

	if(eaxListener) eaxListener->Release();
	if(dsListener) dsListener->Release();
	if(primary) primary->Release();
	if(dsound) dsound->Release();
	
	eaxListener = NULL;
	dsListener = NULL;
	primary = NULL;
	dsound = NULL;

	initOk = false;
}
开发者ID:amitahire,项目名称:development,代码行数:19,代码来源:driver_sndcmp.cpp

示例9: SNDDMA_Shutdown

/*
==================
SNDDMA_Shutdown
==================
*/
void SNDDMA_Shutdown( void ) {
	Com_DPrintf( "Shutting down sound system\n" );

	if ( pDS ) {
		Com_DPrintf( "Destroying DS buffers\n" );
		if ( pDS )
		{
			Com_DPrintf( "...setting NORMAL coop level\n" );
			// FIXME JA was DSSCL_NORMAL and Q3 says DSSCL_PRIORITY but the printf says setting normal
			pDS->SetCooperativeLevel( g_wv.hWnd, DSSCL_PRIORITY );
		}

		if ( pDSBuf )
		{
			Com_DPrintf( "...stopping and releasing sound buffer\n" );
			pDSBuf->Stop( );
			pDSBuf->Release( );
		}

		// only release primary buffer if it's not also the mixing buffer we just released
		if ( pDSPBuf && ( pDSBuf != pDSPBuf ) )
		{
			Com_DPrintf( "...releasing primary buffer\n" );
			pDSPBuf->Release( );
		}
		pDSBuf = NULL;
		pDSPBuf = NULL;

		dma.buffer = NULL;

		Com_DPrintf( "...releasing DS object\n" );
		pDS->Release( );
	}

	if ( hInstDS ) {
		Com_DPrintf( "...freeing DSOUND.DLL\n" );
		FreeLibrary( hInstDS );
		hInstDS = NULL;
	}

	pDS = NULL;
	pDSBuf = NULL;
	pDSPBuf = NULL;
	dsound_init = qfalse;
	memset ((void *)&dma, 0, sizeof (dma));
	CoUninitialize( );
}
开发者ID:deathsythe47,项目名称:jaMME,代码行数:52,代码来源:win_snd.cpp

示例10: SNDDMA_Shutdown

void SNDDMA_Shutdown() {
	common->DPrintf( "Shutting down sound system\n" );

	if ( pDS ) {
		if ( pDSBuf ) {
			common->DPrintf( "...stopping and releasing sound buffer\n" );
			pDSBuf->Stop();
			pDSBuf->Release();
		}

		common->DPrintf( "...releasing DS object\n" );
		pDS->Release();
	}

	pDS = NULL;
	pDSBuf = NULL;
	dsound_init = false;
	Com_Memset( ( void* )&dma, 0, sizeof ( dma ) );
	CoUninitialize();
}
开发者ID:janisl,项目名称:jlquake,代码行数:20,代码来源:driver_directsound.cpp

示例11: DSShutdown

int DSShutdown(void)
{
    // first turn all sounds off
    StopAllSounds();
    
    // now release all sound buffers
    for (int index = 0; index < MAX_SOUNDS; index++)
        if (sound_fx[index].dsbuffer) {
            sound_fx[index].dsbuffer->Release();
        }
        
    // now release the directsound interface itself
    if (lpDS) {
        lpDS->Release();
        lpDS = NULL;
    }
    
    // return success
    return(1);
}
开发者ID:mreiferson,项目名称:hajiworld,代码行数:20,代码来源:hwdsound.cpp

示例12: DSUtil_FreeDirectSound

//-----------------------------------------------------------------------------
// Name: DSUtil_FreeDirectSound()
// Desc: 
//-----------------------------------------------------------------------------
VOID DSUtil_FreeDirectSound()
{
    if( g_pDS )
        g_pDS->Release();
    g_pDS = NULL;
}
开发者ID:grakidov,项目名称:Render3D,代码行数:10,代码来源:dsutil.cpp

示例13: Create


//.........这里部分代码省略.........
		MMRESULT nTimer = timeSetEvent(125, 5, &TimerFunction, (DWORD)this,
										TIME_PERIODIC | TIME_CALLBACK_FUNCTION);

		if(nTimer == NULL)
		{
			CCD->ReportError("[WARNING] StreamingAudio: Timer callback set-up failed", false);
			return RGF_FAILURE;									// Timer startup failed.
		}

		m_nTimerID = nTimer;					// Save timer ID
		return RGF_SUCCESS;
	}

	mp3 = false;

	if(stricmp((szFileName+len), ".ogg") == 0)
	{
		if(Ogg != NULL)
			return RGF_FAILURE;

		Ogg = new OggAudio(m_pDS);
		Ogg->Load(szFileName);
		ogg = true;
		m_fActive = true;
		return RGF_SUCCESS;
	}

	ogg = false;

	//	start a timer for this stream.
	MMRESULT nTimer = timeSetEvent(125, 5, &TimerFunction, (DWORD)this,
						TIME_PERIODIC | TIME_CALLBACK_FUNCTION);

	if(nTimer == NULL)
	{
		CCD->ReportError("[WARNING] StreamingAudio: Timer callback set-up failed", false);
		return RGF_FAILURE;									// Timer startup failed.
	}

	m_nTimerID = nTimer;									// Save timer ID
// end change RF064

	//	Check for stream availability
	if(m_pStream != NULL)
		return RGF_FAILURE;									// Already loaded!

	// Open up the WAVE file.
	nError = WaveOpen(szFileName, &m_hWaveFile, &m_pWaveFormat,	&m_rRiffData);

	if(nError != RGF_SUCCESS)
	{
		char szBug[128];
		sprintf(szBug, "[WARNING] File %s - Line %d: Failed to open wave file '%s'\n(Note: streamig audio can't be placed in VFS)",
				__FILE__, __LINE__, szFileName);
		CCD->ReportError(szBug, false);
		return RGF_FAILURE;									// Problem here, too!
	}

	// Get current position in file, which will be the start of the
	// ..WAVE data.
	m_nDataPosition = mmioSeek(m_hWaveFile, 0, SEEK_CUR);
	m_nDataSize = m_rRiffData.cksize;						// Save data size

	// Fetch DirectSound interface we want
	LPDIRECTSOUND pDSIF;
	nError = m_pDS->QueryInterface(IID_IDirectSound, (LPVOID *)&pDSIF);

	// Create a DSound buffer to stream into
	DSBUFFERDESC theDesc;

	memset(&theDesc, 0, sizeof(DSBUFFERDESC));
	theDesc.dwSize = sizeof(DSBUFFERDESC);
	theDesc.dwBufferBytes = kBufferSize;
	theDesc.lpwfxFormat = m_pWaveFormat;
	theDesc.dwFlags = DSBCAPS_CTRLVOLUME;

	nError = pDSIF->CreateSoundBuffer(&theDesc, &m_pStream, NULL);

	pDSIF->Release();									// Done w/ this.

	if(nError != 0)										// Error!  Sick out.
	{
		char szBug[128];
		sprintf(szBug, "StreamingAudio: Failed to create buffer for '%s'\n", szFileName);
		OutputDebugString(szBug);
		mmioClose(m_hWaveFile, 0);
		m_hWaveFile = NULL;
		delete m_pWaveFormat;
		m_pWaveFormat = NULL;
		return RGF_FAILURE;
	}

	m_nOffset = 0;								// Start at top of buffer
// changed RF064
	//m_fActive = true;							// Set as active
// end change RF064
	PumpWave(kBufferSize);				// Initial buffer load

	return RGF_SUCCESS;
}
开发者ID:RealityFactory,项目名称:RealityFactory,代码行数:101,代码来源:StreamingAudio.cpp


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