You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm finishing up the JS integration for CEF with CasparCG and am looking for input on naming.
These are the currently available objects and methods.
Primary object:window.casparg
window.casparcg.sendOSC('address','value')
Will send out one monitor/OSC message like: /channel/1/stage/10/html/address value
Constant output is possible with requestAnimationFrame
Perhaps better named monitorOut, since OSC is just one of the outputs for monitor
window.casparcg.setState('string')
Will set a string to be output via monitor/OSC (constantly) and INFO.
OSC like: /channel/1/stage/10/html/state VALUE
Best to use an object for state in the template and then casparcg.setState(JSON.stringify(object))
window.casparcg.context
String: "CG" or "LOAD"
If the templated was loaded with CG or LOADBG/LOAD/PLAY ("LOAD")
window.casparcg.framerate
Channel framerate as int
window.casparcg.interlaced
Channel is interlaced as bool
window.casparcg.format
Returns string value for channel format, like "1080p5000"
window.casparcg.height
Channels height as int
window.casparcg.width
Channels width as int
window.casparcg.channel
Templates initial channel as int
Will not update with SWAP etc.
window.casparcg.layer
Templates initial layer as int
Will not update with SWAP etc.
window.casparcg.fullversion
CasparCG full version string
window.casparcg.version
Object with CasparCG version as "name", "general", "major", "minor", "tag", "revision" and "hash"
window.casparcg.paths
Object with configured paths as "initial" (path to folder with casparcg.exe)
and relative or absolute if configured as such paths: "media", "log", "data", "template", "thumbnail", "font"
window.casparcg.config
CasparCG's config file as JSON
window.casparcg.enableLog(true)
Toggle emitting log line events
Might be disabled if we need to use log lines for AMCP responses
window.casparcg.enableMonitor(true)
NOT IMPLEMENTED YET
Toggle emitting monitor/OSC events
window.casparg.amcp('PLAY 1-10 RED') or possibly window.casparg.amcp('PLAY 1-10 RED', callback)
NOT IMPLEMENTED YET
Performs an AMCP call, will likely not return.
Return might be provided through a callback or it could use REQ/RES ID's and parse response out of LOG lines
window.resizeTo(width,height)
Resizes the template
window.moveTo(x,y)
Only if the template is not at the channel width/height.
Moves the template rendering area within the channels dimensions.
E.g. window.resizeTo(1920,20); window.moveTo(0,1060) will just render 1920x20px at the bottom of a 1080 channel
From my tests it seems to be most performant to provide our own event emitter instead of using built-in custom events.
Listening to events would be: window.casparcgEvent.on(eventName, callback)
I'm finishing up the JS integration for CEF with CasparCG and am looking for input on naming.
These are the currently available objects and methods.
Primary object:
window.casparg
window.casparcg.sendOSC('address','value')
Will send out one monitor/OSC message like: /channel/1/stage/10/html/address value
Constant output is possible with requestAnimationFrame
Perhaps better named monitorOut, since OSC is just one of the outputs for monitor
window.casparcg.setState('string')
Will set a string to be output via monitor/OSC (constantly) and INFO.
OSC like: /channel/1/stage/10/html/state VALUE
Best to use an object for state in the template and then casparcg.setState(JSON.stringify(object))
window.casparcg.context
String: "CG" or "LOAD"
If the templated was loaded with CG or LOADBG/LOAD/PLAY ("LOAD")
window.casparcg.framerate
Channel framerate as int
window.casparcg.interlaced
Channel is interlaced as bool
window.casparcg.format
Returns string value for channel format, like "1080p5000"
window.casparcg.height
Channels height as int
window.casparcg.width
Channels width as int
window.casparcg.channel
Templates initial channel as int
Will not update with SWAP etc.
window.casparcg.layer
Templates initial layer as int
Will not update with SWAP etc.
window.casparcg.fullversion
CasparCG full version string
window.casparcg.version
Object with CasparCG version as "
name
", "general
", "major
", "minor
", "tag
", "revision
" and "hash
"window.casparcg.paths
Object with configured paths as "
initial
" (path to folder with casparcg.exe)and relative or absolute if configured as such paths: "
media
", "log
", "data
", "template
", "thumbnail
", "font
"window.casparcg.config
CasparCG's config file as JSON
window.casparcg.enableLog(true)
Toggle emitting log line events
Might be disabled if we need to use log lines for AMCP responses
window.casparcg.enableMonitor(true)
NOT IMPLEMENTED YET
Toggle emitting monitor/OSC events
window.casparg.amcp('PLAY 1-10 RED')
or possiblywindow.casparg.amcp('PLAY 1-10 RED', callback)
NOT IMPLEMENTED YET
Performs an AMCP call, will likely not return.
Return might be provided through a callback or it could use REQ/RES ID's and parse response out of LOG lines
window.resizeTo(width,height)
Resizes the template
window.moveTo(x,y)
Only if the template is not at the channel width/height.
Moves the template rendering area within the channels dimensions.
E.g. window.resizeTo(1920,20); window.moveTo(0,1060) will just render 1920x20px at the bottom of a 1080 channel
From my tests it seems to be most performant to provide our own event emitter instead of using built-in custom events.
Listening to events would be:
window.casparcgEvent.on(eventName, callback)
E.g:
window.casparcgEvent.on('log', callback)
window.casparcgEvent.on('monitor', callback)
The custom event emitter might be enhanced to do some filtering on monitor addresses, e.g.
window.casparcgEvent.on('/channel/1/stage/9',callback)
The text was updated successfully, but these errors were encountered: