modv (next) doxdox documentation

modular audio visualisation powered by JavaScript

# closeConnection()

Close the WebSocket connection and stop reconnecting

# send(data)

Send data to WebSocket if connection is established

Parameters

Name Types Description
data Object

# setupSocket()

Create a WebSocket for example to luminave

# stopReconnect()

Stop reconnecting to WebSocket

# render(Module, canvas, context, video, meydaFeatures, meyda, delta, bpm, kick)

Called each frame to update the Module

Parameters

Name Types Description
Module Object A 2D Module
canvas HTMLCanvas The Canvas to draw to
context CanvasRenderingContext2D The Context of the Canvas
video HTMLVideoElement The video stream requested by modV
meydaFeatures Array<MeydaFeatures> Requested Meyda features
meyda Meyda The Meyda instance (for Windowing functions etc.)
delta DOMHighResTimeStamp Timestamp returned by requestAnimationFrame
bpm Number The detected or tapped BPM
kick Boolean Indicates if BeatDetektor detected a kick in the audio stream

# updateModule()

Called each frame to update the Module

# updateModule()

Called each frame to update the Module

# updateModule()

Called each frame to update the Module

# render(Module, canvas, context, video, features, meyda, delta, bpm, kick)

Called each frame to update the Module

Parameters

Name Types Description
Module Object A three Module
canvas HTMLCanvas The Canvas to draw to
context WebGL2RenderingContext The Context of the Canvas
video HTMLVideoElement The video stream requested by modV
features Array<MeydaFeatures> Requested Meyda features
meyda Meyda The Meyda instance (for Windowing functions etc.)
delta DOMHighResTimeStamp Timestamp returned by requestAnimationFrame
bpm Number The detected or tapped BPM
kick Boolean Indicates if BeatDetektor detected a kick in the audio stream

# updateModule()

Called each frame to update the Module

# value()

# getDefaultState()

# getDefaultState()

# state()

Holds processed media

# actions()

# init(options.binaryPath, options.exists, options.join, util.log)

Called before File Handler is added to the Media Manager. Should return a Promise resolving true or a FileOutputContext if the File Handler is ready to be added to the Media Manager. This function can be omitted if no checks or pre-requisites need to be made or fetched.

Parameters

Name Types Description
options.binaryPath String Path to a common binaries folder to store binaries the handler may require.
options.exists Function async Function which returns true if a file or folder exists, false otherwise.
options.join Function Function to join paths together with the appropriate filesystem delimiter. Similar to fs.join.
util.log Function Log something to the console.

Returns

Promise<true|FileOutputContext>

# process(options.file, options.fileName, options.fileType, util.log)

Takes in a readable stream, processes file accordingly and outputs file location plus stream

Parameters

Name Types Description
options.file Stream Readable stream of file.
options.fileName String The file's name.
options.fileType String The file's extension type e.g. .jpeg.
util.log Function Log something to the console.

Returns

Promise<true|OutputFileContext|Error>

A Promise resolving with `true` if the file needed no modification and can remain in the same folder. A Promise resolving a `OutputFileContext` if the file required processing. A Promise rejecting with `Error` if something went wrong.

# process(options.file, options.fileName, options.fileType, options.filePath, util.log)

Takes in a readable stream, processes file accordingly and outputs file location plus stream

Parameters

Name Types Description
options.file Stream Readable stream of file.
options.fileName String The file's name.
options.fileType String The file's extension type e.g. .jpeg.
options.filePath String The path to the file.
util.log Function Log something to the console.

Returns

Promise<true|OutputFileContext|Error>

A Promise resolving with `true` if the file needed no modification and can remain in the same folder. A Promise resolving a `OutputFileContext` if the file required processing. A Promise rejecting with `Error` if something went wrong.

# process(options.file, options.fileName, options.fileType, options.filePath, util.log)

Takes in a readable stream, processes file accordingly and outputs file location plus stream

Parameters

Name Types Description
options.file Stream Readable stream of file.
options.fileName String The file's name.
options.fileType String The file's extension type e.g. .jpeg.
options.filePath String The path to the file.
util.log Function Log something to the console.

Returns

Promise<true|OutputFileContext|Error>

A Promise resolving with `true` if the file needed no modification and can remain in the same folder. A Promise resolving a `OutputFileContext` if the file required processing. A Promise rejecting with `Error` if something went wrong.

# process(options.file, options.fileName, options.fileType, util.log)

Takes in a readable stream, processes file accordingly and outputs file location plus stream

Parameters

Name Types Description
options.file Stream Readable stream of file.
options.fileName String The file's name.
options.fileType String The file's extension type e.g. .jpeg.
util.log Function Log something to the console.

Returns

Promise<true|OutputFileContext|Error>

A Promise resolving with `true` if the file needed no modification and can remain in the same folder. A Promise resolving a `OutputFileContext` if the file required processing. A Promise rejecting with `Error` if something went wrong.

# constructor(page)

Parameters

Name Types Description
page import('@playwright/test').Page