Changed the naming convention for public member variables/functions and free functions (using lowerCase instead of UpperCase)

This commit is contained in:
Laurent Gomila 2012-03-11 19:10:37 +01:00
parent ff5b69d312
commit 14ac411542
200 changed files with 4302 additions and 4320 deletions

View file

@ -52,20 +52,20 @@ public :
///
/// \param volume New global volume, in the range [0, 100]
///
/// \see GetGlobalVolume
/// \see getGlobalVolume
///
////////////////////////////////////////////////////////////
static void SetGlobalVolume(float volume);
static void setGlobalVolume(float volume);
////////////////////////////////////////////////////////////
/// \brief Get the current value of the global volume
///
/// \return Current global volume, in the range [0, 100]
///
/// \see SetGlobalVolume
/// \see setGlobalVolume
///
////////////////////////////////////////////////////////////
static float GetGlobalVolume();
static float getGlobalVolume();
////////////////////////////////////////////////////////////
/// \brief Set the position of the listener in the scene
@ -76,10 +76,10 @@ public :
/// \param y Y coordinate of the listener's position
/// \param z Z coordinate of the listener's position
///
/// \see GetPosition, SetDirection
/// \see getPosition, setDirection
///
////////////////////////////////////////////////////////////
static void SetPosition(float x, float y, float z);
static void setPosition(float x, float y, float z);
////////////////////////////////////////////////////////////
/// \brief Set the position of the listener in the scene
@ -88,20 +88,20 @@ public :
///
/// \param position New listener's position
///
/// \see GetPosition, SetDirection
/// \see getPosition, setDirection
///
////////////////////////////////////////////////////////////
static void SetPosition(const Vector3f& position);
static void setPosition(const Vector3f& position);
////////////////////////////////////////////////////////////
/// \brief Get the current position of the listener in the scene
///
/// \return Listener's position
///
/// \see SetPosition
/// \see setPosition
///
////////////////////////////////////////////////////////////
static Vector3f GetPosition();
static Vector3f getPosition();
////////////////////////////////////////////////////////////
/// \brief Set the orientation of the listener in the scene
@ -115,10 +115,10 @@ public :
/// \param y Y coordinate of the listener's orientation
/// \param z Z coordinate of the listener's orientation
///
/// \see GetDirection, SetPosition
/// \see getDirection, setPosition
///
////////////////////////////////////////////////////////////
static void SetDirection(float x, float y, float z);
static void setDirection(float x, float y, float z);
////////////////////////////////////////////////////////////
/// \brief Set the orientation of the listener in the scene
@ -130,20 +130,20 @@ public :
///
/// \param direction New listener's orientation
///
/// \see GetDirection, SetPosition
/// \see getDirection, setPosition
///
////////////////////////////////////////////////////////////
static void SetDirection(const Vector3f& direction);
static void setDirection(const Vector3f& direction);
////////////////////////////////////////////////////////////
/// \brief Get the current orientation of the listener in the scene
///
/// \return Listener's orientation
///
/// \see SetDirection
/// \see setDirection
///
////////////////////////////////////////////////////////////
static Vector3f GetDirection();
static Vector3f getDirection();
};
} // namespace sf
@ -172,7 +172,7 @@ public :
/// Usage example:
/// \code
/// // Move the listener to the position (1, 0, -5)
/// sf::Listener::SetPosition(1, 0, -5);
/// sf::Listener::setPosition(1, 0, -5);
///
/// // Make it face the right axis (1, 0, 0)
/// sf::Listener::SetDirection(1, 0, 0);

View file

