Subtitles module - SPSubsInterface

Module used to manipulate subtitles collections in SP. 

Constants

Subtitles number

Used to specify whether the function should manipulate SP's first or second subtitles. Use these values when specifying value of subs_no parameter in all functions in thes module.SUBS_FIRST = 1
SUBS_SECOND = 2

Property  number

Use this to specify which property should be manipulated by a particular getter or setter function - what_prop parameter. Always use the constants, the actual numbers may change in future versions of SP.
SUBS_STRING_TITLE=1
SUBS_STRING_AUTHOR=2
SUBS_STRING_TRANSLATED_BY=3
SUBS_STRING_EDITED_BY=4
SUBS_STRING_TIMED_BY=5
SUBS_STRING_CHECKED_BY=6
SUBS_STRING_SYNCH_POINT=7
SUBS_STRING_UPDATE_AUTHOR=8
SUBS_STRING_UPDATE_DETAILS=9
SUBS_STRING_DEFAULT_STYLE_OVERRIDE=10
SUBS_FLOAT_FPS = 101
SUBS_FLOAT_TIMER_SPEED = 102
SUBS_FLOAT_TIMER_SHIFT = 103
SUBS_INT_CHARSET = 201
SUBS_INT_PLAYRES_X = 202
SUBS_INT_PLAYRES_Y = 203
SUBS_INT_PLAYRES_BPP = 204
SUBS_INT_WORDWRAP = 205
SUBS_INT_COLLISIONS = 206
SUBS_BOOL_CHANGED = 301

Property getters and setters

These functions are used to set or get values of subtitles collection's properties.  Common parameters are:

Return value of getter function is either:
Return value of setter function can be either:

Example:

puts "There are #{SPSubsInterface.get_subtitles_count(SUBS_FIRST)} subtitles in First subtitles collection."
get_subtitles_count(subs_no)

get_subtitles_string_prop(subs_no, what_prop)

set_subtitles_string_prop(subs_no, what_prop, prop_value)

get_subtitles_float_prop(subs_no, what_prop)

set_subtitles_float_prop(subs_no, what_prop, prop_value)

get_subtitles_int_prop(subs_no, what_prop)

set_subtitles_int_prop(subs_no, what_prop, prop_value)

get_subtitles_time_mode(subs_no)

set_subtitles_time_mode(subs_no, time_mode)

get_subtitles_bool_prop(subs_no, what_prop)

set_subtitles_bool_prop(subs_no, what_prop, prop_value)

Subtitles collection methods

These functions of SPSubsInterface enable to call corresponding methods of TSubtitles collection in SP. Common parameter is subs_no with the same meaning as with property getters.

add_subtitle(subs_no)

delete_subtitle(subs_no, sub_no)

insert_subtitle(subs_no, where)

clear_subtitles(subs_no)

disable_index_updates(subs_no)

enable_index_updates(subs_no)

enable_index_updates_immediate(subs_no)

sort_subtitles(subs_no, increasing)

get_indices(subs_no, frame_no)

get_unsynced_cnt(subs_no)

get_unsynced(subs_no, unsynced_index)

get_next_unsynced(subs_no, index)