Logo Search packages:      
Sourcecode: pwlib version File versions

BOOL PSound::PlayFile ( const PFilePath file,
BOOL  wait = TRUE 
) [static]

Play a sound file to the default device. If the wait# parameter is TRUE then the function does not return until the file has been played. If FALSE then the sound play is begun asynchronously and the function returns immediately.

Returns:
TRUE if the sound is playing or has played.
Parameters:
file  Sound file to play.
wait  Flag to play sound synchronously.

Definition at line 299 of file sound.cxx.

References PSoundChannel::GetDefaultDevice(), PSoundChannel::IsOpen(), and PSoundChannel::PlayFile().

{
  PSoundChannel channel(PSoundChannel::GetDefaultDevice(PSoundChannel::Player),
                        PSoundChannel::Player);
  if (!channel.IsOpen())
    return FALSE;

  return channel.PlayFile(file, wait);
}


Generated by  Doxygen 1.6.0   Back to index