Low-level Ruby scripting API

Subtile Processor provides built-in Ruby modules (through Sourcepole's Delphi component) that contain module functions to enable calling of SP functions from Ruby. Although nothing prevents from using them directly, try not to use them and use the provided classes instead.

Proper care must be taken when passing parameters to these module functions. All functions expect the parameters to be of particular class, they will fail (cause access violations) when the class is other than expected. In most cases the data type is NOT CHECKED before conversion!!! So this is probably another reason to use the provided object framework instead of these modules.

All String values passed from SP to Ruby are encoded in UTF-8 and all values passed from Ruby to SP are expected to be in UTF-8.

All calls of interface functions are logged to the log window (when enabled) in this format:

[timestamp]function_name(<parameter>, <parameter>)

In the parentheses there is a list of all parameters that the function expects, expressed in this format:

<Class: value>

The value is recorded only for some classes:

API Modules

  1. SP general module
  2. Integration module
  3. Editor module
  4. Player module
  5. User Interface module
  6. Subtitles module
  7. Subtitle module
  8. Styles module
  9. Style module
The current API contains mostly functions to manipulate subtitles and associated objects. There are plenty of other objects and functions in SP that are not covered by this API yet. Other API modules will probably come in future versions of SP if there will be some demand. If you need some function added, use the feature request tracker on the project's page on SourceForge.