Fixed a few typos/style issues

This commit is contained in:
Marco Antognini 2015-03-09 10:47:20 +01:00
parent 0c2f306c17
commit aa9a6dec89
23 changed files with 72 additions and 64 deletions

@ -161,7 +161,7 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Change the current read position to the given time offset /// \brief Change the current read position to the given time offset
/// ///
/// Using a time offset is handy but unprecise. If you need an accurate /// Using a time offset is handy but imprecise. If you need an accurate
/// result, consider using the overload which takes a sample offset. /// result, consider using the overload which takes a sample offset.
/// ///
/// If the given time exceeds to total duration, this function jumps /// If the given time exceeds to total duration, this function jumps
@ -239,7 +239,7 @@ private:
/// { /// {
/// count = file.read(samples, 1024); /// count = file.read(samples, 1024);
/// ///
/// // process, analyse, play, convert, or whatever /// // process, analyze, play, convert, or whatever
/// // you want to do with the samples... /// // you want to do with the samples...
/// } /// }
/// while (count > 0); /// while (count > 0);

@ -87,7 +87,7 @@ public :
/// of supported formats. /// of supported formats.
/// Since the music is not loaded completely but rather streamed /// Since the music is not loaded completely but rather streamed
/// continuously, the \a data must remain available as long as the /// continuously, the \a data must remain available as long as the
/// music is playing (ie. you can't deallocate it right after calling /// music is playing (i.e. you can't deallocate it right after calling
/// this function). /// this function).
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
@ -109,7 +109,7 @@ public :
/// of supported formats. /// of supported formats.
/// Since the music is not loaded completely but rather streamed /// Since the music is not loaded completely but rather streamed
/// continuously, the \a stream must remain alive as long as the /// continuously, the \a stream must remain alive as long as the
/// music is playing (ie. you can't destroy it right after calling /// music is playing (i.e. you can't destroy it right after calling
/// this function). /// this function).
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from

@ -232,7 +232,7 @@ private :
/// ///
/// \param file Sound file providing access to the new loaded sound /// \param file Sound file providing access to the new loaded sound
/// ///
/// \return True on succesful initialization, false on failure /// \return True on successful initialization, false on failure
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool initialize(InputSoundFile& file); bool initialize(InputSoundFile& file);
@ -291,7 +291,7 @@ private :
/// A sound buffer holds the data of a sound, which is /// A sound buffer holds the data of a sound, which is
/// an array of audio samples. A sample is a 16 bits signed integer /// an array of audio samples. A sample is a 16 bits signed integer
/// that defines the amplitude of the sound at a given time. /// that defines the amplitude of the sound at a given time.
/// The sound is then restituted by playing these samples at /// The sound is then reconstituted by playing these samples at
/// a high rate (for example, 44100 samples per second is the /// a high rate (for example, 44100 samples per second is the
/// standard rate used for playing CDs). In short, audio samples /// standard rate used for playing CDs). In short, audio samples
/// are like texture pixels, and a sf::SoundBuffer is similar to /// are like texture pixels, and a sf::SoundBuffer is similar to

@ -40,7 +40,7 @@ class SoundFileReader;
class SoundFileWriter; class SoundFileWriter;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Manages and instanciates sound file readers and writers /// \brief Manages and instantiates sound file readers and writers
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_AUDIO_API SoundFileFactory class SFML_AUDIO_API SoundFileFactory
@ -84,7 +84,9 @@ public :
static void unregisterWriter(); static void unregisterWriter();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Instanciate the right reader for the given file on disk /// \brief Instantiate the right reader for the given file on disk
///
/// It's up to the caller to release the returned reader
/// ///
/// \param filename Path of the sound file /// \param filename Path of the sound file
/// ///
@ -96,7 +98,9 @@ public :
static SoundFileReader* createReaderFromFilename(const std::string& filename); static SoundFileReader* createReaderFromFilename(const std::string& filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Instanciate the right codec for the given file in memory /// \brief Instantiate the right codec for the given file in memory
///
/// It's up to the caller to release the returned reader
/// ///
/// \param data Pointer to the file data in memory /// \param data Pointer to the file data in memory
/// \param sizeInBytes Total size of the file data, in bytes /// \param sizeInBytes Total size of the file data, in bytes
@ -109,7 +113,9 @@ public :
static SoundFileReader* createReaderFromMemory(const void* data, std::size_t sizeInBytes); static SoundFileReader* createReaderFromMemory(const void* data, std::size_t sizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Instanciate the right codec for the given file in stream /// \brief Instantiate the right codec for the given file in stream
///
/// It's up to the caller to release the returned reader
/// ///
/// \param stream Source stream to read from /// \param stream Source stream to read from
/// ///
@ -121,7 +127,9 @@ public :
static SoundFileReader* createReaderFromStream(InputStream& stream); static SoundFileReader* createReaderFromStream(InputStream& stream);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Instanciate the right writer for the given file on disk /// \brief Instantiate the right writer for the given file on disk
///
/// It's up to the caller to release the returned writer
/// ///
/// \param filename Path of the sound file /// \param filename Path of the sound file
/// ///
@ -168,7 +176,7 @@ private:
/// \ingroup audio /// \ingroup audio
/// ///
/// This class is where all the sound file readers and writers are /// This class is where all the sound file readers and writers are
/// registered. You should normally only need to use its regitration /// registered. You should normally only need to use its registration
/// and unregistration functions; readers/writers creation and manipulation /// and unregistration functions; readers/writers creation and manipulation
/// are wrapped into the higher-level classes sf::InputSoundFile and /// are wrapped into the higher-level classes sf::InputSoundFile and
/// sf::OutputSoundFile. /// sf::OutputSoundFile.

@ -120,10 +120,10 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef ANDROID #ifdef ANDROID
std::ifstream m_file; ///< Standard file stream
#else
sf::priv::ResourceStream *m_file; sf::priv::ResourceStream *m_file;
#else
std::ifstream m_file; ///< Standard file stream
#endif #endif
}; };

