Class: Subconv::Scc::Caption
- Inherits:
-
Object
- Object
- Subconv::Scc::Caption
- Defined in:
- lib/subconv/scc/reader.rb
Overview
One fully rendered caption displayed at a specific point in time
Instance Attribute Summary collapse
-
#char_replacement ⇒ Object
writeonly
Sets the attribute char_replacement.
-
#grid ⇒ Object
Returns the value of attribute grid.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#timecode ⇒ Object
Returns the value of attribute timecode.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#char_replacement? ⇒ Boolean
Is this caption just replacing an existing character with an extended character?.
-
#initialize(args) ⇒ Caption
constructor
A new instance of Caption.
- #paint_on_mode? ⇒ Boolean
- #pop_on_mode? ⇒ Boolean
Constructor Details
#initialize(args) ⇒ Caption
Returns a new instance of Caption.
147 148 149 150 151 152 153 154 |
# File 'lib/subconv/scc/reader.rb', line 147 def initialize(args) # Inject default args = { mode: :pop_on, char_replacement: false }.merge(args) self.timecode = args[:timecode] self.grid = args[:grid] self.mode = args[:mode] self.char_replacement = args[:char_replacement] end |
Instance Attribute Details
#char_replacement=(value) ⇒ Object (writeonly)
Sets the attribute char_replacement
163 164 165 |
# File 'lib/subconv/scc/reader.rb', line 163 def char_replacement=(value) @char_replacement = value end |
#grid ⇒ Object
Returns the value of attribute grid.
164 165 166 |
# File 'lib/subconv/scc/reader.rb', line 164 def grid @grid end |
#mode ⇒ Object
Returns the value of attribute mode.
162 163 164 |
# File 'lib/subconv/scc/reader.rb', line 162 def mode @mode end |
#timecode ⇒ Object
Returns the value of attribute timecode.
164 165 166 |
# File 'lib/subconv/scc/reader.rb', line 164 def timecode @timecode end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
156 157 158 |
# File 'lib/subconv/scc/reader.rb', line 156 def ==(other) timecode == other.timecode && grid == other.grid && mode == other.mode && char_replacement? == other.char_replacement? end |
#char_replacement? ⇒ Boolean
Is this caption just replacing an existing character with an extended character?
181 182 183 |
# File 'lib/subconv/scc/reader.rb', line 181 def char_replacement? @char_replacement end |
#paint_on_mode? ⇒ Boolean
176 177 178 |
# File 'lib/subconv/scc/reader.rb', line 176 def paint_on_mode? @mode == :paint_on end |
#pop_on_mode? ⇒ Boolean
172 173 174 |
# File 'lib/subconv/scc/reader.rb', line 172 def pop_on_mode? @mode == :pop_on end |