mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
New audio playback API
Instead of having three states, stopped, paused and playing, now there's only two states: paused and playing. This means resume() is gone, as is isStopped(), and isPaused() has become isPlaying(). stop() now pauses and rewinds, whereas pause() only pauses. rewind() has been removed, and should either be replaced with stop() or seek(0). The same has been applied to the functions in the love.audio module, except they get some extra magic: - love.audio.pause() now returns a table/list of Source objects, which contains only the sources it has just paused. This means you can then later restart only them, instead of everything (as before). - love.audio.play/pause/stop now have variants that take a list of Source objects, and it starts or stops them all at the same time, this means calling play(srcA, srcB) should mean srcA and srcB are much more (but possibly not exactly) synchronised than they were with play(srcA); play(srcB). --HG-- branch : minor
This commit is contained in:
@@ -49,14 +49,13 @@ public:
|
||||
int getSourceCount() const;
|
||||
int getMaxSources() const;
|
||||
bool play(love::audio::Source *source);
|
||||
bool play(const std::vector<love::audio::Source*> &sources);
|
||||
void stop(love::audio::Source *source);
|
||||
void stop(const std::vector<love::audio::Source*> &sources);
|
||||
void stop();
|
||||
void pause(love::audio::Source *source);
|
||||
void pause();
|
||||
void resume(love::audio::Source *source);
|
||||
void resume();
|
||||
void rewind(love::audio::Source *source);
|
||||
void rewind();
|
||||
void pause(const std::vector<love::audio::Source*> &sources);
|
||||
std::vector<love::audio::Source*> pause();
|
||||
void setVolume(float volume);
|
||||
float getVolume() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user