@ -68,7 +68,7 @@ public :
////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file
///
/// This function doesn't start playing the music (call Play()
/// This function doesn't start playing the music (call play()
/// to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
@ -78,15 +78,15 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see OpenFromMemory, OpenFromStream
/// \see openFromMemory, openFromStream
///
////////////////////////////////////////////////////////////
bool OpenFromFile(const std::string& filename);
bool openFromFile(const std::string& filename);
////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file in memory
///
/// This function doesn't start playing the music (call Play()
/// This function doesn't start playing the music (call play()
/// to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
@ -97,15 +97,15 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see OpenFromFile, OpenFromStream
/// \see openFromFile, openFromStream
///
////////////////////////////////////////////////////////////
bool OpenFromMemory(const void* data, std::size_t sizeInBytes);
bool openFromMemory(const void* data, std::size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Open a music from an audio file in a custom stream
///
/// This function doesn't start playing the music (call Play()
/// This function doesn't start playing the music (call play()
/// to do so).
/// Here is a complete list of all the supported audio formats:
/// ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam,
@ -115,10 +115,10 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see OpenFromFile, OpenFromMemory
/// \see openFromFile, openFromMemory
///
////////////////////////////////////////////////////////////
bool OpenFromStream(InputStream& stream);
bool openFromStream(InputStream& stream);
////////////////////////////////////////////////////////////
/// \brief Get the total duration of the music
@ -126,7 +126,7 @@ public :
/// \return Music duration
///
////////////////////////////////////////////////////////////
Time GetDuration() const;
Time getDuration() const;
protected :
@ -141,7 +141,7 @@ protected :
/// \return True to continue playback, false to stop
///
////////////////////////////////////////////////////////////
virtual bool OnGetData(Chunk& data);
virtual bool onGetData(Chunk& data);
////////////////////////////////////////////////////////////
/// \brief Change the current playing position in the stream source
@ -149,7 +149,7 @@ protected :
/// \param timeOffset New playing position, from the beginning of the music
///
////////////////////////////////////////////////////////////
virtual void OnSeek(Time timeOffset);
virtual void onSeek(Time timeOffset);
private :
@ -157,7 +157,7 @@ private :
/// \brief Initialize the internal state after loading a new music
///
////////////////////////////////////////////////////////////
void Initialize();
void initialize();
////////////////////////////////////////////////////////////
// Member data
@ -191,7 +191,7 @@ private :
///
/// As a sound stream, a music is played in its own thread in order
/// not to block the rest of the program. This means that you can
/// leave the music alone after calling Play(), it will manage itself
/// leave the music alone after calling play(), it will manage itself
/// very well.
///
/// Usage example:
@ -200,19 +200,19 @@ private :
/// sf::Music music;
///
/// // Open it from an audio file
/// if (!music.OpenFromFile("music.ogg"))
/// if (!music.openFromFile("music.ogg"))
/// {
/// // error...
/// }
///
/// // Change some parameters
/// music.SetPosition(0, 1, 10); // change its 3D position
/// music.SetPitch(2); // increase the pitch
/// music.SetVolume(50); // reduce the volume
/// music.SetLoop(true); // make it loop
/// music.setPosition(0, 1, 10); // change its 3D position
/// music.setPitch(2); // increase the pitch
/// music.setVolume(50); // reduce the volume
/// music.setLoop(true); // make it loop
///
/// // Play it
/// music.Play();
/// music.play();
/// \endcode
///
/// \see sf::Sound, sf::SoundStream

View file

@ -86,7 +86,7 @@ public :
/// \see Pause, Stop
///
////////////////////////////////////////////////////////////
void Play();
void play();
////////////////////////////////////////////////////////////
/// \brief Pause the sound
@ -97,19 +97,19 @@ public :
/// \see Play, Stop
///
////////////////////////////////////////////////////////////
void Pause();
void pause();
////////////////////////////////////////////////////////////
/// \brief Stop playing the sound
///
/// This function stops the sound if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike Pause()).
/// It also resets the playing position (unlike pause()).
///
/// \see Play, Pause
///
////////////////////////////////////////////////////////////
void Stop();
void stop();
////////////////////////////////////////////////////////////
/// \brief Set the source buffer containing the audio data to play
@ -123,22 +123,22 @@ public :
/// \see GetBuffer
///
////////////////////////////////////////////////////////////
void SetBuffer(const SoundBuffer& buffer);
void setBuffer(const SoundBuffer& buffer);
////////////////////////////////////////////////////////////
/// \brief Set whether or not the sound should loop after reaching the end
///
/// If set, the sound will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// SetLoop(false) is called.
/// setLoop(false) is called.
/// The default looping state for sound is false.
///
/// \param loop True to play in loop, false to play once
///
/// \see GetLoop
/// \see getLoop
///
////////////////////////////////////////////////////////////
void SetLoop(bool loop);
void setLoop(bool loop);
////////////////////////////////////////////////////////////
/// \brief Change the current playing position of the sound
@ -148,10 +148,10 @@ public :
///
/// \param timeOffset New playing position, from the beginning of the sound
///
/// \see GetPlayingOffset
/// \see getPlayingOffset
///
////////////////////////////////////////////////////////////
void SetPlayingOffset(Time timeOffset);
void setPlayingOffset(Time timeOffset);
////////////////////////////////////////////////////////////
/// \brief Get the audio buffer attached to the sound
@ -159,27 +159,27 @@ public :
/// \return Sound buffer attached to the sound (can be NULL)
///
////////////////////////////////////////////////////////////
const SoundBuffer* GetBuffer() const;
const SoundBuffer* getBuffer() const;
////////////////////////////////////////////////////////////
/// \brief Tell whether or not the sound is in loop mode
///
/// \return True if the sound is looping, false otherwise
///
/// \see SetLoop
/// \see setLoop
///
////////////////////////////////////////////////////////////
bool GetLoop() const;
bool getLoop() const;
////////////////////////////////////////////////////////////
/// \brief Get the current playing position of the sound
///
/// \return Current playing position, from the beginning of the sound
///
/// \see SetPlayingOffset
/// \see setPlayingOffset
///
////////////////////////////////////////////////////////////
Time GetPlayingOffset() const;
Time getPlayingOffset() const;
////////////////////////////////////////////////////////////
/// \brief Get the current status of the sound (stopped, paused, playing)
@ -187,7 +187,7 @@ public :
/// \return Current status of the sound
///
////////////////////////////////////////////////////////////
Status GetStatus() const;
Status getStatus() const;
////////////////////////////////////////////////////////////
/// \brief Overload of assignment operator
@ -208,7 +208,7 @@ public :
/// the sound from using a dead buffer.
///
////////////////////////////////////////////////////////////
void ResetBuffer();
void resetBuffer();
private :
@ -242,7 +242,7 @@ private :
///
/// In order to work, a sound must be given a buffer of audio
/// data to play. Audio data (samples) is stored in sf::SoundBuffer,
/// and attached to a sound with the SetBuffer() function.
/// and attached to a sound with the setBuffer() function.
/// The buffer object attached to a sound must remain alive
/// as long as the sound uses it. Note that multiple sounds
/// can use the same sound buffer at the same time.
@ -250,11 +250,11 @@ private :
/// Usage example:
/// \code
/// sf::SoundBuffer buffer;
/// buffer.LoadFromFile("sound.wav");
/// buffer.loadFromFile("sound.wav");
///
/// sf::Sound sound;
/// sound.SetBuffer(buffer);
/// sound.Play();
/// sound.setBuffer(buffer);
/// sound.play();
/// \endcode
///
/// \see sf::SoundBuffer, sf::Music

View file

@ -84,10 +84,10 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see LoadFromMemory, LoadFromStream, LoadFromSamples, SaveToFile
/// \see loadFromMemory, loadFromStream, loadFromSamples, saveToFile
///
////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& filename);
bool loadFromFile(const std::string& filename);
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a file in memory
@ -101,10 +101,10 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see LoadFromFile, LoadFromStream, LoadFromSamples
/// \see loadFromFile, loadFromStream, loadFromSamples
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const void* data, std::size_t sizeInBytes);
bool loadFromMemory(const void* data, std::size_t sizeInBytes);
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from a custom stream
@ -117,10 +117,10 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see LoadFromFile, LoadFromMemory, LoadFromSamples
/// \see loadFromFile, loadFromMemory, loadFromSamples
///
////////////////////////////////////////////////////////////
bool LoadFromStream(InputStream& stream);
bool loadFromStream(InputStream& stream);
////////////////////////////////////////////////////////////
/// \brief Load the sound buffer from an array of audio samples
@ -135,10 +135,10 @@ public :
///
/// \return True if loading succeeded, false if it failed
///
/// \see LoadFromFile, LoadFromMemory, SaveToFile
/// \see loadFromFile, loadFromMemory, saveToFile
///
////////////////////////////////////////////////////////////
bool LoadFromSamples(const Int16* samples, std::size_t sampleCount, unsigned int channelCount, 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
@ -151,37 +151,37 @@ public :
///
/// \return True if saving succeeded, false if it failed
///
/// \see LoadFromFile, LoadFromMemory, LoadFromSamples
/// \see loadFromFile, loadFromMemory, loadFromSamples
///
////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& filename) const;
bool saveToFile(const std::string& filename) const;
////////////////////////////////////////////////////////////
/// \brief Get the array of audio samples stored in the buffer
///
/// 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 GetSampleCount() function.
/// is given by the getSampleCount() function.
///
/// \return Read-only pointer to the array of sound samples
///
/// \see GetSampleCount
/// \see getSampleCount
///
////////////////////////////////////////////////////////////
const Int16* GetSamples() const;
const Int16* getSamples() const;
////////////////////////////////////////////////////////////
/// \brief Get the number of samples stored in the buffer
///
/// The array of samples can be accessed with the GetSamples()
/// The array of samples can be accessed with the getSamples()
/// function.
///
/// \return Number of samples
///
/// \see GetSamples
/// \see getSamples
///
////////////////////////////////////////////////////////////
std::size_t GetSampleCount() const;
std::size_t getSampleCount() const;
////////////////////////////////////////////////////////////
/// \brief Get the sample rate of the sound
@ -192,10 +192,10 @@ public :
///
/// \return Sample rate (number of samples per second)
///
/// \see GetChannelCount, GetDuration
/// \see getChannelCount, getDuration
///
////////////////////////////////////////////////////////////
unsigned int GetSampleRate() const;
unsigned int getSampleRate() const;
////////////////////////////////////////////////////////////
/// \brief Get the number of channels used by the sound
@ -205,20 +205,20 @@ public :
///
/// \return Number of channels
///
/// \see GetSampleRate, GetDuration
/// \see getSampleRate, getDuration
///
////////////////////////////////////////////////////////////
unsigned int GetChannelCount() const;
unsigned int getChannelCount() const;
////////////////////////////////////////////////////////////
/// \brief Get the total duration of the sound
///
/// \return Sound duration
///
/// \see GetSampleRate, GetChannelCount
/// \see getSampleRate, getChannelCount
///
////////////////////////////////////////////////////////////
Time GetDuration() const;
Time getDuration() const;
////////////////////////////////////////////////////////////
/// \brief Overload of assignment operator
@ -242,7 +242,7 @@ private :
/// \return True on succesful initialization, false on failure
///
////////////////////////////////////////////////////////////
bool Initialize(priv::SoundFile& file);
bool initialize(priv::SoundFile& file);
////////////////////////////////////////////////////////////
/// \brief Update the internal buffer with the cached audio samples
@ -253,7 +253,7 @@ private :
/// \return True on success, false if any error happened
///
////////////////////////////////////////////////////////////
bool Update(unsigned int channelCount, unsigned int sampleRate);
bool update(unsigned int channelCount, unsigned int sampleRate);
////////////////////////////////////////////////////////////
/// \brief Add a sound to the list of sounds that use this buffer
@ -261,7 +261,7 @@ private :
/// \param sound Sound instance to attach
///
////////////////////////////////////////////////////////////
void AttachSound(Sound* sound) const;
void attachSound(Sound* sound) const;
////////////////////////////////////////////////////////////
/// \brief Remove a sound from the list of sounds that use this buffer
@ -269,7 +269,7 @@ private :
/// \param sound Sound instance to detach
///
////////////////////////////////////////////////////////////
void DetachSound(Sound* sound) const;
void detachSound(Sound* sound) const;
////////////////////////////////////////////////////////////
// Types
@ -304,7 +304,7 @@ private :
/// are like texture pixels, and a sf::SoundBuffer is similar to
/// a sf::Texture.
///
/// A sound buffer can be loaded from a file (see LoadFromFile()
/// A sound buffer can be loaded from a file (see loadFromFile()
/// for the complete list of supported formats), from memory, from
/// a custom stream (see sf::InputStream) or directly from an array
/// of samples. It can also be saved back to a file.
@ -333,25 +333,25 @@ private :
/// sf::SoundBuffer buffer;
///
/// // Load it from a file
/// if (!buffer.LoadFromFile("sound.wav"))
/// if (!buffer.loadFromFile("sound.wav"))
/// {
/// // error...
/// }
///
/// // Create a sound source and bind it to the buffer
/// sf::Sound sound1;
/// sound1.SetBuffer(buffer);
/// sound1.setBuffer(buffer);
///
/// // Play the sound
/// sound1.Play();
/// sound1.play();
///
/// // Create another sound source bound to the same buffer
/// sf::Sound sound2;
/// sound2.SetBuffer(buffer);
/// sound2.setBuffer(buffer);
///
/// // Play it with a higher pitch -- the first sound remains unchanged
/// sound2.SetPitch(2);
/// sound2.Play();
/// sound2.setPitch(2);
/// sound2.play();
/// \endcode
///
/// \see sf::Sound, sf::SoundBufferRecorder

View file

@ -56,7 +56,7 @@ public :
/// \return Read-only access to the sound buffer
///
////////////////////////////////////////////////////////////
const SoundBuffer& GetBuffer() const;
const SoundBuffer& getBuffer() const;
private :
@ -66,7 +66,7 @@ private :
/// \return True to start the capture, or false to abort it
///
////////////////////////////////////////////////////////////
virtual bool OnStart();
virtual bool onStart();
////////////////////////////////////////////////////////////
/// \brief Process a new chunk of recorded samples
@ -77,13 +77,13 @@ private :
/// \return True to continue the capture, or false to stop it
///
////////////////////////////////////////////////////////////
virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount);
virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount);
////////////////////////////////////////////////////////////
/// \brief Stop capturing audio data
///
////////////////////////////////////////////////////////////
virtual void OnStop();
virtual void onStop();
////////////////////////////////////////////////////////////
// Member data
@ -105,29 +105,29 @@ private :
/// through a sf::SoundBuffer, so that it can be played, saved
/// to a file, etc.
///
/// It has the same simple interface as its base class (Start(), Stop())
/// It has the same simple interface as its base class (start(), stop())
/// and adds a function to retrieve the recorded sound buffer
/// (GetBuffer()).
/// (getBuffer()).
///
/// As usual, don't forget to call the IsAvailable() function
/// As usual, don't forget to call the isAvailable() function
/// before using this class (see sf::SoundRecorder for more details
/// about this).
///
/// Usage example:
/// \code
/// if (SoundBufferRecorder::IsAvailable())
/// if (SoundBufferRecorder::isAvailable())
/// {
/// // Record some audio data
/// SoundBufferRecorder recorder;
/// recorder.Start();
/// recorder.start();
/// ...
/// recorder.Stop();
/// recorder.stop();
///
/// // Get the buffer containing the captured audio data
/// const sf::SoundBuffer& buffer = recorder.GetBuffer();
/// const sf::SoundBuffer& buffer = recorder.getBuffer();
///
/// // Save it to a file (for example...)
/// buffer.SaveToFile("my_record.ogg");
/// buffer.saveToFile("my_record.ogg");
/// }
/// \endcode
///

