Class: FFSplitter::Chapter
- Inherits:
-
Object
- Object
- FFSplitter::Chapter
- Defined in:
- lib/ffsplitter/chapter.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
Instance Method Summary collapse
- #duration ⇒ Object
- #end_time ⇒ Object
- #filename ⇒ Object
- #index ⇒ Object
- #start_time ⇒ Object
- #track ⇒ Object
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
12 13 14 |
# File 'lib/ffsplitter/chapter.rb', line 12 def list @list end |
Instance Method Details
#duration ⇒ Object
22 23 24 |
# File 'lib/ffsplitter/chapter.rb', line 22 def duration end_time - start_time end |
#end_time ⇒ Object
18 19 20 |
# File 'lib/ffsplitter/chapter.rb', line 18 def end_time timebase * end_frames end |
#filename ⇒ Object
26 27 28 |
# File 'lib/ffsplitter/chapter.rb', line 26 def filename "#{track} #{title.gsub('/', ' - ').gsub(/[';:\\]/, '').lstrip}" end |
#index ⇒ Object
30 31 32 33 |
# File 'lib/ffsplitter/chapter.rb', line 30 def index return 0 if list.nil? list.find_index(self) end |
#start_time ⇒ Object
14 15 16 |
# File 'lib/ffsplitter/chapter.rb', line 14 def start_time timebase * start_frames end |
#track ⇒ Object
35 36 37 |
# File 'lib/ffsplitter/chapter.rb', line 35 def track (index + 1).to_s.rjust(2, '0') end |