Class: ZoomPlayerMaxEdl

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

Class Method Summary collapse

Class Method Details

.convert_to_edl_string(specs) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/zoom_player_max_edl.rb', line 23

def self.convert_to_edl_string specs
  
  raise 'needs timestamps_relative_to--or rather, ping me if you want this for file based' unless specs['timestamps_relative_to']
  combined = EdlParser.convert_incoming_to_split_sectors specs
  raise unless mpeg_offset = specs['dvd_start_offset'] # TODO make this a class... also rename it mpeg_dvd_start_offset
  raise unless dvd_nav_packet_offsets = specs['dvd_nav_packet_offset']
  combined2 = EdlParser.convert_to_dvd_nav_times combined, specs['timestamps_relative_to'][0], mpeg_offset.to_f, dvd_nav_packet_offsets, specs['timestamps_relative_to'][1].to_f
  out = ""
  track = specs['dvd_title_track']
  out += "DVDTitle(#{track})\n"
=begin
  DVDTitle(1)
  CutSegment("Start=27.389","End=32.209")
  CutSegment("Start=73.510","End=78.510")
  MuteAudio("From=39.389","Duration=41.389")
=end
  for start, endy, type in combined2      
    if type == :mute
      out += %!MuteAudio("From=#{start}","Duration=#{endy-start}")\n!
    elsif type == :blank
      out += %!CutSegment("Start=#{start}","End=#{endy}")\n!
    else
      raise
    end
  end
  out
end