--- deliantra/Deliantra-Client/bin/cfplus 2007/08/28 01:23:47 1.223 +++ deliantra/Deliantra-Client/bin/cfplus 2007/08/30 07:57:59 1.224 @@ -317,7 +317,7 @@ if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { my $pos = $MUSIC_PLAYING_META->{stop_pos}; - $MUSIC_PLAYER->fade_in_pos (0, 1000, $pos); + $MUSIC_PLAYER->fade_in_pos (0, 700, $pos); $MUSIC_START = time - $pos; } else { $MUSIC_PLAYER->play (0); @@ -345,12 +345,15 @@ map $CONN->{face}[$_], @$MUSIC_WANT; + # randomize music a bit so that the order is not always the same + $_->{stop_time} ||= rand for @have; + @MUSIC_HAVE = @have if @have; # default MUSIC_HAVE == MUSIC_DEFAULT @MUSIC_HAVE = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_HAVE; - $fade_out = 1000; + $fade_out = 700; } # if the currently playing song is acceptable, let it continue @@ -369,7 +372,7 @@ # if the most recently-played piece played very recently, # resume it, else choose the oldest piece for rotation. audio_music_set_meta - $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME + $MUSIC_HAVE[-1]{stop_pos} && $MUSIC_HAVE[-1]{stop_time} > $NOW - $MUSIC_RESUME ? $MUSIC_HAVE[-1] : $MUSIC_HAVE[0]; @@ -385,6 +388,10 @@ } sub audio_music_finished { + if ($MUSIC_PLAYING_META) { + $MUSIC_PLAYING_META->{stop_time} = time; + } + # we compress multiple jingles of the same type shift @MUSIC_JINGLE while @MUSIC_JINGLE && $MUSIC_PLAYING_META == $MUSIC_JINGLE[0];