[NEW] music::whichMusic()
This commit is contained in:
@@ -15,6 +15,7 @@ namespace audio
|
||||
|
||||
static char *buffer = nullptr;
|
||||
static Mix_Music *music = nullptr;
|
||||
static std::string music_filename = "";
|
||||
|
||||
// Inicialitza el sistema de só
|
||||
void init()
|
||||
@@ -47,6 +48,7 @@ namespace audio
|
||||
|
||||
if (music==nullptr) return false;
|
||||
|
||||
music_filename = filename;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,6 +101,12 @@ namespace audio
|
||||
}
|
||||
}
|
||||
|
||||
// Obté el nom de l'arxiu de música actual
|
||||
std::string whichMusic()
|
||||
{
|
||||
return music_filename;
|
||||
}
|
||||
|
||||
// Carrega un só des d'un arxiu WAV
|
||||
const sound *loadSound(const std::string filename)
|
||||
{
|
||||
|
||||
@@ -55,6 +55,10 @@ namespace audio
|
||||
/// @return estat actual de la música (MUSIC_INVALID, MUSIC_PLAYING, MUSIC_PAUSED o MUSIC_STOPPED)
|
||||
const music_state getMusicState();
|
||||
|
||||
/// @brief Obté el nom de l'arxiu de música actual
|
||||
/// @return el nom de l'arxiu
|
||||
std::string whichMusic();
|
||||
|
||||
/// @brief Carrega un só des d'un arxiu WAV
|
||||
/// @param filename nom de l'arxiu
|
||||
/// @return un punter al só
|
||||
|
||||
Reference in New Issue
Block a user