-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
52 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
namespace $ { | ||
// const api = require('web-audio-api') as { AudioContext: new() => AudioContext } | ||
|
||
// export const $mol_audio_context_node = new api.AudioContext() | ||
export const $mol_audio_context_node = new Proxy({} as AudioContext, { | ||
get() { | ||
throw new Error('Not implemented') | ||
export class $mol_audio_context_node extends $mol_audio_context { | ||
|
||
@ $mol_memo.method | ||
static override context() { | ||
const AudioContext = this.$.$mol_dom_context.AudioContext || this.$.$node['web-audio-api'].AudioContext | ||
return new AudioContext() | ||
} | ||
}) | ||
} | ||
|
||
$.$mol_audio_context = $mol_audio_context_node | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
namespace $ { | ||
export let $mol_audio_context = undefined as unknown as AudioContext | ||
export class $mol_audio_context extends $mol_object2 { | ||
static context(): AudioContext { | ||
throw new Error('implement') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
namespace $ { | ||
export const $mol_audio_context_web = new AudioContext() | ||
export class $mol_audio_context_web extends $mol_audio_context { | ||
|
||
@ $mol_memo.method | ||
static override context() { | ||
return new this.$.$mol_dom_context.AudioContext() | ||
} | ||
} | ||
|
||
$.$mol_audio_context = $mol_audio_context_web | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters