Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PSoundChannelDirectSound::Close (  ) [virtual]

Close the channel, shutting down the link to the data source.

Returns:
TRUE if the channel successfully closed.

Reimplemented from PChannel.

Definition at line 368 of file sound_directsound.cxx.

Referenced by Open().

{

  PTRACE (4, "PSoundChannelDirectSound Closing " << ((mDirection == Player) ? "Playback" : "Recording") << ") Channel");
  
  PWaitAndSignal mutex(bufferMutex);
  switch (mDirection) 
    {

    case Player:
      if (mAudioPlaybackBuffer)
      mAudioPlaybackBuffer->Stop ();
      SAFE_RELEASE(mAudioPlaybackBuffer);
      SAFE_RELEASE(mAudioPrimaryPlaybackBuffer);
      SAFE_RELEASE(sAudioPlaybackDevice);
      break;

    case Recorder:
      if (mAudioCaptureBuffer)
      mAudioCaptureBuffer->Stop ();
      SAFE_RELEASE(mAudioCaptureBuffer);
      SAFE_RELEASE(sAudioCaptureDevice);
      break;
    }
  isInitialised = false;
  return TRUE;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index