Skip to content

Commit

Permalink
Change: ミュートはミュートで値を持つようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed May 2, 2024
1 parent 8d33f61 commit 2df8afc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/sing/audioRendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ export class ChannelStrip {
private readonly gainNode: GainNode;
private readonly panNode: StereoPannerNode;
private readonly muteNode: GainNode;
private readonly isMute = false;

get input(): AudioNode {
return this.gainNode;
Expand All @@ -891,11 +892,17 @@ export class ChannelStrip {
}

get mute(): boolean {
return this.muteNode.gain.value === 0;
return this.isMute;
}

set mute(value: boolean) {
this.muteNode.gain.value = value ? 0 : 1;
if (value) {
this.muteNode.gain.value = 0;
this.isMute = true;
} else {
this.muteNode.gain.value = 1;
this.isMute = false;
}
}

get volume() {
Expand Down

0 comments on commit 2df8afc

Please sign in to comment.