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

View File

@ -161,7 +161,7 @@ public :
////////////////////////////////////////////////////////////
/// \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.
///
/// If the given time exceeds to total duration, this function jumps
@ -239,7 +239,7 @@ private:
/// {
/// count = file.read(samples, 1024);
///
/// // process, analyse, play, convert, or whatever
/// // process, analyze, play, convert, or whatever
/// // you want to do with the samples...
/// }
/// while (count > 0);

View File

@ -87,7 +87,7 @@ public :
/// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// 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).
///
/// \param data Pointer to the file data in memory
@ -109,7 +109,7 @@ public :
/// of supported formats.
/// Since the music is not loaded completely but rather streamed
/// 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).
///
/// \param stream Source stream to read from

View File

@ -232,7 +232,7 @@ private :
///
/// \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);
@ -291,7 +291,7 @@ private :
/// A sound buffer holds the data of a sound, which is
/// an array of audio samples. A sample is a 16 bits signed integer
/// 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
/// standard rate used for playing CDs). In short, audio samples
/// are like texture pixels, and a sf::SoundBuffer is similar to

View File

@ -40,7 +40,7 @@ class SoundFileReader;
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
@ -84,7 +84,9 @@ public :
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
///
@ -96,7 +98,9 @@ public :
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 sizeInBytes Total size of the file data, in bytes
@ -109,7 +113,9 @@ public :
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
///
@ -121,7 +127,9 @@ public :
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
///
@ -168,7 +176,7 @@ private:
/// \ingroup audio
///
/// 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
/// are wrapped into the higher-level classes sf::InputSoundFile and
/// sf::OutputSoundFile.

View File

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

View File

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

View File

@ -38,7 +38,7 @@
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()
{
static bool registered = false;

View File

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

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// 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.
// In no event will the authors be held liable for any damages arising from the use of this software.

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// 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.
// In no event will the authors be held liable for any damages arising from the use of this software.

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// 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.
// In no event will the authors be held liable for any damages arising from the use of this software.

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// 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.
// In no event will the authors be held liable for any damages arising from the use of this software.

View File

@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// 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.
// In no event will the authors be held liable for any damages arising from the use of this software.