mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-03 10:55:57 -04:00
Implement ChannelFinished()
This commit is contained in:
parent
ed12546cc5
commit
1ba35e5575
@ -113,6 +113,10 @@ int Mixer::FadeOutChannel(int channel, int ms) {
|
||||
return Mix_FadeOutChannel(channel, ms);
|
||||
}
|
||||
|
||||
void Mixer::ChannelFinished(ChannelFinishedHandler channel_finished) {
|
||||
Mix_ChannelFinished(channel_finished);
|
||||
}
|
||||
|
||||
int Mixer::Playing(int channel) const {
|
||||
return Mix_Playing(channel);
|
||||
}
|
||||
|
@ -41,6 +41,9 @@ class Chunk;
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
class Mixer {
|
||||
public:
|
||||
typedef void (*ChannelFinishedHandler)(int);
|
||||
|
||||
private:
|
||||
bool open_;
|
||||
|
||||
@ -300,7 +303,20 @@ public:
|
||||
////////////////////////////////////////////////////////////
|
||||
int FadeOutChannel(int channel, int ms);
|
||||
|
||||
// TODO: ChannelFinished
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set callback for when channel finishes playing
|
||||
///
|
||||
/// \param[in] channel_finished Function to call when any channel
|
||||
/// finishes playback
|
||||
///
|
||||
/// \note Since Mix_ChannelFinished doesn't take any custom data
|
||||
/// pointer, unfortunately there's no safe way of using
|
||||
/// std::function here.
|
||||
///
|
||||
/// \see https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC37
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void ChannelFinished(ChannelFinishedHandler channel_finished);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the active playing status of a channel
|
||||
|
Loading…
x
Reference in New Issue
Block a user