Class: MplayerEdl

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

Class Method Summary collapse

Class Method Details

.convert_to_edl(specs, add_this_many_to_end = 0, add_this_many_to_beginning = 0, splits = [], extra_time_to_all = 0.0, use_english_timestamps = false) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/mplayer_edl.rb', line 23

def self.convert_to_edl specs, add_this_many_to_end = 0, add_this_many_to_beginning = 0, splits = [], extra_time_to_all = 0.0, use_english_timestamps = false
  
  # simple re-map to EDL style output
  combined = EdlParser.convert_incoming_to_split_sectors specs, add_this_many_to_end, add_this_many_to_beginning, splits
  
  out = ''
  map = {:mute => 1, :blank => 0}
  for start, endy, type in combined
    start += extra_time_to_all
    endy += extra_time_to_all
    if use_english_timestamps
      start = EdlParser.translate_time_to_human_readable start
      endy  = EdlParser.translate_time_to_human_readable endy
    end
    out += "#{start} #{endy} #{map[type]}\n"
  end
  out
end