@ -244,9 +244,9 @@ void InputSoundFile::close()
if (m_streamOwned) if (m_streamOwned)
{ {
delete m_stream; delete m_stream;
m_stream = NULL;
m_streamOwned = false; m_streamOwned = false;
} }
m_stream = NULL;
// Reset the sound file attributes // Reset the sound file attributes
m_sampleCount = 0; m_sampleCount = 0;

@ -38,7 +38,7 @@
namespace namespace
{ {
// register all the built-in readers and writers if not already done // Register all the built-in readers and writers if not already done
void ensureDefaultReadersWritersRegistered() void ensureDefaultReadersWritersRegistered()
{ {
static bool registered = false; static bool registered = false;

@ -56,13 +56,13 @@ FileInputStream::~FileInputStream()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool FileInputStream::open(const std::string& filename) bool FileInputStream::open(const std::string& filename)
{ {
#ifndef ANDROID #ifdef ANDROID
m_file.open(filename.c_str(), std::ios::binary);
return m_file.good();
#else
if (m_file) if (m_file)
delete m_file; delete m_file;
m_file = new sf::priv::ResourceStream(filename); m_file = new sf::priv::ResourceStream(filename);
#else
m_file.open(filename.c_str(), std::ios::binary);
return m_file.good();
#endif #endif
} }
@ -70,11 +70,11 @@ bool FileInputStream::open(const std::string& filename)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Int64 FileInputStream::read(void* data, Int64 size) Int64 FileInputStream::read(void* data, Int64 size)
{ {
#ifndef ANDROID #ifdef ANDROID
return m_file->read(data, size);
#else
m_file.read(static_cast<char*>(data), size); m_file.read(static_cast<char*>(data), size);
return m_file.gcount(); return m_file.gcount();
#else
return m_file->read(data, size);
#endif #endif
} }
@ -82,13 +82,13 @@ Int64 FileInputStream::read(void* data, Int64 size)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Int64 FileInputStream::seek(Int64 position) Int64 FileInputStream::seek(Int64 position)
{ {
#ifndef ANDROID #ifdef ANDROID
return m_file->seek(position);
#else
if (m_file.eof() || m_file.fail()) if (m_file.eof() || m_file.fail())
m_file.clear(); m_file.clear();
m_file.seekg(position); m_file.seekg(position);
return tell(); return tell();
#else
return m_file->seek(position);
#endif #endif
} }
@ -96,10 +96,10 @@ Int64 FileInputStream::seek(Int64 position)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Int64 FileInputStream::tell() Int64 FileInputStream::tell()
{ {
#ifndef ANDROID #ifdef ANDROID
return m_file.tellg();
#else
return m_file->tell(); return m_file->tell();
#else
return m_file.tellg();
#endif #endif
} }
@ -107,14 +107,14 @@ Int64 FileInputStream::tell()
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Int64 FileInputStream::getSize() Int64 FileInputStream::getSize()
{ {
#ifndef ANDROID #ifdef ANDROID
return m_file->getSize();
#else
std::ifstream::pos_type pos = m_file.tellg(); std::ifstream::pos_type pos = m_file.tellg();
m_file.seekg(0, std::ios::end); m_file.seekg(0, std::ios::end);
std::ifstream::pos_type size = m_file.tellg(); std::ifstream::pos_type size = m_file.tellg();
m_file.seekg(pos); m_file.seekg(pos);
return size; return size;
#else
return m_file->getSize();
#endif #endif
} }

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent@sfml-dev.org) // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent@sfml-dev.org) // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent@sfml-dev.org) // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent@sfml-dev.org) // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.

@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// //
// SFML - Simple and Fast Multimedia Library // SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (laurent@sfml-dev.org) // Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
// //
// This software is provided 'as-is', without any express or implied warranty. // This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software. // In no event will the authors be held liable for any damages arising from the use of this software.