-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up some pieces to support global limiter
* scaffolding for global limiter AWP * placeholder small view for destination node
- Loading branch information
Showing
5 changed files
with
86 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
class GlobalLimiterAWP extends AudioWorkletProcessor { | ||
constructor() { | ||
super(); | ||
|
||
this.isShutdown = false; | ||
|
||
this.port.onmessage = evt => this.handleMessage(evt.data); | ||
} | ||
|
||
handleMessage(data) { | ||
switch (data.type) { | ||
default: { | ||
console.error('Unhandled message type in global limiter AWP: ', evt.data.type); | ||
} | ||
} | ||
} | ||
|
||
process(inputs, outputs, _params) { | ||
if (this.isShutdown) { | ||
return false; | ||
} | ||
|
||
const input = inputs[0]?.[0]; | ||
const output = outputs[0]?.[0]; | ||
if (!input || !output) { | ||
return true; | ||
} | ||
|
||
// TODO | ||
|
||
return true; | ||
} | ||
} | ||
|
||
registerProcessor('global-limiter-awp', GlobalLimiterAWP); |
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
27 changes: 27 additions & 0 deletions
27
src/graphEditor/nodes/CustomAudio/Destination/DestinationNodeSmallView.svelte
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script lang="ts" context="module"> | ||
const buildSettings = (): ControlPanelSetting[] => [ | ||
{ type: 'checkbox', label: 'enable safety limiter' }, | ||
]; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import SvelteControlPanel, { | ||
type ControlPanelSetting, | ||
} from 'src/controls/SvelteControlPanel/SvelteControlPanel.svelte'; | ||
import type { CustomAudioDestinationNode } from 'src/graphEditor/nodes/CustomAudio/CustomAudio'; | ||
export let node: CustomAudioDestinationNode; | ||
$: settings = buildSettings(); | ||
</script> | ||
|
||
<div class="root"> | ||
<SvelteControlPanel title="destination settings" {settings} width={500} /> | ||
</div> | ||
|
||
<style lang="css"> | ||
.root { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
</style> |
11 changes: 11 additions & 0 deletions
11
src/graphEditor/nodes/CustomAudio/Destination/DestinationNodeSmallView.ts
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { CustomAudioDestinationNode, ForeignNode } from 'src/graphEditor/nodes/CustomAudio'; | ||
import { mkSvelteComponentShim } from 'src/svelteUtils'; | ||
import DestinationNodeSmallView from './DestinationNodeSmallView.svelte'; | ||
|
||
interface DestinationNodeSmallViewProps { | ||
node: ForeignNode<CustomAudioDestinationNode>; | ||
} | ||
|
||
export const DestinationNodeSmallViewShim = mkSvelteComponentShim( | ||
DestinationNodeSmallView as any | ||
) as unknown as React.FC<DestinationNodeSmallViewProps>; |