Corrected the name of some functions/variable
This commit is contained in:
parent
c817f882e6
commit
aaa21dfaf6
32 changed files with 203 additions and 203 deletions
|
@ -127,17 +127,17 @@ public :
|
|||
/// The assumed format of the audio samples is 16 bits signed integer
|
||||
/// (sf::Int16).
|
||||
///
|
||||
/// \param samples Pointer to the array of samples in memory
|
||||
/// \param samplesCount Number of samples in the array
|
||||
/// \param channelsCount Number of channels (1 = mono, 2 = stereo, ...)
|
||||
/// \param sampleRate Sample rate (number of samples to play per second)
|
||||
/// \param samples Pointer to the array of samples in memory
|
||||
/// \param sampleCount Number of samples in the array
|
||||
/// \param channelCount Number of channels (1 = mono, 2 = stereo, ...)
|
||||
/// \param sampleRate Sample rate (number of samples to play per second)
|
||||
///
|
||||
/// \return True if loading succeeded, false if it failed
|
||||
///
|
||||
/// \see LoadFromFile, LoadFromMemory, SaveToFile
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
bool LoadFromSamples(const Int16* samples, std::size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate);
|
||||
bool LoadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Save the sound buffer to an audio file
|
||||
|
@ -160,11 +160,11 @@ public :
|
|||
///
|
||||
/// The format of the returned samples is 16 bits signed integer
|
||||
/// (sf::Int16). The total number of samples in this array
|
||||
/// is given by the GetSamplesCount() function.
|
||||
/// is given by the GetSampleCount() function.
|
||||
///
|
||||
/// \return Read-only pointer to the array of sound samples
|
||||
///
|
||||
/// \see GetSamplesCount
|
||||
/// \see GetSampleCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
const Int16* GetSamples() const;
|
||||
|
@ -180,7 +180,7 @@ public :
|
|||
/// \see GetSamples
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
std::size_t GetSamplesCount() const;
|
||||
std::size_t GetSampleCount() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the sample rate of the sound
|
||||
|
@ -191,7 +191,7 @@ public :
|
|||
///
|
||||
/// \return Sample rate (number of samples per second)
|
||||
///
|
||||
/// \see GetChannelsCount, GetDuration
|
||||
/// \see GetChannelCount, GetDuration
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int GetSampleRate() const;
|
||||
|
@ -207,14 +207,14 @@ public :
|
|||
/// \see GetSampleRate, GetDuration
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int GetChannelsCount() const;
|
||||
unsigned int GetChannelCount() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the total duration of the sound
|
||||
///
|
||||
/// \return Sound duration, in milliseconds
|
||||
///
|
||||
/// \see GetSampleRate, GetChannelsCount
|
||||
/// \see GetSampleRate, GetChannelCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
Uint32 GetDuration() const;
|
||||
|
@ -246,13 +246,13 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Update the internal buffer with the cached audio samples
|
||||
///
|
||||
/// \param channelsCount Number of channels
|
||||
/// \param sampleRate Sample rate (number of samples per second)
|
||||
/// \param channelCount Number of channels
|
||||
/// \param sampleRate Sample rate (number of samples per second)
|
||||
///
|
||||
/// \return True on success, false if any error happened
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
bool Update(unsigned int channelsCount, unsigned int sampleRate);
|
||||
bool Update(unsigned int channelCount, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Add a sound to the list of sounds that use this buffer
|
||||
|
|
|
@ -70,13 +70,13 @@ private :
|
|||
////////////////////////////////////////////////////////////
|
||||
/// \brief Process a new chunk of recorded samples
|
||||
///
|
||||
/// \param samples Pointer to the new chunk of recorded samples
|
||||
/// \param samplesCount Number of samples pointed by \a samples
|
||||
/// \param samples Pointer to the new chunk of recorded samples
|
||||
/// \param sampleCount Number of samples pointed by \a samples
|
||||
///
|
||||
/// \return True to continue the capture, or false to stop it
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnProcessSamples(const Int16* samples, std::size_t samplesCount);
|
||||
virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Stop capturing audio data
|
||||
|
|
|
@ -131,13 +131,13 @@ private :
|
|||
/// whatever it wants with it (storing it, playing it, sending
|
||||
/// it over the network, etc.).
|
||||
///
|
||||
/// \param samples Pointer to the new chunk of recorded samples
|
||||
/// \param samplesCount Number of samples pointed by \a samples
|
||||
/// \param samples Pointer to the new chunk of recorded samples
|
||||
/// \param sampleCount Number of samples pointed by \a samples
|
||||
///
|
||||
/// \return True to continue the capture, or false to stop it
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
virtual bool OnProcessSamples(const Int16* samples, std::size_t samplesCount) = 0;
|
||||
virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount) = 0;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Stop capturing audio data
|
||||
|
@ -238,7 +238,7 @@ private :
|
|||
/// return true;
|
||||
/// }
|
||||
///
|
||||
/// virtual bool OnProcessSamples(const Int16* samples, std::size_t samplesCount)
|
||||
/// virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount)
|
||||
/// {
|
||||
/// // Do something with the new chunk of samples (store them, send them, ...)
|
||||
/// ...
|
||||
|
|
|
@ -104,7 +104,7 @@ public :
|
|||
/// \return Number of channels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int GetChannelsCount() const;
|
||||
unsigned int GetChannelCount() const;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the stream sample rate of the stream
|
||||
|
@ -193,11 +193,11 @@ protected :
|
|||
/// It can be called multiple times if the settings of the
|
||||
/// audio stream change, but only when the stream is stopped.
|
||||
///
|
||||
/// \param channelsCount Number of channels of the stream
|
||||
/// \param sampleRate Sample rate, in samples per second
|
||||
/// \param channelCount Number of channels of the stream
|
||||
/// \param sampleRate Sample rate, in samples per second
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void Initialize(unsigned int channelsCount, unsigned int sampleRate);
|
||||
void Initialize(unsigned int channelCount, unsigned int sampleRate);
|
||||
|
||||
private :
|
||||
|
||||
|
@ -245,7 +245,7 @@ private :
|
|||
/// consumed; it fills it again and inserts it back into the
|
||||
/// playing queue.
|
||||
///
|
||||
/// \param buffer Number of the buffer to fill (in [0, BuffersCount])
|
||||
/// \param buffer Number of the buffer to fill (in [0, BufferCount])
|
||||
///
|
||||
/// \return True if the stream source has requested to stop, false otherwise
|
||||
///
|
||||
|
@ -273,21 +273,21 @@ private :
|
|||
|
||||
enum
|
||||
{
|
||||
BuffersCount = 3 ///< Number of audio buffers used by the streaming loop
|
||||
BufferCount = 3 ///< Number of audio buffers used by the streaming loop
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// 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, ...)
|
||||
unsigned int mySampleRate; ///< Frequency (samples / second)
|
||||
Uint32 myFormat; ///< Format of the internal sound buffers
|
||||
bool myLoop; ///< Loop flag (true to loop, false to play once)
|
||||
Uint64 mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
|
||||
bool myEndBuffers[BuffersCount]; ///< Each buffer is marked as "end buffer" or not, for proper duration calculation
|
||||
Thread myThread; ///< Thread running the background tasks
|
||||
bool myIsStreaming; ///< Streaming state (true = playing, false = stopped)
|
||||
unsigned int myBuffers[BufferCount]; ///< Sound buffers used to store temporary audio data
|
||||
unsigned int myChannelCount; ///< Number of channels (1 = mono, 2 = stereo, ...)
|
||||
unsigned int mySampleRate; ///< Frequency (samples / second)
|
||||
Uint32 myFormat; ///< Format of the internal sound buffers
|
||||
bool myLoop; ///< Loop flag (true to loop, false to play once)
|
||||
Uint64 mySamplesProcessed; ///< Number of buffers processed since beginning of the stream
|
||||
bool myEndBuffers[BufferCount]; ///< Each buffer is marked as "end buffer" or not, for proper duration calculation
|
||||
};
|
||||
|
||||
} // namespace sf
|
||||
|
@ -338,11 +338,11 @@ private :
|
|||
/// {
|
||||
/// // Open the source and get audio settings
|
||||
/// ...
|
||||
/// unsigned int channelsCount = ...;
|
||||
/// unsigned int channelCount = ...;
|
||||
/// unsigned int sampleRate = ...;
|
||||
///
|
||||
/// // Initialize the stream -- important!
|
||||
/// Initialize(channelsCount, sampleRate);
|
||||
/// Initialize(channelCount, sampleRate);
|
||||
/// }
|
||||
///
|
||||
/// private :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue