Skip to content

Commit

Permalink
fixed muting all streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
asalga committed Dec 2, 2013
1 parent 374eae9 commit d6326da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ScreenGameplay.pde
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public class ScreenGameplay implements IScreen, Subject{
swapToken1.setReturning(true);
swapToken2.setReturning(true);

//soundManager.playFailSwapSound();
soundManager.playFailSwapSound();
}
// Swap was valid
else{
Expand Down
15 changes: 15 additions & 0 deletions SoundManager.pde
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SoundManager{
private String path;

public PlayerQueue(String audioPath){

path = audioPath;
players = new ArrayList<AudioPlayer>();
appendPlayer();
Expand Down Expand Up @@ -50,6 +51,17 @@ public class SoundManager{
AudioPlayer player = minim.loadFile(path);
players.add(player);
}

public void setMute(boolean m){
for(int i = 0; i < players.size(); i++){
if(m){
players.get(i).mute();
}
else{
players.get(i).unmute();
}
}
}
}

public void init(){
Expand All @@ -65,6 +77,9 @@ public class SoundManager{

public void setMute(boolean isMuted){
muted = isMuted;
successSwapPlayer.setMute(muted);
failSwapPlayer.setMute(muted);
matchPlayer.setMute(muted);
}

public boolean isMuted(){
Expand Down

0 comments on commit d6326da

Please sign in to comment.