4.0.0
This release include a new Event and Style API, allow manipulation of then at run-time as well all libass API exposed to worker environment.
New functions
Wrapper
- octopusInstance.createEvent(event)
- octopusInstance.getEvents() - Print events in console, to get the events, edit this block
- octopusInstance.setEvent(event, index) - See setStyle
- octopusInstance.removeEvent()
- octopusInstance.createStyle(style)
- octopusInstance.getStyles() - Print Styles in console, to get the styles, edit this block
- octopusInstance.setStyle(style, index) - it is also possible to set the value of a single property instead of sending all values, eg.:
octopusInstance.setStyle({ FontName: "Arial" }, 0)
this will only set the font arial to style - octopusInstance.removeStyle()
Worker
This most not change at all but now have two new classes, self.octObj - SubtitleOctopus Native Class Wrapper instance, which contains every internal Wasm native functions used by this library and the class libass witch contains every libass public functions.
Native Code
Because of WebIDL, I have switched from C to C++, and now have three files, SubtitleOctopus.cpp (Native Wrapper), libass.cpp (libass Wrapper) and SubOctpInterface.cpp and SubOctpInterface.js - These files are generated by WebIDL bind-gen, from SubtitleOctopus.idl - If you want to modify SubtitleOctopus.cpp and/or libass.cpp you must delete SubOctpInterface.cpp and SubOctpInterface.js and edit SubtitleOctopus.idl.
ASS_Event Object
Property | Type |
---|---|
Start | Number(Int64) |
Duration | Number(Int64) |
ReadOrder | Number |
Layer | Number |
Style | Number |
Name | String |
MarginL | Number |
MarginR | Number |
MarginV | Number |
Effect | String |
Text | String |
ASS_Style Object
Property | Type |
---|---|
Name | String |
FontName | String |
FontSize | Number |
PrimaryColour | Number |
SecondaryColour | Number |
OutlineColour | Number |
BackColour | Number |
Bold | Number |
Italic | Number |
Underline | Number |
StrikeOut | Number |
ScaleX | Number(Double) |
ScaleY | Number(Double) |
Spacing | Number(Double) |
Angle | Number(Double) |
BorderStyle | Number |
Outline | Number(Double) |
Shadow | Number(Double) |
Alignment | Number |
MarginL | Number |
MarginR | Number |
MarginV | Number |
Encoding | Number |
treat_fontname_as_pattern | Number |
Blur | Number(Double) |
Justify | Number |