diff --git a/README.md b/README.md index 7d8ba8527..ed1de6097 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ Cross platform functionality * It should work on FreeBSD, Solaris and Haiku. -Graphic Module --------------- +Graphics Module +--------------- * Renderers for OpenGL 2 ( fixed-pipeline ), OpenGL 3 ( programmable-pipeline ), OpenGL ES 2, OpenGL ES 1, and OpenGL Core Profile. @@ -356,7 +356,7 @@ or For *mingw*: `premake4.exe gmake` -Then you will need the prebuild binaries and development libraries of [*SDL2*](http://libsdl.org/download-2.0.php) and [*openal-soft*](http://kcat.strangesoft.net/openal.html#download). Download the ones needed ( *VS* or *mingw* ). +Then you will need the prebuild binaries and development libraries of [SDL2](http://libsdl.org/download-2.0.php) and [openal-soft](http://kcat.strangesoft.net/openal.html#download). Download the ones needed ( *VS* or *mingw* ). Then the project files should be found in `make/windows/`. A solution (sln) for *Visual Studio* or the corresponding `Makefiles` for *mingw*. @@ -367,7 +367,7 @@ _**macOS**_ You have two options to build the project: with XCode or with gcc/clang manually. To build with any of both options first you will also need to build the project files with [premake4](https://premake.github.io/download.html). -Then you will need the prebuild binaries and development libraries of [*SDL2*](http://libsdl.org/download-2.0.php), OpenAL is included with the OS. Install the *SDL2* framework and you should be able to build the project. +Then you will need the prebuild binaries and development libraries of [SDL2](http://libsdl.org/download-2.0.php), OpenAL is included with the OS. Install the *SDL2* framework and you should be able to build the project. For a CLI build you can use the `projects/osx/make.sh` script, that generates the *Makefiles* and builds the project, also fix the dylibs generated. diff --git a/docs/doxyrest/sphinx/css/doxyrest-sphinx_rtd_theme.css b/docs/doxyrest/sphinx/css/doxyrest-sphinx_rtd_theme.css index aee0b912d..fadee463f 100644 --- a/docs/doxyrest/sphinx/css/doxyrest-sphinx_rtd_theme.css +++ b/docs/doxyrest/sphinx/css/doxyrest-sphinx_rtd_theme.css @@ -3,7 +3,6 @@ pre { font-family: 'Consolas', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace !important; border: 1px dashed #ccc !important; - background-color: #ffffe0 !important; } div[class^="highlight"] { @@ -12,28 +11,14 @@ div[class^="highlight"] { pre.doxyrest-overview-code-block { border: 1px solid #ccc !important; - background-color: #fff !important; } pre.doxyrest-overview-inherited-code-block { border: 1px solid #ccc !important; - background-color: #eee !important; } -pre.doxyrest-title-code-block { - font-size: larger !important; - border: none !important; - border-top: solid #ccc !important; - background-color: #f0f0f0 !important; -} - -code a { color:#000000 !important; text-decoration: underline !important } -code a:visited:hover { color: #3091d1 !important } -code a:visited { color: #000000 !important } - -pre a { color: #000000 !important; text-decoration: underline !important } -pre a:visited:hover { color: #3091d1 !important } -pre a:visited { color: #000000 !important } +code a { text-decoration: underline !important } +pre a { text-decoration: underline !important } td { white-space: normal !important; @@ -49,3 +34,218 @@ td { 25% { box-shadow: 0 0 8px 8px #8cf, 0 0 8px 8px #8cf inset; } 100% { box-shadow: none; } } + +pre.doxyrest-overview-code-block { + background-color: #201f1f !important; +} + +pre a { + color: #8abdff !important; +} + +pre a:visited { + color: #50a6df !important; +} + +pre { + background-color: #201f1f !important; +} + +.highlight .k { + color: #8a98ff !important; +} + +.highlight .kt { + color: #8abdff !important; +} + +.highlight .nb { + color: #8a98ff !important; +} + +.highlight .nl { + color: #8abdff !important; +} + +.highlight .c1 { + color: #cd8b00; +} + +.highlight .mi { + color: #f0ad6d; +} + +.highlight .s { + color: #ffcd8b; +} + +a:hover { + color: #70c6ff; +} + +a { + color: #33AEFF; +} + +.highlight .cpf { + color: #ffcd8b; +} + +body, +.wy-body-for-nav { + background: #45494d; +} + +.wy-nav-content { + background: #272b30; +} + +@media screen and (min-width: 1100px) { + .wy-nav-content { + background: #272b30; + } +} + +a:visited { + color: #50a6df; +} + +h1, h2, .rst-content .toctree-wrapper p.caption, h3, h4, h5, h6, legend { + color: #C2C2C7; +} + +pre, p, .wy-breadcrumbs li { + color: #B8B9BB; +} + +pre.doxyrest-title-code-block { + border-top: solid #525356 !important; + background-color: #363b42 !important; +} + +a { + color: #70c6ff; +} + +a:hover { + color: #9cd5fb; +} + +.wy-table-odd td, +.wy-table-striped tr:nth-child(2n-1) td, +.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td { + background-color:#272d35; +} + +.wy-table-backed { + background-color:#272d35; +} + +.wy-nav-content-wrap { + background-color: transparent; +} + +pre.doxyrest-title-code-block { + font-size: medium !important; +} + +.highlight .o { + color: + #cfcfcf; +} + +.wy-menu-vertical li.on a:hover, .wy-menu-vertical li.current > a:hover { + background: #5c5d5e; +} + +.wy-menu-vertical li.on a, .wy-menu-vertical li.current > a { + color: #e6e5e5; + background: #5c5d5e; +} + +.wy-menu-vertical li.toctree-l2.current > a { + background: #5f6264; +} + +.wy-menu-vertical li.toctree-l2 a, .wy-menu-vertical li.toctree-l3 a, .wy-menu-vertical li.toctree-l4 a { + color: #dedede; +} + +.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a { + background: #575a5c; +} + +.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a { + background: #5a5c5e; +} + +.wy-menu-vertical li.current a { + border-right: solid 0px #c9c9c9; +} + +.wy-menu-vertical li.current { + background: #45494d; +} + +.wy-nav-side { + background: #45494d; +} + +.wy-menu-vertical a:hover { + background-color: #5c5f62; +} + +.wy-menu-vertical li.on a:hover span.toctree-expand, .wy-menu-vertical li.current > a:hover span.toctree-expand { + color: white; +} + +.wy-menu-vertical li.on a span.toctree-expand, .wy-menu-vertical li.current > a span.toctree-expand { + color: #ccc; +} + +.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand { + color: white; +} + +.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand { + color: white; +} + +.wy-menu-vertical li.current a:hover { + background: #676a6c; +} + +.highlight .err { + border: 0px solid #F00; +} + +body { + color: #B8B9BB; +} + +code, .rst-content tt, .rst-content code { + background: #363b42; + border: solid 1px #606060; +} + +.rst-content tt.literal, .rst-content tt.literal, .rst-content code.literal { + color: #ccc; +} + +.wy-side-nav-search { + background-color: transparent; +} + +.wy-side-nav-search a, +.wy-side-nav-search a:visited, +.wy-side-nav-search a:hover { + color: white; +} + +.rst-content .highlighted { + background: #0F87F130; +} + +.wy-nav-content { + max-width: 1280px; +} diff --git a/include/eepp/audio.hpp b/include/eepp/audio.hpp index ba70dda65..4dfc4361d 100644 --- a/include/eepp/audio.hpp +++ b/include/eepp/audio.hpp @@ -12,9 +12,9 @@ #include #include #include +#include #include #include #include -#include #endif diff --git a/include/eepp/audio/alresource.hpp b/include/eepp/audio/alresource.hpp index cd8f1e66a..fa13a18ec 100644 --- a/include/eepp/audio/alresource.hpp +++ b/include/eepp/audio/alresource.hpp @@ -6,12 +6,12 @@ namespace EE { namespace Audio { class EE_API AlResource { - protected: - AlResource(); + protected: + AlResource(); - ~AlResource(); + ~AlResource(); }; -}} +}} // namespace EE::Audio #endif diff --git a/include/eepp/audio/inputsoundfile.hpp b/include/eepp/audio/inputsoundfile.hpp index 59ec7237c..75f763d97 100644 --- a/include/eepp/audio/inputsoundfile.hpp +++ b/include/eepp/audio/inputsoundfile.hpp @@ -1,15 +1,15 @@ #ifndef EE_AUDIO_INPUTSOUNDFILE_HPP #define EE_AUDIO_INPUTSOUNDFILE_HPP +#include #include #include #include #include -#include namespace EE { namespace System { class IOStream; -}} +}} // namespace EE::System using namespace EE::System; @@ -19,168 +19,166 @@ class SoundFileReader; /// \brief Provide read access to sound files class EE_API InputSoundFile : NonCopyable { - public: + public: + InputSoundFile(); - InputSoundFile(); + ~InputSoundFile(); - ~InputSoundFile(); + //////////////////////////////////////////////////////////// + /// \brief Open a sound file from the disk for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param filename Path of the sound file to load + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromFile( const std::string& filename ); - //////////////////////////////////////////////////////////// - /// \brief Open a sound file from the disk for reading - /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. - /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. - /// - /// \param filename Path of the sound file to load - /// - /// \return True if the file was successfully opened - /// - //////////////////////////////////////////////////////////// - bool openFromFile(const std::string& filename); + //////////////////////////////////////////////////////////// + /// \brief Open a sound file in memory for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param data Pointer to the file data in memory + /// \param sizeInBytes Size of the data to load, in bytes + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromMemory( const void* data, std::size_t sizeInBytes ); - //////////////////////////////////////////////////////////// - /// \brief Open a sound file in memory for reading - /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. - /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. - /// - /// \param data Pointer to the file data in memory - /// \param sizeInBytes Size of the data to load, in bytes - /// - /// \return True if the file was successfully opened - /// - //////////////////////////////////////////////////////////// - bool openFromMemory(const void* data, std::size_t sizeInBytes); + //////////////////////////////////////////////////////////// + /// \brief Open a sound file from a custom stream for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param stream Source stream to read from + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromStream( IOStream& stream ); - //////////////////////////////////////////////////////////// - /// \brief Open a sound file from a custom stream for reading - /// - /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. - /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. - /// - /// \param stream Source stream to read from - /// - /// \return True if the file was successfully opened - /// - //////////////////////////////////////////////////////////// - bool openFromStream(IOStream& stream); + //////////////////////////////////////////////////////////// + /// \brief Get the total number of audio samples in the file + /// + /// \return Number of samples + /// + //////////////////////////////////////////////////////////// + Uint64 getSampleCount() const; - //////////////////////////////////////////////////////////// - /// \brief Get the total number of audio samples in the file - /// - /// \return Number of samples - /// - //////////////////////////////////////////////////////////// - Uint64 getSampleCount() const; + //////////////////////////////////////////////////////////// + /// \brief Get the number of channels used by the sound + /// + /// \return Number of channels (1 = mono, 2 = stereo) + /// + //////////////////////////////////////////////////////////// + unsigned int getChannelCount() const; - //////////////////////////////////////////////////////////// - /// \brief Get the number of channels used by the sound - /// - /// \return Number of channels (1 = mono, 2 = stereo) - /// - //////////////////////////////////////////////////////////// - unsigned int getChannelCount() const; + //////////////////////////////////////////////////////////// + /// \brief Get the sample rate of the sound + /// + /// \return Sample rate, in samples per second + /// + //////////////////////////////////////////////////////////// + unsigned int getSampleRate() const; - //////////////////////////////////////////////////////////// - /// \brief Get the sample rate of the sound - /// - /// \return Sample rate, in samples per second - /// - //////////////////////////////////////////////////////////// - unsigned int getSampleRate() const; + //////////////////////////////////////////////////////////// + /// \brief Get the total duration of the sound file + /// + /// This function is provided for convenience, the duration is + /// deduced from the other sound file attributes. + /// + /// \return Duration of the sound file + /// + //////////////////////////////////////////////////////////// + Time getDuration() const; - //////////////////////////////////////////////////////////// - /// \brief Get the total duration of the sound file - /// - /// This function is provided for convenience, the duration is - /// deduced from the other sound file attributes. - /// - /// \return Duration of the sound file - /// - //////////////////////////////////////////////////////////// - Time getDuration() const; + //////////////////////////////////////////////////////////// + /// \brief Get the read offset of the file in time + /// + /// \return Time position + /// + //////////////////////////////////////////////////////////// + Time getTimeOffset() const; - //////////////////////////////////////////////////////////// - /// \brief Get the read offset of the file in time - /// - /// \return Time position - /// - //////////////////////////////////////////////////////////// - Time getTimeOffset() const; + //////////////////////////////////////////////////////////// + /// \brief Get the read offset of the file in samples + /// + /// \return Sample position + /// + //////////////////////////////////////////////////////////// + Uint64 getSampleOffset() const; - //////////////////////////////////////////////////////////// - /// \brief Get the read offset of the file in samples - /// - /// \return Sample position - /// - //////////////////////////////////////////////////////////// - Uint64 getSampleOffset() const; + //////////////////////////////////////////////////////////// + /// \brief Change the current read position to the given sample offset + /// + /// This function takes a sample offset to provide maximum + /// precision. If you need to jump to a given time, use the + /// other overload. + /// + /// The sample offset takes the channels into account. + /// If you have a time offset instead, you can easily find + /// the corresponding sample offset with the following formula: + /// `timeInSeconds * sampleRate * channelCount` + /// If the given offset exceeds to total number of samples, + /// this function jumps to the end of the sound file. + /// + /// \param sampleOffset Index of the sample to jump to, relative to the beginning + /// + //////////////////////////////////////////////////////////// + void seek( Uint64 sampleOffset ); - //////////////////////////////////////////////////////////// - /// \brief Change the current read position to the given sample offset - /// - /// This function takes a sample offset to provide maximum - /// precision. If you need to jump to a given time, use the - /// other overload. - /// - /// The sample offset takes the channels into account. - /// If you have a time offset instead, you can easily find - /// the corresponding sample offset with the following formula: - /// `timeInSeconds * sampleRate * channelCount` - /// If the given offset exceeds to total number of samples, - /// this function jumps to the end of the sound file. - /// - /// \param sampleOffset Index of the sample to jump to, relative to the beginning - /// - //////////////////////////////////////////////////////////// - void seek(Uint64 sampleOffset); + //////////////////////////////////////////////////////////// + /// \brief Change the current read position to the given time offset + /// + /// 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 + /// to the end of the sound file. + /// + /// \param timeOffset Time to jump to, relative to the beginning + /// + //////////////////////////////////////////////////////////// + void seek( Time timeOffset ); - //////////////////////////////////////////////////////////// - /// \brief Change the current read position to the given time offset - /// - /// 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 - /// to the end of the sound file. - /// - /// \param timeOffset Time to jump to, relative to the beginning - /// - //////////////////////////////////////////////////////////// - void seek(Time timeOffset); + //////////////////////////////////////////////////////////// + /// \brief Read audio samples from the open file + /// + /// \param samples Pointer to the sample array to fill + /// \param maxCount Maximum number of samples to read + /// + /// \return Number of samples actually read (may be less than \a maxCount) + /// + //////////////////////////////////////////////////////////// + Uint64 read( Int16* samples, Uint64 maxCount ); - //////////////////////////////////////////////////////////// - /// \brief Read audio samples from the open file - /// - /// \param samples Pointer to the sample array to fill - /// \param maxCount Maximum number of samples to read - /// - /// \return Number of samples actually read (may be less than \a maxCount) - /// - //////////////////////////////////////////////////////////// - Uint64 read(Int16* samples, Uint64 maxCount); + private: + //////////////////////////////////////////////////////////// + /// \brief Close the current file + /// + //////////////////////////////////////////////////////////// + void close(); - private: - - //////////////////////////////////////////////////////////// - /// \brief Close the current file - /// - //////////////////////////////////////////////////////////// - void close(); - - //////////////////////////////////////////////////////////// - // Member data - //////////////////////////////////////////////////////////// - SoundFileReader * mReader; ///< Reader that handles I/O on the file's format - IOStream* mStream; ///< Input stream used to access the file's data - bool mStreamOwned; ///< Is the stream internal or external? - Uint64 mSampleOffset; ///< Sample Read Position - Uint64 mSampleCount; ///< Total number of samples in the file - unsigned int mChannelCount; ///< Number of channels of the sound - unsigned int mSampleRate; ///< Number of samples per second + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + SoundFileReader* mReader; ///< Reader that handles I/O on the file's format + IOStream* mStream; ///< Input stream used to access the file's data + bool mStreamOwned; ///< Is the stream internal or external? + Uint64 mSampleOffset; ///< Sample Read Position + Uint64 mSampleCount; ///< Total number of samples in the file + unsigned int mChannelCount; ///< Number of channels of the sound + unsigned int mSampleRate; ///< Number of samples per second }; -}} +}} // namespace EE::Audio #endif diff --git a/include/eepp/audio/listener.hpp b/include/eepp/audio/listener.hpp index d8f19772a..0c6c4408e 100644 --- a/include/eepp/audio/listener.hpp +++ b/include/eepp/audio/listener.hpp @@ -10,162 +10,161 @@ namespace EE { namespace Audio { /// \brief The audio listener is the point in the scene /// from where all the sounds are heard class EE_API Listener { - public: + public: + //////////////////////////////////////////////////////////// + /// \brief Change the global volume of all the sounds and musics + /// + /// The volume is a number between 0 and 100; it is combined with + /// the individual volume of each sound / music. + /// The default value for the volume is 100 (maximum). + /// + /// \param volume New global volume, in the range [0, 100] + /// + /// \see getGlobalVolume + /// + //////////////////////////////////////////////////////////// + static void setGlobalVolume( float volume ); - //////////////////////////////////////////////////////////// - /// \brief Change the global volume of all the sounds and musics - /// - /// The volume is a number between 0 and 100; it is combined with - /// the individual volume of each sound / music. - /// The default value for the volume is 100 (maximum). - /// - /// \param volume New global volume, in the range [0, 100] - /// - /// \see getGlobalVolume - /// - //////////////////////////////////////////////////////////// - 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 + /// + //////////////////////////////////////////////////////////// + static float getGlobalVolume(); - //////////////////////////////////////////////////////////// - /// \brief Get the current value of the global volume - /// - /// \return Current global volume, in the range [0, 100] - /// - /// \see setGlobalVolume - /// - //////////////////////////////////////////////////////////// - static float getGlobalVolume(); + //////////////////////////////////////////////////////////// + /// \brief Set the position of the listener in the scene + /// + /// The default listener's position is (0, 0, 0). + /// + /// \param x X coordinate of the listener's position + /// \param y Y coordinate of the listener's position + /// \param z Z coordinate of the listener's position + /// + /// \see getPosition, setDirection + /// + //////////////////////////////////////////////////////////// + static void setPosition( float x, float y, float z ); - //////////////////////////////////////////////////////////// - /// \brief Set the position of the listener in the scene - /// - /// The default listener's position is (0, 0, 0). - /// - /// \param x X coordinate of the listener's position - /// \param y Y coordinate of the listener's position - /// \param z Z coordinate of the listener's position - /// - /// \see getPosition, setDirection - /// - //////////////////////////////////////////////////////////// - static void setPosition(float x, float y, float z); + //////////////////////////////////////////////////////////// + /// \brief Set the position of the listener in the scene + /// + /// The default listener's position is (0, 0, 0). + /// + /// \param position New listener's position + /// + /// \see getPosition, setDirection + /// + //////////////////////////////////////////////////////////// + static void setPosition( const Vector3f& position ); - //////////////////////////////////////////////////////////// - /// \brief Set the position of the listener in the scene - /// - /// The default listener's position is (0, 0, 0). - /// - /// \param position New listener's position - /// - /// \see getPosition, setDirection - /// - //////////////////////////////////////////////////////////// - static void setPosition(const Vector3f& position); + //////////////////////////////////////////////////////////// + /// \brief Get the current position of the listener in the scene + /// + /// \return Listener's position + /// + /// \see setPosition + /// + //////////////////////////////////////////////////////////// + static Vector3f getPosition(); - //////////////////////////////////////////////////////////// - /// \brief Get the current position of the listener in the scene - /// - /// \return Listener's position - /// - /// \see setPosition - /// - //////////////////////////////////////////////////////////// - static Vector3f getPosition(); + //////////////////////////////////////////////////////////// + /// \brief Set the forward vector of the listener in the scene + /// + /// The direction (also called "at vector") is the vector + /// pointing forward from the listener's perspective. Together + /// with the up vector, it defines the 3D orientation of the + /// listener in the scene. The direction vector doesn't + /// have to be normalized. + /// The default listener's direction is (0, 0, -1). + /// + /// \param x X coordinate of the listener's direction + /// \param y Y coordinate of the listener's direction + /// \param z Z coordinate of the listener's direction + /// + /// \see getDirection, setUpVector, setPosition + /// + //////////////////////////////////////////////////////////// + static void setDirection( float x, float y, float z ); - //////////////////////////////////////////////////////////// - /// \brief Set the forward vector of the listener in the scene - /// - /// The direction (also called "at vector") is the vector - /// pointing forward from the listener's perspective. Together - /// with the up vector, it defines the 3D orientation of the - /// listener in the scene. The direction vector doesn't - /// have to be normalized. - /// The default listener's direction is (0, 0, -1). - /// - /// \param x X coordinate of the listener's direction - /// \param y Y coordinate of the listener's direction - /// \param z Z coordinate of the listener's direction - /// - /// \see getDirection, setUpVector, setPosition - /// - //////////////////////////////////////////////////////////// - static void setDirection(float x, float y, float z); + //////////////////////////////////////////////////////////// + /// \brief Set the forward vector of the listener in the scene + /// + /// The direction (also called "at vector") is the vector + /// pointing forward from the listener's perspective. Together + /// with the up vector, it defines the 3D orientation of the + /// listener in the scene. The direction vector doesn't + /// have to be normalized. + /// The default listener's direction is (0, 0, -1). + /// + /// \param direction New listener's direction + /// + /// \see getDirection, setUpVector, setPosition + /// + //////////////////////////////////////////////////////////// + static void setDirection( const Vector3f& direction ); - //////////////////////////////////////////////////////////// - /// \brief Set the forward vector of the listener in the scene - /// - /// The direction (also called "at vector") is the vector - /// pointing forward from the listener's perspective. Together - /// with the up vector, it defines the 3D orientation of the - /// listener in the scene. The direction vector doesn't - /// have to be normalized. - /// The default listener's direction is (0, 0, -1). - /// - /// \param direction New listener's direction - /// - /// \see getDirection, setUpVector, setPosition - /// - //////////////////////////////////////////////////////////// - static void setDirection(const Vector3f& direction); + //////////////////////////////////////////////////////////// + /// \brief Get the current forward vector of the listener in the scene + /// + /// \return Listener's forward vector (not normalized) + /// + /// \see setDirection + /// + //////////////////////////////////////////////////////////// + static Vector3f getDirection(); - //////////////////////////////////////////////////////////// - /// \brief Get the current forward vector of the listener in the scene - /// - /// \return Listener's forward vector (not normalized) - /// - /// \see setDirection - /// - //////////////////////////////////////////////////////////// - static Vector3f getDirection(); + //////////////////////////////////////////////////////////// + /// \brief Set the upward vector of the listener in the scene + /// + /// The up vector is the vector that points upward from the + /// listener's perspective. Together with the direction, it + /// defines the 3D orientation of the listener in the scene. + /// The up vector doesn't have to be normalized. + /// The default listener's up vector is (0, 1, 0). It is usually + /// not necessary to change it, especially in 2D scenarios. + /// + /// \param x X coordinate of the listener's up vector + /// \param y Y coordinate of the listener's up vector + /// \param z Z coordinate of the listener's up vector + /// + /// \see getUpVector, setDirection, setPosition + /// + //////////////////////////////////////////////////////////// + static void setUpVector( float x, float y, float z ); - //////////////////////////////////////////////////////////// - /// \brief Set the upward vector of the listener in the scene - /// - /// The up vector is the vector that points upward from the - /// listener's perspective. Together with the direction, it - /// defines the 3D orientation of the listener in the scene. - /// The up vector doesn't have to be normalized. - /// The default listener's up vector is (0, 1, 0). It is usually - /// not necessary to change it, especially in 2D scenarios. - /// - /// \param x X coordinate of the listener's up vector - /// \param y Y coordinate of the listener's up vector - /// \param z Z coordinate of the listener's up vector - /// - /// \see getUpVector, setDirection, setPosition - /// - //////////////////////////////////////////////////////////// - static void setUpVector(float x, float y, float z); + //////////////////////////////////////////////////////////// + /// \brief Set the upward vector of the listener in the scene + /// + /// The up vector is the vector that points upward from the + /// listener's perspective. Together with the direction, it + /// defines the 3D orientation of the listener in the scene. + /// The up vector doesn't have to be normalized. + /// The default listener's up vector is (0, 1, 0). It is usually + /// not necessary to change it, especially in 2D scenarios. + /// + /// \param upVector New listener's up vector + /// + /// \see getUpVector, setDirection, setPosition + /// + //////////////////////////////////////////////////////////// + static void setUpVector( const Vector3f& upVector ); - //////////////////////////////////////////////////////////// - /// \brief Set the upward vector of the listener in the scene - /// - /// The up vector is the vector that points upward from the - /// listener's perspective. Together with the direction, it - /// defines the 3D orientation of the listener in the scene. - /// The up vector doesn't have to be normalized. - /// The default listener's up vector is (0, 1, 0). It is usually - /// not necessary to change it, especially in 2D scenarios. - /// - /// \param upVector New listener's up vector - /// - /// \see getUpVector, setDirection, setPosition - /// - //////////////////////////////////////////////////////////// - static void setUpVector(const Vector3f& upVector); - - //////////////////////////////////////////////////////////// - /// \brief Get the current upward vector of the listener in the scene - /// - /// \return Listener's upward vector (not normalized) - /// - /// \see setUpVector - /// - //////////////////////////////////////////////////////////// - static Vector3f getUpVector(); + //////////////////////////////////////////////////////////// + /// \brief Get the current upward vector of the listener in the scene + /// + /// \return Listener's upward vector (not normalized) + /// + /// \see setUpVector + /// + //////////////////////////////////////////////////////////// + static Vector3f getUpVector(); }; -}} +}} // namespace EE::Audio #endif diff --git a/include/eepp/audio/music.hpp b/include/eepp/audio/music.hpp index fb13a7d10..664ab0315 100644 --- a/include/eepp/audio/music.hpp +++ b/include/eepp/audio/music.hpp @@ -1,248 +1,236 @@ #ifndef EE_AUDIO_MUSIC_HPP #define EE_AUDIO_MUSIC_HPP -#include -#include #include +#include +#include #include -#include #include +#include #include #include namespace EE { namespace System { class IOStream; class Pack; -}} +}} // namespace EE::System using namespace EE::System; namespace EE { namespace Audio { /// \brief Streamed music played from an audio file -class EE_API Music : public SoundStream -{ - public: - /// \brief Structure defining a time range using the template type - template - struct Span - { - Span() - { +class EE_API Music : public SoundStream { + public: + /// \brief Structure defining a time range using the template type + template struct Span { + Span() {} - } + /// \brief Initialization constructor + /// \param off Initial Offset + /// \param len Initial Length + Span( T off, T len ) : offset( off ), length( len ) {} - /// \brief Initialization constructor - /// \param off Initial Offset - /// \param len Initial Length - Span(T off, T len): - offset(off), - length(len) - { + T offset; ///< The beginning offset of the time range + T length; ///< The length of the time range + }; - } + // Define the relevant Span types + typedef Span