projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added game controller base mappings file
[rocksndiamonds.git]
/
src
/
libgame
/
sound.c
diff --git
a/src/libgame/sound.c
b/src/libgame/sound.c
index e860ba5ad443acd63e2669618d3f7c5e04c0872d..cb788e7e573769a7efeec3e8ff1fbeaec7692fc3 100644
(file)
--- a/
src/libgame/sound.c
+++ b/
src/libgame/sound.c
@@
-116,6
+116,8
@@
static MusicInfo **Music_NoConf = NULL;
static int num_music_noconf = 0;
static int stereo_volume[SOUND_MAX_LEFT2RIGHT + 1];
static int num_music_noconf = 0;
static int stereo_volume[SOUND_MAX_LEFT2RIGHT + 1];
+static char *currently_playing_music_filename = NULL;
+
/* ========================================================================= */
/* THE STUFF BELOW IS ONLY USED BY THE SOUND SERVER CHILD PROCESS */
/* ========================================================================= */
/* THE STUFF BELOW IS ONLY USED BY THE SOUND SERVER CHILD PROCESS */
@@
-242,6
+244,8
@@
static void Mixer_StopMusicChannel()
Mixer_StopChannel(audio.music_channel);
Mix_HaltMusic();
Mixer_StopChannel(audio.music_channel);
Mix_HaltMusic();
+
+ setString(¤tly_playing_music_filename, NULL);
}
static void Mixer_FadeChannel(int channel)
}
static void Mixer_FadeChannel(int channel)
@@
-259,6
+263,8
@@
static void Mixer_FadeMusicChannel()
Mixer_FadeChannel(audio.music_channel);
Mix_FadeOutMusic(SOUND_FADING_INTERVAL);
Mixer_FadeChannel(audio.music_channel);
Mix_FadeOutMusic(SOUND_FADING_INTERVAL);
+
+ setString(¤tly_playing_music_filename, NULL);
}
static void Mixer_UnFadeChannel(int channel)
}
static void Mixer_UnFadeChannel(int channel)
@@
-322,6
+328,9
@@
static void Mixer_InsertSound(SoundControl snd_ctrl)
mixer[audio.music_channel] = snd_ctrl;
Mixer_PlayMusicChannel();
mixer[audio.music_channel] = snd_ctrl;
Mixer_PlayMusicChannel();
+ setString(¤tly_playing_music_filename,
+ getBaseNamePtr(snd_info->source_filename));
+
return;
}
return;
}
@@
-696,6
+705,11
@@
static MusicInfo *getMusicInfoEntryFromMusicID(int pos)
return mus_info[list_pos];
}
return mus_info[list_pos];
}
+char *getCurrentlyPlayingMusicFilename()
+{
+ return currently_playing_music_filename;
+}
+
int getSoundListPropertyMappingSize()
{
return sound_info->num_property_mapping_entries;
int getSoundListPropertyMappingSize()
{
return sound_info->num_property_mapping_entries;