Improved API documentation (copied from SFML)

This commit is contained in:
Laurent Gomila committed 2011-09-02 20:15:45 +02:00
1 parent c84a787d0a
commit d734c9df5c
50 files changed
+1606 -1478

No files matched your search

+18 -23
View File
@@ -27,11 +27,10 @@
////////////////////////////////////////////////////////////
#include <SFML/Audio/SoundBuffer.h>
#include <SFML/Audio/SoundBufferStruct.h>
#include <SFML/CallbackStream.h>
#include <SFML/Internal.h>
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename)
{
@@ -47,8 +46,6 @@ sfSoundBuffer* sfSoundBuffer_CreateFromFile(const char* filename)
}
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from a file in memory
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInBytes)
{
@@ -64,10 +61,24 @@ sfSoundBuffer* sfSoundBuffer_CreateFromMemory(const void* data, size_t sizeInByt
}
////////////////////////////////////////////////////////////
/// Create a new sound buffer and load it from an array of
/// samples in memory - assumed format for samples is
/// 16 bits signed integer
CSFML_API sfSoundBuffer* sfSoundBuffer_CreateFromStream(sfInputStream* stream)
{
CSFML_CHECK_RETURN(stream, NULL);
sfSoundBuffer* buffer = new sfSoundBuffer;
CallbackStream sfmlStream(stream);
if (!buffer->This.LoadFromStream(sfmlStream))
{
delete buffer;
buffer = NULL;
}
return buffer;
}
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t samplesCount, unsigned int channelsCount, unsigned int sampleRate)
{
@@ -83,8 +94,6 @@ sfSoundBuffer* sfSoundBuffer_CreateFromSamples(const sfInt16* samples, size_t sa
}
////////////////////////////////////////////////////////////
/// Copy an existing sound buffer
////////////////////////////////////////////////////////////
sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer)
{
@@ -94,8 +103,6 @@ sfSoundBuffer* sfSoundBuffer_Copy(sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Destroy an existing sound buffer
////////////////////////////////////////////////////////////
void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer)
{
@@ -103,8 +110,6 @@ void sfSoundBuffer_Destroy(sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Save a sound buffer to a file
////////////////////////////////////////////////////////////
sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* filename)
{
@@ -112,8 +117,6 @@ sfBool sfSoundBuffer_SaveToFile(const sfSoundBuffer* soundBuffer, const char* fi
}
////////////////////////////////////////////////////////////
/// Return the samples contained in a sound buffer
////////////////////////////////////////////////////////////
const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer)
{
@@ -121,8 +124,6 @@ const sfInt16* sfSoundBuffer_GetSamples(const sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Return the number of samples contained in a sound buffer
////////////////////////////////////////////////////////////
size_t sfSoundBuffer_GetSamplesCount(const sfSoundBuffer* soundBuffer)
{
@@ -130,8 +131,6 @@ size_t sfSoundBuffer_GetSamplesCount(const sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Get the sample rate of a sound buffer
////////////////////////////////////////////////////////////
unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer)
{
@@ -139,8 +138,6 @@ unsigned int sfSoundBuffer_GetSampleRate(const sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Return the number of channels of a sound buffer (1 = mono, 2 = stereo, ...)
////////////////////////////////////////////////////////////
unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer)
{
@@ -148,8 +145,6 @@ unsigned int sfSoundBuffer_GetChannelsCount(const sfSoundBuffer* soundBuffer)
}
////////////////////////////////////////////////////////////
/// Get the duration of a sound buffer
////////////////////////////////////////////////////////////
sfUint32 sfSoundBuffer_GetDuration(const sfSoundBuffer* soundBuffer)
{