#include <music_buffer.h>
Inherited by NLSOUND::CMusicBufferVorbis.
Public Member Functions | |
| IMusicBuffer () | |
| virtual | ~IMusicBuffer () |
| virtual uint32 | getRequiredBytes ()=0 |
| Get how many bytes the music buffer requires for output minimum. | |
| virtual uint32 | getNextBytes (uint8 *buffer, uint32 minimum, uint32 maximum)=0 |
| Get an amount of bytes between minimum and maximum (can be lower than minimum if at end). | |
| virtual uint16 | getChannels ()=0 |
| Get the amount of channels (2 is stereo) in output. | |
| virtual uint32 | getSamplesPerSec ()=0 |
| Get the samples per second (often 44100) in output. | |
| virtual uint16 | getBitsPerSample ()=0 |
| Get the bits per sample (often 16) in output. | |
| virtual bool | isMusicEnded ()=0 |
| Get if the music has ended playing (never true if loop). | |
| virtual float | getLength ()=0 |
| Get the total time in seconds. | |
Static Public Member Functions | |
| static IMusicBuffer * | createMusicBuffer (const std::string &filepath, bool async, bool loop) |
| Create a new music buffer, may return NULL if unknown type, destroy with delete. Filepath lookup done here. If async is true, it will stream from hd, else it will load in memory first. | |
| static IMusicBuffer * | createMusicBuffer (const std::string &type, NLMISC::IStream *stream, bool loop) |
| Create a new music buffer from a stream, type is file extension like "ogg" etc. | |
| static bool | getInfo (const std::string &filepath, std::string &artist, std::string &title) |
| Get information on a music file (only artist and title at the moment). | |
Private Attributes | |
| NLMISC::IStream * | _InternalStream |
| Stream from file created by IMusicBuffer. | |
Definition at line 87 of file music_buffer.h.
| NLSOUND::IMusicBuffer::IMusicBuffer | ( | ) |
Definition at line 47 of file music_buffer.cpp.
| NLSOUND::IMusicBuffer::~IMusicBuffer | ( | ) | [virtual] |
Definition at line 52 of file music_buffer.cpp.
References _InternalStream.
| IMusicBuffer * NLSOUND::IMusicBuffer::createMusicBuffer | ( | const std::string & | type, | |
| NLMISC::IStream * | stream, | |||
| bool | loop | |||
| ) | [static] |
Create a new music buffer from a stream, type is file extension like "ogg" etc.
Definition at line 80 of file music_buffer.cpp.
References nlwarning, and NLMISC::toLower().
| IMusicBuffer * NLSOUND::IMusicBuffer::createMusicBuffer | ( | const std::string & | filepath, | |
| bool | async, | |||
| bool | loop | |||
| ) | [static] |
Create a new music buffer, may return NULL if unknown type, destroy with delete. Filepath lookup done here. If async is true, it will stream from hd, else it will load in memory first.
Definition at line 57 of file music_buffer.cpp.
References _InternalStream, NLMISC::CIFile::allowBNPCacheFileOnOpen(), nlwarning, NLMISC::CIFile::open(), and NLMISC::CIFile::setCacheFileOnOpen().
Referenced by NLSOUND::CMusicChannelXAudio2::play().
| virtual uint16 NLSOUND::IMusicBuffer::getBitsPerSample | ( | ) | [pure virtual] |
Get the bits per sample (often 16) in output.
Implemented in NLSOUND::CMusicBufferVorbis.
Referenced by NLSOUND::CMusicChannelXAudio2::play().
| virtual uint16 NLSOUND::IMusicBuffer::getChannels | ( | ) | [pure virtual] |
Get the amount of channels (2 is stereo) in output.
Implemented in NLSOUND::CMusicBufferVorbis.
Referenced by NLSOUND::CMusicChannelXAudio2::play().
| bool NLSOUND::IMusicBuffer::getInfo | ( | const std::string & | filepath, | |
| std::string & | artist, | |||
| std::string & | title | |||
| ) | [static] |
Get information on a music file (only artist and title at the moment).
Definition at line 99 of file music_buffer.cpp.
References NLMISC::CIFile::allowBNPCacheFileOnOpen(), nlwarning, NLMISC::CIFile::open(), NLMISC::CIFile::setCacheFileOnOpen(), and NLMISC::toLower().
Referenced by NLSOUND::CSoundDriverXAudio2::getMusicInfo().
| virtual float NLSOUND::IMusicBuffer::getLength | ( | ) | [pure virtual] |
Get the total time in seconds.
Implemented in NLSOUND::CMusicBufferVorbis.
Referenced by NLSOUND::CMusicChannelXAudio2::getLength().
| virtual uint32 NLSOUND::IMusicBuffer::getNextBytes | ( | uint8 * | buffer, | |
| uint32 | minimum, | |||
| uint32 | maximum | |||
| ) | [pure virtual] |
Get an amount of bytes between minimum and maximum (can be lower than minimum if at end).
Implemented in NLSOUND::CMusicBufferVorbis.
| virtual uint32 NLSOUND::IMusicBuffer::getRequiredBytes | ( | ) | [pure virtual] |
Get how many bytes the music buffer requires for output minimum.
Implemented in NLSOUND::CMusicBufferVorbis.
| virtual uint32 NLSOUND::IMusicBuffer::getSamplesPerSec | ( | ) | [pure virtual] |
Get the samples per second (often 44100) in output.
Implemented in NLSOUND::CMusicBufferVorbis.
Referenced by NLSOUND::CMusicChannelXAudio2::play().
| virtual bool NLSOUND::IMusicBuffer::isMusicEnded | ( | ) | [pure virtual] |
Get if the music has ended playing (never true if loop).
Implemented in NLSOUND::CMusicBufferVorbis.
Referenced by NLSOUND::CMusicChannelXAudio2::isEnded().
Stream from file created by IMusicBuffer.
Definition at line 92 of file music_buffer.h.
Referenced by createMusicBuffer(), and ~IMusicBuffer().
1.6.1