|
| | SdlMusic (std::string path) |
| | ~SdlMusic () override |
| bool | isReady () const override |
| void | play () override |
| | Starts playback.
|
| void | pause () override |
| | Suspends playback without touching the position.
|
| void | stop () override |
| | Stops playback AND rewinds to zero.
|
| void | update () override |
| | SDL_mixer decode sur son propre fil : rien a pousser par frame.
|
| void | setVolume (float volume) override |
| | set the volume of the music
|
| float | getVolume () const override |
| | get the volume of the music
|
| void | setLoop (bool loop) override |
| | set the music to loop or not
|
| bool | getLoop () const override |
| | get if the music is looping or not
|
| void | setTime (float position) override |
| | Set the time of the music in seconds.
|
| float | getTime () const override |
| | Get the current time of the music in seconds.
|
| float | getLength () const override |
| | Get the Length of the music.
|
| void | setPosition (Vector3f position) override |
| | set the 3D position of the music, for backends that spatialize against a listener. A backend without real spatial audio may just store this and keep playing at full volume - a no-op here still leaves usable music, unlike a fake 3D model with nothing to render.
|
| Vector3f | getPosition () const override |
| | get the 3D position of the music
|
| void | setVelocity (Vector3f velocity) override |
| | set the velocity of the music, used by backends that apply a doppler effect
|
| Vector3f | getVelocity () const override |
| | get the velocity of the music
|
| | SdlMusic (MIX_Mixer *mixer, std::string path) |
| | ~SdlMusic () override |
| bool | isReady () const override |
| void | play () override |
| | Starts playback.
|
| void | pause () override |
| | Suspends playback without touching the position.
|
| void | stop () override |
| | Stops playback AND rewinds to zero.
|
| void | update () override |
| | SDL_mixer decode sur son propre fil : rien a pousser par frame.
|
| void | setVolume (float volume) override |
| | set the volume of the music
|
| float | getVolume () const override |
| | get the volume of the music
|
| void | setLoop (bool loop) override |
| | set the music to loop or not
|
| bool | getLoop () const override |
| | get if the music is looping or not
|
| void | setTime (float position) override |
| | Set the time of the music in seconds.
|
| float | getTime () const override |
| | la vraie position de lecture, que SDL2 ne savait pas donner
|
| float | getLength () const override |
| | Get the Length of the music.
|
| void | setPosition (Vector3f position) override |
| | set the 3D position of the music, for backends that spatialize against a listener. A backend without real spatial audio may just store this and keep playing at full volume - a no-op here still leaves usable music, unlike a fake 3D model with nothing to render.
|
| Vector3f | getPosition () const override |
| | get the 3D position of the music
|
| void | setVelocity (Vector3f velocity) override |
| | set the velocity of the music, used by backends that apply a doppler effect
|
| Vector3f | getVelocity () const override |
| | get the velocity of the music
|
| virtual | ~IMusic ()=default |
Un flux long, decode au fil de la lecture.
Un flux long, decode au fil de la lecture, sur sa propre piste.
SDL_mixer n'a qu'UN canal de musique pour tout le processus : deux SdlMusic existent tres bien cote a cote, mais la seconde a jouer remplace la premiere. Chaque objet verifie donc que le canal est encore le sien avant d'agir, sinon un stop() sur une musique arretee depuis longtemps couperait celle qui joue.
SDL3_mixer n'a plus de canal musique unique : une musique est une piste comme une autre, avec le tampon charge en flux plutot qu'en entier. Deux musiques peuvent donc jouer ensemble, ce que SDL2 rendait impossible - et plus besoin de verifier avant chaque ordre que le canal est encore le notre.
predecode = false : le fichier est lu au fur et a mesure, ce qui evite de mettre plusieurs minutes d'audio en memoire.
Starts playback.
Three states, and every action does ONLY what it says :
stopped --play()--> playing --pause()--> paused
paused --play()--> playing (resumes where it was)
stopped --play()--> playing (from zero)
play() on a stream that is already playing DOES NOTHING. It does not restart from the beginning : without that rule, a play() called every frame stutters on one vendor and plays normally on the other. To restart, call stop() then play(), or setTime(0) - explicitly.
Implements audio::IMusic.
Starts playback.
Three states, and every action does ONLY what it says :
stopped --play()--> playing --pause()--> paused
paused --play()--> playing (resumes where it was)
stopped --play()--> playing (from zero)
play() on a stream that is already playing DOES NOTHING. It does not restart from the beginning : without that rule, a play() called every frame stutters on one vendor and plays normally on the other. To restart, call stop() then play(), or setTime(0) - explicitly.
Implements audio::IMusic.