View file

@ -61,18 +61,18 @@ public :
///
/// \param sampleRate Desired capture rate, in number of samples per second
///
/// \see Stop
/// \see stop
///
////////////////////////////////////////////////////////////
void Start(unsigned int sampleRate = 44100);
void start(unsigned int sampleRate = 44100);
////////////////////////////////////////////////////////////
/// \brief Stop the capture
///
/// \see Start
/// \see start
///
////////////////////////////////////////////////////////////
void Stop();
void stop();
////////////////////////////////////////////////////////////
/// \brief Get the sample rate
@ -84,7 +84,7 @@ public :
/// \return Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
unsigned int GetSampleRate() const;
unsigned int getSampleRate() const;
////////////////////////////////////////////////////////////
/// \brief Check if the system supports audio capture
@ -97,7 +97,7 @@ public :
/// \return True if audio capture is supported, false otherwise
///
////////////////////////////////////////////////////////////
static bool IsAvailable();
static bool isAvailable();
protected :
@ -122,7 +122,7 @@ private :
/// \return True to start the capture, or false to abort it
///
////////////////////////////////////////////////////////////
virtual bool OnStart();
virtual bool onStart();
////////////////////////////////////////////////////////////
/// \brief Process a new chunk of recorded samples
@ -138,7 +138,7 @@ private :
/// \return True to continue the capture, or false to stop it
///
////////////////////////////////////////////////////////////
virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount) = 0;
virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount) = 0;
////////////////////////////////////////////////////////////
/// \brief Stop capturing audio data
@ -149,7 +149,7 @@ private :
/// implementation does nothing.
///
////////////////////////////////////////////////////////////
virtual void OnStop();
virtual void onStop();
////////////////////////////////////////////////////////////
/// \brief Function called as the entry point of the thread
@ -158,7 +158,7 @@ private :
/// only when the capture is stopped.
///
////////////////////////////////////////////////////////////
void Record();
void record();
////////////////////////////////////////////////////////////
/// \brief Get the new available audio samples and process them
@ -168,7 +168,7 @@ private :
/// forwards them to the derived class.
///
////////////////////////////////////////////////////////////
void ProcessCapturedSamples();
void processCapturedSamples();
////////////////////////////////////////////////////////////
/// \brief Clean up the recorder's internal resources
@ -176,7 +176,7 @@ private :
/// This function is called when the capture stops.
///
////////////////////////////////////////////////////////////
void CleanUp();
void cleanup();
////////////////////////////////////////////////////////////
// Member data
@ -220,8 +220,8 @@ private :
///
/// It is important to note that the audio capture happens in a
/// separate thread, so that it doesn't block the rest of the
/// program. In particular, the OnProcessSamples and OnStop
/// virtual functions (but not OnStart) will be called
/// program. In particular, the onProcessSamples and onStop
/// virtual functions (but not onStart) will be called
/// from this separate thread. It is important to keep this in
/// mind, because you may have to take care of synchronization
/// issues if you share data between threads.
@ -230,7 +230,7 @@ private :
/// \code
/// class CustomRecorder : public sf::SoundRecorder
/// {
/// virtual bool OnStart() // optional
/// virtual bool onStart() // optional
/// {
/// // Initialize whatever has to be done before the capture starts
/// ...
@ -239,7 +239,7 @@ private :
/// return true;
/// }
///
/// virtual bool OnProcessSamples(const Int16* samples, std::size_t sampleCount)
/// virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount)
/// {
/// // Do something with the new chunk of samples (store them, send them, ...)
/// ...
@ -248,7 +248,7 @@ private :
/// return true;
/// }
///
/// virtual void OnStop() // optional
/// virtual void onStop() // optional
/// {
/// // Clean up whatever has to be done after the capture ends
/// ...
@ -256,12 +256,12 @@ private :
/// }
///
/// // Usage
/// if (CustomRecorder::IsAvailable())
/// if (CustomRecorder::isAvailable())
/// {
/// CustomRecorder recorder;
/// recorder.Start();
/// recorder.start();
/// ...
/// recorder.Stop();
/// recorder.stop();
/// }
/// \endcode
///

