diff --git a/src/music.cpp b/src/music.cpp index ea6e772f0..b2e94f56c 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -347,6 +347,12 @@ tic_t Music_TotalDuration(const char* id) return tune ? tune->duration() : 0u; } +unsigned int Music_FadeOutDuration(const char* id) +{ + const Tune* tune = g_tunes.find(id); + return tune ? tune->fade_out : 0; +} + void Music_Loop(const char* id, boolean loop) { Tune* tune = g_tunes.find(id); diff --git a/src/music.h b/src/music.h index 9d3b5200e..eff0d660b 100644 --- a/src/music.h +++ b/src/music.h @@ -137,6 +137,10 @@ tic_t Music_DurationLeft(const char *id); // Returns the total duration of the tune, in tics. tic_t Music_TotalDuration(const char *id); +// Returns the number of milliseconds a tune is configured to +// fade for. +unsigned int Music_FadeOutDuration(const char *id); + // Returns the song name mapped to a tune. const char *Music_Song(const char *id);