ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/cfplus
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/cfplus (file contents):
Revision 1.163 by root, Thu Jul 12 17:56:51 2007 UTC vs.
Revision 1.164 by root, Thu Jul 12 18:28:34 2007 UTC

2045 2045
2046 # default MUSIC_WANT, undef/0 == MUSIC_DEFAULT 2046 # default MUSIC_WANT, undef/0 == MUSIC_DEFAULT
2047 @MUSIC_WANT = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_WANT; 2047 @MUSIC_WANT = { path => CFPlus::find_rcfile "music/$MUSIC_DEFAULT" } unless @MUSIC_WANT;
2048 2048
2049 # if the currently playing song is acceptable, let it continue 2049 # if the currently playing song is acceptable, let it continue
2050 return if $MUSIC_PLAYING
2050 return if grep $MUSIC_PLAYING eq $_->{path}, @MUSIC_WANT; 2051 && grep $MUSIC_PLAYING->{path} eq $_->{path}, @MUSIC_WANT;
2051 2052
2052 if (defined $MUSIC_PLAYING) { 2053 if ($MUSIC_PLAYING) {
2053 warn "fade out"; 2054 warn "fade out";
2054 CFPlus::MixMusic::fade_out 2000; 2055 CFPlus::MixMusic::fade_out 1500;
2055 } else { 2056 } else {
2056 warn "new music\n"; 2057 warn "new music\n";
2057 2058
2058 my $music = $MUSIC_WANT [rand @MUSIC_WANT]; 2059 my $music = $MUSIC_WANT [rand @MUSIC_WANT];
2059 2060
2060 $MUSIC_PLAYING = $music->{path}; 2061 $MUSIC_PLAYING = $music;
2061 2062
2062 $MUSIC_PLAYER = new_from_file CFPlus::MixMusic $music->{path}; 2063 $MUSIC_PLAYER = new_from_file CFPlus::MixMusic $music->{path};
2063 $MUSIC_PLAYER->play (0); 2064 $MUSIC_PLAYER->play (0);
2064 } 2065 }
2065} 2066}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines