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

@ -38,7 +38,7 @@ namespace sf
/// \brief Abstract base class for capturing sound data
///
////////////////////////////////////////////////////////////
class SFML_API SoundRecorder : private Thread
class SFML_API SoundRecorder
{
public :
@ -157,7 +157,7 @@ private :
/// only when the capture is stopped.
///
////////////////////////////////////////////////////////////
virtual void Run();
void Record();
////////////////////////////////////////////////////////////
/// \brief Get the new available audio samples and process them
@ -180,6 +180,7 @@ private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Thread myThread; ///< Thread running the background recording task
std::vector<Int16> mySamples; ///< Buffer to store captured samples
unsigned int mySampleRate; ///< Sample rate
bool myIsCapturing; ///< Capturing state