mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Audio context this binding
This commit is contained in:
parent
66d8fdc2c2
commit
6c4844cb87
@ -86,7 +86,7 @@ export class Audio implements OptionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
autoStart() {
|
autoStart = () => {
|
||||||
if (this.audioContext && !this.started) {
|
if (this.audioContext && !this.started) {
|
||||||
this.samples = [];
|
this.samples = [];
|
||||||
this.audioContext.resume();
|
this.audioContext.resume();
|
||||||
@ -94,14 +94,14 @@ export class Audio implements OptionHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start = () => {
|
||||||
if (this.audioContext) {
|
if (this.audioContext) {
|
||||||
this.samples = [];
|
this.samples = [];
|
||||||
this.audioContext.resume();
|
this.audioContext.resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isEnabled() {
|
isEnabled = () => {
|
||||||
return this.sound;
|
return this.sound;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ export class Audio implements OptionHandler {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
setOption(name: string, value: boolean) {
|
setOption = (name: string, value: boolean) => {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case SOUND_ENABLED_OPTION:
|
case SOUND_ENABLED_OPTION:
|
||||||
this.sound = value;
|
this.sound = value;
|
||||||
|
Loading…
Reference in New Issue
Block a user