FrequencyRulerViewer
Frequency ruler viewer canvas controller and coordinate tick renderer.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new FrequencyRulerViewer( canvas: HTMLCanvasElement, viewport: IViewportController, options?: Partial<FrequencyRulerConfig>): FrequencyRulerViewer;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
canvas | HTMLCanvasElement |
viewport | IViewportController |
options? | Partial<FrequencyRulerConfig> |
Returns
Section titled “Returns”FrequencyRulerViewer
Methods
Section titled “Methods”canvasToFrequency()
Section titled “canvasToFrequency()”canvasToFrequency(y: number): number;Converts canvas Y pixel position to frequency in Hz.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
y | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.canvasToFrequency
destroy()
Section titled “destroy()”destroy(): void;Disposes the frequency ruler renderer and event listeners.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”frequencyToCanvas()
Section titled “frequencyToCanvas()”frequencyToCanvas(freq: number): number;Converts frequency in Hz to canvas Y pixel position.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
freq | number |
Returns
Section titled “Returns”number
Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.frequencyToCanvas
getCanvas()
Section titled “getCanvas()”getCanvas(): HTMLCanvasElement;Returns the bound HTML canvas element.
Returns
Section titled “Returns”HTMLCanvasElement
Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.getCanvas
getConfig()
Section titled “getConfig()”getConfig(): ResolvedFrequencyRulerConfig;Returns the resolved frequency ruler configuration options.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.getConfig
getStatus()
Section titled “getStatus()”getStatus(): FrequencyRulerStatus;Returns the current render status.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.getStatus
getViewport()
Section titled “getViewport()”getViewport(): FrequencyRulerViewport;Returns the visible frequency viewport.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.getViewport
getViewportController()
Section titled “getViewportController()”getViewportController(): IViewportController;Returns the bound viewport controller.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.getViewportController
on<Name>(name: Name, handler: (event: FrequencyRulerEvents[Name]) => void): () => void;Subscribes to frequency ruler events.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Name extends keyof FrequencyRulerEvents |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | Name |
handler | (event: FrequencyRulerEvents[Name]) => void |
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”render()
Section titled “render()”render(): Promise<void>;Renders the current frequency ruler viewport asynchronously.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”requestRender()
Section titled “requestRender()”requestRender(): void;Schedules a render on the next animation frame.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.requestRender
setConfig()
Section titled “setConfig()”setConfig(input: Partial<FrequencyRulerOptions>): void;Alias for updateConfig.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | Partial<FrequencyRulerOptions> |
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IFrequencyRulerViewer.setConfig
setViewport()
Section titled “setViewport()”setViewport(vp: Partial<ViewportConfig>): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
vp | Partial<ViewportConfig> |
Returns
Section titled “Returns”void
updateConfig()
Section titled “updateConfig()”updateConfig(input: Partial<FrequencyRulerOptions>): void;Updates configuration options and triggers a re-render.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input | Partial<FrequencyRulerOptions> |
Returns
Section titled “Returns”void