本文整理汇总了C++中IDirectSoundBuffer_Stop函数的典型用法代码示例。如果您正苦于以下问题:C++ IDirectSoundBuffer_Stop函数的具体用法?C++ IDirectSoundBuffer_Stop怎么用?C++ IDirectSoundBuffer_Stop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IDirectSoundBuffer_Stop函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: RemoveSound
void RemoveSound(void)
{
int iRes;
if(iDoRecord) RecordStop();
if(lpDSBSECONDARY1!=NULL)
{
IDirectSoundBuffer_Stop(lpDSBSECONDARY1);
iRes=IDirectSoundBuffer_Release(lpDSBSECONDARY1);
// FF says such a loop is bad... Demo says it's good... Pete doesn't care
while(iRes!=0) iRes=IDirectSoundBuffer_Release(lpDSBSECONDARY1);
lpDSBSECONDARY1=NULL;
}
if(lpDSBPRIMARY!=NULL)
{
IDirectSoundBuffer_Stop(lpDSBPRIMARY);
iRes=IDirectSoundBuffer_Release(lpDSBPRIMARY);
// FF says such a loop is bad... Demo says it's good... Pete doesn't care
while(iRes!=0) iRes=IDirectSoundBuffer_Release(lpDSBPRIMARY);
lpDSBPRIMARY=NULL;
}
if(lpDS!=NULL)
{
iRes=IDirectSound_Release(lpDS);
// FF says such a loop is bad... Demo says it's good... Pete doesn't care
while(iRes!=0) iRes=IDirectSound_Release(lpDS);
lpDS=NULL;
}
}
开发者ID:madnessw,项目名称:thesnow,代码行数:33,代码来源:dsound.c
示例2: m1sdr_Exit
void m1sdr_Exit(void)
{
if (!s32SoundEnable)
{
return;
}
if (lpSecB)
{
IDirectSoundBuffer_Stop(lpSecB);
IDirectSoundBuffer_Release(lpSecB);
lpSecB = NULL;
}
if (lpPDSB)
{
IDirectSoundBuffer_Stop(lpPDSB);
IDirectSoundBuffer_Release(lpPDSB);
lpPDSB = NULL;
}
if (lpDS)
{
IDirectSound_Release(lpDS);
lpDS = NULL;
}
if (samples)
{
free(samples);
}
}
开发者ID:dreiss,项目名称:M1-Android,代码行数:32,代码来源:dsnd.cpp
示例3: DS_Exit
static void DS_Exit(void)
{
DWORD statusInfo;
if(updateBufferHandle) {
/* Signal thread to exit and wait for the exit */
if (threadInUse) {
threadInUse = 0;
MUTEX_UNLOCK(vars);
SetEvent (notifyUpdateHandle);
WaitForSingleObject (updateBufferHandle, INFINITE);
MUTEX_LOCK(vars);
}
CloseHandle(updateBufferHandle),
updateBufferHandle = NULL;
}
if (notifyUpdateHandle) {
CloseHandle(notifyUpdateHandle),
notifyUpdateHandle = NULL;
}
if (pSoundBufferNotify) {
IDirectSoundNotify_Release(pSoundBufferNotify);
pSoundBufferNotify = NULL;
}
if(pSoundBuffer) {
if(IDirectSoundBuffer_GetStatus(pSoundBuffer,&statusInfo)==DS_OK)
if(statusInfo&DSBSTATUS_PLAYING)
IDirectSoundBuffer_Stop(pSoundBuffer);
IDirectSoundBuffer_Release(pSoundBuffer);
pSoundBuffer = NULL;
}
if(pPrimarySoundBuffer) {
if(IDirectSoundBuffer_GetStatus(pPrimarySoundBuffer,&statusInfo)==DS_OK)
if(statusInfo&DSBSTATUS_PLAYING)
IDirectSoundBuffer_Stop(pPrimarySoundBuffer);
IDirectSoundBuffer_Release(pPrimarySoundBuffer);
pPrimarySoundBuffer = NULL;
}
if (pSoundCard) {
IDirectSound_Release(pSoundCard);
pSoundCard = NULL;
}
VC_Exit();
}
开发者ID:OS2World,项目名称:LIB-SDL-2014,代码行数:49,代码来源:drv_ds.c
示例4: Stop
/**
* Closes the audio device.
*/
static HRESULT Stop( aout_stream_sys_t *p_sys )
{
vlc_mutex_lock( &p_sys->lock );
p_sys->b_playing = true;
vlc_cond_signal( &p_sys->cond );
vlc_mutex_unlock( &p_sys->lock );
vlc_cancel( p_sys->eraser_thread );
vlc_join( p_sys->eraser_thread, NULL );
vlc_cond_destroy( &p_sys->cond );
vlc_mutex_destroy( &p_sys->lock );
if( p_sys->p_notify != NULL )
{
IDirectSoundNotify_Release(p_sys->p_notify );
p_sys->p_notify = NULL;
}
if( p_sys->p_dsbuffer != NULL )
{
IDirectSoundBuffer_Stop( p_sys->p_dsbuffer );
IDirectSoundBuffer_Release( p_sys->p_dsbuffer );
p_sys->p_dsbuffer = NULL;
}
if( p_sys->p_dsobject != NULL )
{
IDirectSound_Release( p_sys->p_dsobject );
p_sys->p_dsobject = NULL;
}
return DS_OK;
}
开发者ID:videolan,项目名称:vlc,代码行数:32,代码来源:directsound.c
示例5: FreeSound
static void
FreeSound (void)
{
if (pDSBuf) {
IDirectSoundBuffer_Stop (pDSBuf);
IDirectSound_Release (pDSBuf);
}
// release primary buffer only if it's not also the mixing buffer we just released
if (pDSPBuf && (pDSBuf != pDSPBuf)) {
IDirectSound_Release (pDSPBuf);
}
if (pDS) {
IDirectSound_SetCooperativeLevel (pDS, mainwindow, DSSCL_NORMAL);
IDirectSound_Release (pDS);
}
pDS = NULL;
pDSBuf = NULL;
pDSPBuf = NULL;
hWaveOut = 0;
hData = 0;
hWaveHdr = 0;
lpData = NULL;
lpWaveHdr = NULL;
}
开发者ID:EIREXE,项目名称:Quakeforge-gcw0,代码行数:25,代码来源:snd_dx.c
示例6: dsound_free
static void dsound_free(void *data)
{
dsound_t *ds = (dsound_t*)data;
if (ds)
{
if (ds->thread)
{
ds->thread_alive = false;
WaitForSingleObject(ds->thread, INFINITE);
CloseHandle(ds->thread);
}
DeleteCriticalSection(&ds->crit);
if (ds->dsb)
{
IDirectSoundBuffer_Stop(ds->dsb);
IDirectSoundBuffer_Release(ds->dsb);
}
if (ds->ds)
IDirectSound_Release(ds->ds);
if (ds->event)
CloseHandle(ds->event);
if (ds->buffer)
fifo_free(ds->buffer);
free(ds);
}
}
开发者ID:jonakino,项目名称:RetroArch,代码行数:32,代码来源:dsound.c
示例7: tdav_consumer_dsound_stop
int tdav_consumer_dsound_stop(tmedia_consumer_t* self)
{
tdav_consumer_dsound_t* dsound = (tdav_consumer_dsound_t*)self;
HRESULT hr;
if(!self){
TSK_DEBUG_ERROR("Invalid parameter");
return -1;
}
if(!dsound->started){
TSK_DEBUG_WARN("Consumer not started");
return 0;
}
/* should be done here */
dsound->started = tsk_false;
/* stop thread */
if(dsound->tid[0]){
tsk_thread_join(&(dsound->tid[0]));
}
if((hr = IDirectSoundBuffer_Stop(dsound->secondaryBuffer)) != DS_OK){
tdav_win32_print_error("IDirectSoundBuffer_Stop", hr);
}
if((hr = IDirectSoundBuffer_SetCurrentPosition(dsound->secondaryBuffer, 0)) != DS_OK){
tdav_win32_print_error("IDirectSoundBuffer_SetCurrentPosition", hr);
}
return 0;
}
开发者ID:NewComerBH,项目名称:doubango,代码行数:33,代码来源:tdav_consumer_dsound.c
示例8: DSoundRender_Pause
static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface)
{
HRESULT hr = S_OK;
DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
TRACE("(%p/%p)->()\n", This, iface);
EnterCriticalSection(&This->renderer.csRenderLock);
if (This->renderer.filter.state != State_Paused)
{
if (This->renderer.filter.state == State_Stopped)
{
if (This->renderer.pInputPin->pin.pConnectedTo)
ResetEvent(This->renderer.evComplete);
This->renderer.pInputPin->end_of_stream = 0;
}
hr = IDirectSoundBuffer_Stop(This->dsbuffer);
if (SUCCEEDED(hr))
This->renderer.filter.state = State_Paused;
ResetEvent(This->blocked);
ResetEvent(This->renderer.RenderEvent);
}
ResetEvent(This->renderer.ThreadSignal);
LeaveCriticalSection(&This->renderer.csRenderLock);
return hr;
}
开发者ID:reactos,项目名称:reactos,代码行数:29,代码来源:dsoundrender.c
示例9: I_UpdateSoundParams
void I_UpdateSoundParams(int channel, int vol, int sep, int pitch)
{
// proff 07/04/98: Added for CYGWIN32 compatibility
#ifdef HAVE_LIBDSOUND
int DSB_Status;
if (noDSound == true)
return;
// proff 07/26/98: Added volume check
if (vol==0)
{
IDirectSoundBuffer_Stop(lpSecondaryDSB[channel]);
return;
}
IDirectSoundBuffer_SetVolume(lpSecondaryDSB[channel],VOL(vol));
IDirectSoundBuffer_SetPan(lpSecondaryDSB[channel],SEP(sep));
IDirectSoundBuffer_SetFrequency
(lpSecondaryDSB[channel], ChannelInfo[channel].samplerate+PITCH(pitch));
if (ChannelInfo[channel].playing == true)
{
IDirectSoundBuffer_GetStatus(lpSecondaryDSB[channel], &DSB_Status);
if ((DSB_Status & DSBSTATUS_PLAYING) == 0)
IDirectSoundBuffer_Play(lpSecondaryDSB[channel], 0, 0, 0);
}
#endif // HAVE_LIBDSOUND
}
开发者ID:dorienh,项目名称:smmu,代码行数:27,代码来源:i_sound.c
示例10: delete_fluid_dsound_audio_driver
void delete_fluid_dsound_audio_driver(fluid_audio_driver_t* d)
{
fluid_dsound_audio_driver_t* dev = (fluid_dsound_audio_driver_t*) d;
fluid_return_if_fail(dev != NULL);
/* tell the audio thread to stop its loop */
dev->cont = 0;
/* wait till the audio thread exits */
if (dev->thread != 0) {
if (WaitForSingleObject(dev->thread, 2000) != WAIT_OBJECT_0) {
/* on error kill the thread mercilessly */
FLUID_LOG(FLUID_DBG, "Couldn't join the audio thread. killing it.");
TerminateThread(dev->thread, 0);
}
}
/* release all the allocated ressources */
FLUID_FREE(dev->format);
if (dev->sec_buffer != NULL) {
IDirectSoundBuffer_Stop(dev->sec_buffer);
IDirectSoundBuffer_Release(dev->sec_buffer);
}
if (dev->prim_buffer != NULL) {
IDirectSoundBuffer_Release(dev->prim_buffer);
}
if (dev->direct_sound != NULL) {
IDirectSound_Release(dev->direct_sound);
}
FLUID_FREE(dev);
}
开发者ID:nezticle,项目名称:fluidsynth,代码行数:34,代码来源:fluid_dsound.c
示例11: DSW_Term
void DSW_Term( DSoundWrapper *dsw )
{
// Cleanup the sound buffers
if (dsw->dsw_OutputBuffer)
{
IDirectSoundBuffer_Stop( dsw->dsw_OutputBuffer );
IDirectSoundBuffer_Release( dsw->dsw_OutputBuffer );
dsw->dsw_OutputBuffer = NULL;
}
if (dsw->dsw_InputBuffer)
{
IDirectSoundCaptureBuffer_Stop( dsw->dsw_InputBuffer );
IDirectSoundCaptureBuffer_Release( dsw->dsw_InputBuffer );
dsw->dsw_InputBuffer = NULL;
}
if (dsw->dsw_pDirectSoundCapture)
{
IDirectSoundCapture_Release( dsw->dsw_pDirectSoundCapture );
dsw->dsw_pDirectSoundCapture = NULL;
}
if (dsw->dsw_pDirectSound)
{
IDirectSound_Release( dsw->dsw_pDirectSound );
dsw->dsw_pDirectSound = NULL;
}
}
开发者ID:BackupTheBerlios,项目名称:reshaked-svn,代码行数:29,代码来源:dsound_wrapper.c
示例12: MCICDA_Pause
/**************************************************************************
* MCICDA_Pause [internal]
*/
static DWORD MCICDA_Pause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{
WINE_MCICDAUDIO* wmcda = MCICDA_GetOpenDrv(wDevID);
HANDLE oldcb;
DWORD br;
TRACE("(%04X, %08X, %p);\n", wDevID, dwFlags, lpParms);
if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID;
oldcb = InterlockedExchangePointer(&wmcda->hCallback, NULL);
if (oldcb) mciDriverNotify(oldcb, wmcda->wNotifyDeviceID, MCI_NOTIFY_ABORTED);
if (wmcda->hThread != 0) {
/* Don't bother calling stop if the playLoop thread has already stopped */
if(WaitForSingleObject(wmcda->stopEvent, 0) != WAIT_OBJECT_0 &&
FAILED(IDirectSoundBuffer_Stop(wmcda->dsBuf)))
return MCIERR_HARDWARE;
}
else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL))
return MCIERR_HARDWARE;
if ((dwFlags & MCI_NOTIFY) && lpParms)
MCICDA_Notify(lpParms->dwCallback, wmcda, MCI_NOTIFY_SUCCESSFUL);
return 0;
}
开发者ID:MichaelMcDonnell,项目名称:wine,代码行数:29,代码来源:mcicda.c
示例13: dsound_free
static void dsound_free(void *data)
{
dsound_t *ds = (dsound_t*)data;
if (!ds)
return;
if (ds->thread)
{
ds->thread_alive = false;
sthread_join(ds->thread);
}
DeleteCriticalSection(&ds->crit);
if (ds->dsb)
{
IDirectSoundBuffer_Stop(ds->dsb);
IDirectSoundBuffer_Release(ds->dsb);
}
if (ds->ds)
IDirectSound_Release(ds->ds);
if (ds->event)
CloseHandle(ds->event);
if (ds->buffer)
fifo_free(ds->buffer);
free(ds);
}
开发者ID:Joonie86,项目名称:RetroArch,代码行数:32,代码来源:dsound.c
示例14: DS_PlayStop
static void DS_PlayStop(void)
{
do_update = 0;
if (pSoundBuffer)
IDirectSoundBuffer_Stop(pSoundBuffer);
VC_PlayStop();
}
开发者ID:OS2World,项目名称:LIB-SDL-2014,代码行数:7,代码来源:drv_ds.c
示例15: DSoundRender_Stop
static HRESULT WINAPI DSoundRender_Stop(IBaseFilter * iface)
{
HRESULT hr = S_OK;
DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
TRACE("(%p/%p)->()\n", This, iface);
EnterCriticalSection(&This->filter.csFilter);
{
DWORD state = 0;
if (This->dsbuffer)
{
hr = IDirectSoundBuffer_GetStatus(This->dsbuffer, &state);
if (SUCCEEDED(hr))
{
if (state & DSBSTATUS_PLAYING)
hr = IDirectSoundBuffer_Stop(This->dsbuffer);
}
}
if (SUCCEEDED(hr))
This->filter.state = State_Stopped;
/* Complete our transition */
SetEvent(This->state_change);
SetEvent(This->blocked);
MediaSeekingPassThru_ResetMediaTime(This->seekthru_unk);
}
LeaveCriticalSection(&This->filter.csFilter);
return hr;
}
开发者ID:r6144,项目名称:wine,代码行数:31,代码来源:dsoundrender.c
示例16: DSW_Term
void DSW_Term( DSoundWrapper *dsw )
{
// Cleanup the sound buffers
if (dsw->dsw_OutputBuffer)
{
IDirectSoundBuffer_Stop( dsw->dsw_OutputBuffer );
IDirectSoundBuffer_Release( dsw->dsw_OutputBuffer );
dsw->dsw_OutputBuffer = NULL;
}
#if SUPPORT_AUDIO_CAPTURE
if (dsw->dsw_InputBuffer)
{
IDirectSoundCaptureBuffer_Stop( dsw->dsw_InputBuffer );
IDirectSoundCaptureBuffer_Release( dsw->dsw_InputBuffer );
dsw->dsw_InputBuffer = NULL;
}
if (dsw->dsw_pDirectSoundCapture)
{
IDirectSoundCapture_Release( dsw->dsw_pDirectSoundCapture );
dsw->dsw_pDirectSoundCapture = NULL;
}
#endif /* SUPPORT_AUDIO_CAPTURE */
if (dsw->dsw_pDirectSound)
{
IDirectSound_Release( dsw->dsw_pDirectSound );
dsw->dsw_pDirectSound = NULL;
}
}
开发者ID:andreipaga,项目名称:audacity,代码行数:28,代码来源:dsound_wrapper.c
示例17: DSoundRender_Pause
static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface)
{
HRESULT hr = S_OK;
DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
TRACE("(%p/%p)->()\n", This, iface);
EnterCriticalSection(&This->filter.csFilter);
if (This->filter.state != State_Paused)
{
DWORD state = 0;
if (This->filter.state == State_Stopped)
{
This->pInputPin->end_of_stream = 0;
}
if (This->dsbuffer)
{
hr = IDirectSoundBuffer_GetStatus(This->dsbuffer, &state);
if (SUCCEEDED(hr))
{
if (state & DSBSTATUS_PLAYING)
hr = IDirectSoundBuffer_Stop(This->dsbuffer);
}
}
if (SUCCEEDED(hr))
This->filter.state = State_Paused;
ResetEvent(This->blocked);
ResetEvent(This->state_change);
}
LeaveCriticalSection(&This->filter.csFilter);
return hr;
}
开发者ID:r6144,项目名称:wine,代码行数:35,代码来源:dsoundrender.c
示例18: I_StopSound
void I_StopSound(int channel)
{
// proff 07/04/98: Added for CYGWIN32 compatibility
#ifdef HAVE_LIBDSOUND
IDirectSoundBuffer_Stop(lpSecondaryDSB[channel]);
ChannelInfo[channel].playing=false;
#endif // HAVE_LIBDSOUND
}
开发者ID:dorienh,项目名称:smmu,代码行数:8,代码来源:i_sound.c
示例19: dsound_stop
static bool dsound_stop(void *data)
{
dsound_t *ds = (dsound_t*)data;
dsound_stop_thread(ds);
ds->is_paused = (IDirectSoundBuffer_Stop(ds->dsb) == DS_OK) ? true : false;
return (ds->is_paused) ? true : false;
}
开发者ID:Joonie86,项目名称:RetroArch,代码行数:9,代码来源:dsound.c
示例20: DSW_StopOutput
HRESULT DSW_StopOutput( DSoundWrapper *dsw )
{
// Stop the buffer playback
if( dsw->dsw_OutputBuffer != NULL )
{
dsw->dsw_OutputRunning = FALSE;
return IDirectSoundBuffer_Stop( dsw->dsw_OutputBuffer );
}
else return 0;
}
开发者ID:andreipaga,项目名称:audacity,代码行数:10,代码来源:dsound_wrapper.c
注:本文中的IDirectSoundBuffer_Stop函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论