Stop sound when sound source is removed.

This commit is contained in:
Karol Nowak 2008-03-16 15:02:39 +00:00
parent 20368e4cd7
commit f50f49af9d
2 changed files with 6 additions and 0 deletions

View file

@ -110,6 +110,11 @@ positional_source::positional_source(const sourcespec &spec)
assert(_faderange > 0);
}
positional_source::~positional_source()
{
sound::reposition_sound(_id, DISTANCE_SILENT);
}
void positional_source::update(unsigned int time, const display &disp)
{
if(time - _last_played < _min_delay || sound::is_sound_playing(_id))

View file

@ -58,6 +58,7 @@ class positional_source {
// sound every second after the delay has passed or once the source
// becomes visible
positional_source(const sourcespec &spec);
~positional_source();
void update(unsigned int time, const display &disp);
void update_positions(unsigned int time, const display &disp);