New API for sf::Thread (more flexible)

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1685 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-11-20 13:00:19 +00:00
parent 7ebf2f1bbb
commit e73d274d86
8 changed files with 263 additions and 105 deletions

View file

@ -39,7 +39,7 @@ namespace sf
/// \brief Abstract base class for streamed audio sources
///
////////////////////////////////////////////////////////////
class SFML_API SoundStream : public SoundSource, private Thread
class SFML_API SoundStream : public SoundSource
{
public :
@ -208,7 +208,7 @@ private :
/// only when the sound is stopped.
///
////////////////////////////////////////////////////////////
virtual void Run();
void Stream();
////////////////////////////////////////////////////////////
/// \brief Request a new chunk of audio samples from the stream source
@ -279,6 +279,7 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Thread myThread; ///< Thread running the background tasks
bool myIsStreaming; ///< Streaming state (true = playing, false = stopped)
unsigned int myBuffers[BuffersCount]; ///< Sound buffers used to store temporary audio data
unsigned int myChannelsCount; ///< Number of channels (1 = mono, 2 = stereo, ...)