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


C++ IDirectSound_Release函数代码示例

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


在下文中一共展示了IDirectSound_Release函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: FreeSound

/*
	FreeSound
*/
void
FreeSound (void)
{
	int         i;

	if (pDSBuf) {
		IDirectSoundBuffer_Stop (pDSBuf);
		IDirectSound_Release (pDSBuf);
	}
// only release primary buffer 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);
	}

	if (hWaveOut) {
		waveOutReset (hWaveOut);

		if (lpWaveHdr) {
			for (i = 0; i < WAV_BUFFERS; i++)
				waveOutUnprepareHeader (hWaveOut, lpWaveHdr + i,
										sizeof (WAVEHDR));
		}

		waveOutClose (hWaveOut);

		if (hWaveHdr) {
			GlobalUnlock (hWaveHdr);
			GlobalFree (hWaveHdr);
		}

		if (hData) {
			GlobalUnlock (hData);
			GlobalFree (hData);
		}

	}

	pDS = NULL;
	pDSBuf = NULL;
	pDSPBuf = NULL;
	hWaveOut = 0;
	hData = 0;
	hWaveHdr = 0;
	lpData = NULL;
	lpWaveHdr = NULL;
	dsound_init = false;
	wav_init = false;
}
开发者ID:luaman,项目名称:qforge-newtree,代码行数:56,代码来源:snd_win.c

示例4: 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

示例5: IDirectSound_Release

void sound_direct_sound::dsound_kill()
{
	// release the object
	if (dsound != NULL)
		IDirectSound_Release(dsound);
	dsound = NULL;
}
开发者ID:MisterTea,项目名称:MAMEHub,代码行数:7,代码来源:direct_sound.c

示例6: 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

示例7: 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

示例8: digi_close

void digi_close(void) {
	if(digi_initialised){
		digi_reset_digi_sounds();
		IDirectSound_Release(lpds);
	}
	digi_initialised = 0;
}
开发者ID:Ringdingcoder,项目名称:d1x,代码行数:7,代码来源:digi.c

示例9: dsound_kill

static void dsound_kill(void)
{
	// release the object
	if (dsound)
		IDirectSound_Release(dsound);
	dsound = NULL;
}
开发者ID:chrisjubb,项目名称:pinmame,代码行数:7,代码来源:sound.c

示例10: 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

示例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 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

示例12: 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

示例13: DSoundOpenPlayback

static ALCboolean DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
{
    DSoundData *pData = NULL;
    LPGUID guid = NULL;
    HRESULT hr;

    if(!DSoundLoad())
        return ALC_FALSE;

    if(!deviceName)
        deviceName = dsDevice;
    else if(strcmp(deviceName, dsDevice) != 0)
    {
        ALuint i;

        if(!DeviceList)
        {
            hr = pDirectSoundEnumerateA(DSoundEnumDevices, NULL);
            if(FAILED(hr))
                AL_PRINT("Error enumerating DirectSound devices (%#x)!\n", (unsigned int)hr);
        }

        for(i = 0; i < NumDevices; i++)
        {
            if(strcmp(deviceName, DeviceList[i].name) == 0)
            {
                if(i > 0)
                    guid = &DeviceList[i].guid;
                break;
            }
        }
        if(i == NumDevices)
            return ALC_FALSE;
    }

    //Initialise requested device
    pData = calloc(1, sizeof(DSoundData));
    if(!pData)
    {
        alcSetError(device, ALC_OUT_OF_MEMORY);
        return ALC_FALSE;
    }

    //DirectSound Init code
    hr = pDirectSoundCreate(guid, &pData->lpDS, NULL);
    if(SUCCEEDED(hr))
        hr = IDirectSound_SetCooperativeLevel(pData->lpDS, GetForegroundWindow(), DSSCL_PRIORITY);
    if(FAILED(hr))
    {
        if(pData->lpDS)
            IDirectSound_Release(pData->lpDS);
        free(pData);
        AL_PRINT("Device init failed: 0x%08lx\n", hr);
        return ALC_FALSE;
    }

    device->szDeviceName = strdup(deviceName);
    device->ExtraData = pData;
    return ALC_TRUE;
}
开发者ID:Genesis-3D,项目名称:Genesis-3D,代码行数:60,代码来源:dsound.c

示例14: tdav_consumer_dsound_dtor

/* destructor */
static tsk_object_t* tdav_consumer_dsound_dtor(tsk_object_t * self)
{ 
	tdav_consumer_dsound_t *dsound = self;
	if(dsound){
		tsk_size_t i;

		/* stop */
		if(dsound->started){
			tdav_consumer_dsound_stop(self);
		}

		/* deinit base */
		tdav_consumer_audio_deinit(TDAV_CONSUMER_AUDIO(dsound));
		/* deinit self */
		// Delete secondary buffer
		if(dsound->primaryBuffer){
			IDirectSoundBuffer_Release(dsound->primaryBuffer);
		}
		if(dsound->secondaryBuffer){
			IDirectSoundBuffer_Release(dsound->secondaryBuffer);
		}
		if(dsound->device){
			IDirectSound_Release(dsound->device);
		}
		for(i = 0; i<sizeof(dsound->notifEvents)/sizeof(HANDLE); i++){
			if(dsound->notifEvents[i]){
				CloseHandle(dsound->notifEvents[i]);
			}
		}
	}

	return self;
}
开发者ID:NewComerBH,项目名称:doubango,代码行数:34,代码来源:tdav_consumer_dsound.c

示例15: 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


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