Fixed: audioengine now remembers volume between tracks.

This commit is contained in:
Daniel Önnerby 2009-01-13 15:57:42 +00:00
parent a1fd1978c7
commit a07696751d
2 changed files with 6 additions and 3 deletions

View File

@ -125,9 +125,9 @@ double Player::Volume(){
}
void Player::SetVolume(double volume){
boost::mutex::scoped_lock lock(this->mutex);
this->volume = volume;
if(this->output){
boost::mutex::scoped_lock lock(this->mutex);
this->volume = volume;
this->output->SetVolume(this->volume);
}
}

View File

@ -67,6 +67,7 @@ void Transport::Start(utfstring url){
if(!player || player->url!=url){
// Or create a new player
player = Player::Create(url);
player->SetVolume(this->volume);
}
// Add to the players
@ -128,7 +129,9 @@ double Transport::Volume(){
void Transport::SetVolume(double volume){
this->volume = volume;
if(this->currentPlayer){
this->currentPlayer->SetVolume(volume);
for(PlayerList::iterator player=this->players.begin();player!=this->players.end();++player){
(*player)->SetVolume(volume);
}
}
}