View file

@ -78,10 +78,10 @@ public :
///
/// \param pitch New pitch to apply to the sound
///
/// \see GetPitch
/// \see getPitch
///
////////////////////////////////////////////////////////////
void SetPitch(float pitch);
void setPitch(float pitch);
////////////////////////////////////////////////////////////
/// \brief Set the volume of the sound
@ -91,10 +91,10 @@ public :
///
/// \param volume Volume of the sound
///
/// \see GetVolume
/// \see getVolume
///
////////////////////////////////////////////////////////////
void SetVolume(float volume);
void setVolume(float volume);
////////////////////////////////////////////////////////////
/// \brief Set the 3D position of the sound in the audio scene
@ -107,10 +107,10 @@ public :
/// \param y Y coordinate of the position of the sound in the scene
/// \param z Z coordinate of the position of the sound in the scene
///
/// \see GetPosition
/// \see getPosition
///
////////////////////////////////////////////////////////////
void SetPosition(float x, float y, float z);
void setPosition(float x, float y, float z);
////////////////////////////////////////////////////////////
/// \brief Set the 3D position of the sound in the audio scene
@ -121,10 +121,10 @@ public :
///
/// \param position Position of the sound in the scene
///
/// \see GetPosition
/// \see getPosition
///
////////////////////////////////////////////////////////////
void SetPosition(const Vector3f& position);
void setPosition(const Vector3f& position);
////////////////////////////////////////////////////////////
/// \brief Make the sound's position relative to the listener or absolute
@ -137,10 +137,10 @@ public :
///
/// \param relative True to set the position relative, false to set it absolute
///
/// \see IsRelativeToListener
/// \see isRelativeToListener
///
////////////////////////////////////////////////////////////
void SetRelativeToListener(bool relative);
void setRelativeToListener(bool relative);
////////////////////////////////////////////////////////////
/// \brief Set the minimum distance of the sound
@ -154,10 +154,10 @@ public :
///
/// \param distance New minimum distance of the sound
///
/// \see GetMinDistance, SetAttenuation
/// \see getMinDistance, setAttenuation
///
////////////////////////////////////////////////////////////
void SetMinDistance(float distance);
void setMinDistance(float distance);
////////////////////////////////////////////////////////////
/// \brief Set the attenuation factor of the sound
@ -173,40 +173,40 @@ public :
///
/// \param attenuation New attenuation factor of the sound
///
/// \see GetAttenuation, SetMinDistance
/// \see getAttenuation, setMinDistance
///
////////////////////////////////////////////////////////////
void SetAttenuation(float attenuation);
void setAttenuation(float attenuation);
////////////////////////////////////////////////////////////
/// \brief Get the pitch of the sound
///
/// \return Pitch of the sound
///
/// \see SetPitch
/// \see setPitch
///
////////////////////////////////////////////////////////////
float GetPitch() const;
float getPitch() const;
////////////////////////////////////////////////////////////
/// \brief Get the volume of the sound
///
/// \return Volume of the sound, in the range [0, 100]
///
/// \see SetVolume
/// \see setVolume
///
////////////////////////////////////////////////////////////
float GetVolume() const;
float getVolume() const;
////////////////////////////////////////////////////////////
/// \brief Get the 3D position of the sound in the audio scene
///
/// \return Position of the sound
///
/// \see SetPosition
/// \see setPosition
///
////////////////////////////////////////////////////////////
Vector3f GetPosition() const;
Vector3f getPosition() const;
////////////////////////////////////////////////////////////
/// \brief Tell whether the sound's position is relative to the
@ -214,30 +214,30 @@ public :
///
/// \return True if the position is relative, false if it's absolute
///
/// \see SetRelativeToListener
/// \see setRelativeToListener
///
////////////////////////////////////////////////////////////
bool IsRelativeToListener() const;
bool isRelativeToListener() const;
////////////////////////////////////////////////////////////
/// \brief Get the minimum distance of the sound
///
/// \return Minimum distance of the sound
///
/// \see SetMinDistance, GetAttenuation
/// \see setMinDistance, getAttenuation
///
////////////////////////////////////////////////////////////
float GetMinDistance() const;
float getMinDistance() const;
////////////////////////////////////////////////////////////
/// \brief Get the attenuation factor of the sound
///
/// \return Attenuation factor of the sound
///
/// \see SetAttenuation, GetMinDistance
/// \see setAttenuation, getMinDistance
///
////////////////////////////////////////////////////////////
float GetAttenuation() const;
float getAttenuation() const;
protected :
@ -255,7 +255,7 @@ protected :
/// \return Current status of the sound
///
////////////////////////////////////////////////////////////
Status GetStatus() const;
Status getStatus() const;
////////////////////////////////////////////////////////////
// Member data

