mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Merge pull request #43 from zsbzsb/feature/processing_interval
Updated CSFML to support sf::SoundRecorder::setProcessingInterval(...)
This commit is contained in:
commit
9a2c8d0ecb
3 files changed
+32
No files matched your search
@@ -30,6 +30,7 @@
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Audio/Export.h>
|
#include <SFML/Audio/Export.h>
|
||||||
#include <SFML/Audio/Types.h>
|
#include <SFML/Audio/Types.h>
|
||||||
|
#include <SFML/System/Time.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -112,5 +113,24 @@ CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the processing interval
|
||||||
|
///
|
||||||
|
/// The processing interval controls the period
|
||||||
|
/// between calls to the onProcessSamples function. You may
|
||||||
|
/// want to use a small interval if you want to process the
|
||||||
|
/// recorded data in real time, for example.
|
||||||
|
///
|
||||||
|
/// Note: this is only a hint, the actual period may vary.
|
||||||
|
/// So don't rely on this parameter to implement precise timing.
|
||||||
|
///
|
||||||
|
/// The default processing interval is 100 ms.
|
||||||
|
///
|
||||||
|
/// \param soundRecorder Sound recorder object
|
||||||
|
/// \param interval Processing interval
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_AUDIO_API void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval);
|
||||||
|
|
||||||
|
|
||||||
#endif // SFML_SOUNDRECORDER_H
|
#endif // SFML_SOUNDRECORDER_H
|
||||||
@@ -73,3 +73,10 @@ sfBool sfSoundRecorder_isAvailable(void)
|
|||||||
{
|
{
|
||||||
return sf::SoundRecorder::isAvailable() ? sfTrue : sfFalse;
|
return sf::SoundRecorder::isAvailable() ? sfTrue : sfFalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval)
|
||||||
|
{
|
||||||
|
CSFML_CALL(soundRecorder, setProcessingInterval(interval));
|
||||||
|
}
|
||||||
@@ -51,6 +51,11 @@ public :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setProcessingInterval(sfTime interval)
|
||||||
|
{
|
||||||
|
sf::SoundRecorder::setProcessingInterval(sf::microseconds(interval.microseconds));
|
||||||
|
}
|
||||||
|
|
||||||
private :
|
private :
|
||||||
|
|
||||||
virtual bool onStart()
|
virtual bool onStart()
|
||||||
|
|||||||
Reference in new issue
Block a user