Class: FFSplitter::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/ffsplitter/chapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#listObject

Returns the value of attribute list.



12
13
14
# File 'lib/ffsplitter/chapter.rb', line 12

def list
  @list
end

Instance Method Details

#durationObject



22
23
24
# File 'lib/ffsplitter/chapter.rb', line 22

def duration
  end_time - start_time
end

#end_timeObject



18
19
20
# File 'lib/ffsplitter/chapter.rb', line 18

def end_time
  timebase * end_frames
end

#filenameObject



26
27
28
# File 'lib/ffsplitter/chapter.rb', line 26

def filename
  "#{track} #{title.gsub('/', ' - ').gsub(/[';:\\]/, '').lstrip}"
end

#indexObject



30
31
32
33
# File 'lib/ffsplitter/chapter.rb', line 30

def index
  return 0 if list.nil?
  list.find_index(self)
end

#start_timeObject



14
15
16
# File 'lib/ffsplitter/chapter.rb', line 14

def start_time
  timebase * start_frames
end

#trackObject



35
36
37
# File 'lib/ffsplitter/chapter.rb', line 35

def track
  (index + 1).to_s.rjust(2, '0')
end