View file

@ -51,8 +51,8 @@ public :
////////////////////////////////////////////////////////////
struct Chunk
{
const Int16* Samples; ///< Pointer to the audio samples
std::size_t SampleCount; ///< Number of samples pointed by Samples
const Int16* samples; ///< Pointer to the audio samples
std::size_t sampleCount; ///< Number of samples pointed by Samples
};
////////////////////////////////////////////////////////////
@ -70,10 +70,10 @@ public :
/// This function uses its own thread so that it doesn't block
/// the rest of the program while the stream is played.
///
/// \see Pause, Stop
/// \see pause, stop
///
////////////////////////////////////////////////////////////
void Play();
void play();
////////////////////////////////////////////////////////////
/// \brief Pause the audio stream
@ -81,22 +81,22 @@ public :
/// This function pauses the stream if it was playing,
/// otherwise (stream already paused or stopped) it has no effect.
///
/// \see Play, Stop
/// \see play, stop
///
////////////////////////////////////////////////////////////
void Pause();
void pause();
////////////////////////////////////////////////////////////
/// \brief Stop playing the audio stream
///
/// This function stops the stream if it was playing or paused,
/// and does nothing if it was already stopped.
/// It also resets the playing position (unlike Pause()).
/// It also resets the playing position (unlike pause()).
///
/// \see Play, Pause
/// \see play, pause
///
////////////////////////////////////////////////////////////
void Stop();
void stop();
////////////////////////////////////////////////////////////
/// \brief Return the number of channels of the stream
@ -106,7 +106,7 @@ public :
/// \return Number of channels
///
////////////////////////////////////////////////////////////
unsigned int GetChannelCount() const;
unsigned int getChannelCount() const;
////////////////////////////////////////////////////////////
/// \brief Get the stream sample rate of the stream
@ -117,7 +117,7 @@ public :
/// \return Sample rate, in number of samples per second
///
////////////////////////////////////////////////////////////
unsigned int GetSampleRate() const;
unsigned int getSampleRate() const;
////////////////////////////////////////////////////////////
/// \brief Get the current status of the stream (stopped, paused, playing)
@ -125,7 +125,7 @@ public :
/// \return Current status
///
////////////////////////////////////////////////////////////
Status GetStatus() const;
Status getStatus() const;
////////////////////////////////////////////////////////////
/// \brief Change the current playing position of the stream
@ -135,45 +135,45 @@ public :
///
/// \param timeOffset New playing position, from the beginning of the stream
///
/// \see GetPlayingOffset
/// \see getPlayingOffset
///
////////////////////////////////////////////////////////////
void SetPlayingOffset(Time timeOffset);
void setPlayingOffset(Time timeOffset);
////////////////////////////////////////////////////////////
/// \brief Get the current playing position of the stream
///
/// \return Current playing position, from the beginning of the stream
///
/// \see SetPlayingOffset
/// \see setPlayingOffset
///
////////////////////////////////////////////////////////////
Time GetPlayingOffset() const;
Time getPlayingOffset() const;
////////////////////////////////////////////////////////////
/// \brief Set whether or not the stream should loop after reaching the end
///
/// If set, the stream will restart from beginning after
/// reaching the end and so on, until it is stopped or
/// SetLoop(false) is called.
/// setLoop(false) is called.
/// The default looping state for streams is false.
///
/// \param loop True to play in loop, false to play once
///
/// \see GetLoop
/// \see getLoop
///
////////////////////////////////////////////////////////////
void SetLoop(bool loop);
void setLoop(bool loop);
////////////////////////////////////////////////////////////
/// \brief Tell whether or not the stream is in loop mode
///
/// \return True if the stream is looping, false otherwise
///
/// \see SetLoop
/// \see setLoop
///
////////////////////////////////////////////////////////////
bool GetLoop() const;
bool getLoop() const;
protected :
@ -190,7 +190,7 @@ protected :
///
/// This function must be called by derived classes as soon
/// as they know the audio settings of the stream to play.
/// Any attempt to manipulate the stream (Play(), ...) before
/// Any attempt to manipulate the stream (play(), ...) before
/// calling this function will fail.
/// It can be called multiple times if the settings of the
/// audio stream change, but only when the stream is stopped.
@ -199,7 +199,7 @@ protected :
/// \param sampleRate Sample rate, in samples per second
///
////////////////////////////////////////////////////////////
void Initialize(unsigned int channelCount, unsigned int sampleRate);
void initialize(unsigned int channelCount, unsigned int sampleRate);
private :
@ -210,7 +210,7 @@ private :
/// only when the sound is stopped.
///
////////////////////////////////////////////////////////////
void Stream();
void stream();
////////////////////////////////////////////////////////////
/// \brief Request a new chunk of audio samples from the stream source
@ -226,7 +226,7 @@ private :
/// \return True to continue playback, false to stop
///
////////////////////////////////////////////////////////////
virtual bool OnGetData(Chunk& data) = 0;
virtual bool onGetData(Chunk& data) = 0;
////////////////////////////////////////////////////////////
/// \brief Change the current playing position in the stream source
@ -237,7 +237,7 @@ private :
/// \param timeOffset New playing position, relative to the beginning of the stream
///
////////////////////////////////////////////////////////////
virtual void OnSeek(Time timeOffset) = 0;
virtual void onSeek(Time timeOffset) = 0;
////////////////////////////////////////////////////////////
/// \brief Fill a new buffer with audio samples, and append
@ -252,7 +252,7 @@ private :
/// \return True if the stream source has requested to stop, false otherwise
///
////////////////////////////////////////////////////////////
bool FillAndPushBuffer(unsigned int bufferNum);
bool fillAndPushBuffer(unsigned int bufferNum);
////////////////////////////////////////////////////////////
/// \brief Fill the audio buffers and put them all into the playing queue
@ -263,7 +263,7 @@ private :
/// \return True if the derived class has requested to stop, false otherwise
///
////////////////////////////////////////////////////////////
bool FillQueue();
bool fillQueue();
////////////////////////////////////////////////////////////
/// \brief Clear all the audio buffers and empty the playing queue
@ -271,7 +271,7 @@ private :
/// This function is called when the stream is stopped.
///
////////////////////////////////////////////////////////////
void ClearQueue();
void clearQueue();
enum
{
@ -320,8 +320,8 @@ private :
/// by combining this class with the network module.
///
/// A derived class has to override two virtual functions:
/// \li OnGetData fills a new chunk of audio data to be played
/// \li OnSeek changes the current playing position in the source
/// \li onGetData fills a new chunk of audio data to be played
/// \li onSeek changes the current playing position in the source
///
/// It is important to note that each SoundStream is played in its
/// own separate thread, so that the streaming loop doesn't block the
@ -336,7 +336,7 @@ private :
/// {
/// public :
///
/// bool Open(const std::string& location)
/// bool open(const std::string& location)
/// {
/// // Open the source and get audio settings
/// ...
@ -344,22 +344,22 @@ private :
/// unsigned int sampleRate = ...;
///
/// // Initialize the stream -- important!
/// Initialize(channelCount, sampleRate);
/// initialize(channelCount, sampleRate);
/// }
///
/// private :
///
/// virtual bool OnGetData(Chunk& data)
/// virtual bool onGetData(Chunk& data)
/// {
/// // Fill the chunk with audio data from the stream source
/// data.Samples = ...;
/// data.SampleCount = ...;
/// data.samples = ...;
/// data.sampleCount = ...;
///
/// // Return true to continue playing
/// return true;
/// }
///
/// virtual void OnSeek(Uint32 timeOffset)
/// virtual void onSeek(Uint32 timeOffset)
/// {
/// // Change the current position in the stream source
/// ...
@ -368,8 +368,8 @@ private :
///
/// // Usage
/// CustomStream stream;
/// stream.Open("path/to/stream");
/// stream.Play();
/// stream.open("path/to/stream");
/// stream.play();
/// \endcode
///
/// \see sf::Music