Class: Matterhorn::Smil::Seq

Inherits:
Element
  • Object
show all
Defined in:
lib/matterhorn/smil.rb

Overview

Matterhorn::Smil::Seq ===

Instance Attribute Summary

Attributes inherited from Element

#duration, #end_point, #parent, #rel_begin, #start_point

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Seq

————————————————————————— initialization —



286
287
288
289
290
# File 'lib/matterhorn/smil.rb', line 286

def initialize(parent)
  super(parent)
  @track_list = Array.new
  @scene_list = Array.new
end

Instance Method Details

#add_scene(file, clip_begin, clip_end) ⇒ Object



311
312
313
314
315
316
# File 'lib/matterhorn/smil.rb', line 311

def add_scene(file, clip_begin, clip_end)
  scene = Smil::Scene.new(self, file, clip_begin, clip_end)
  @scene_list.sort! { |a, b| a.clip_begin <=> b.clip_begin }
  @scene_list << scene
  scene
end

#add_track(kind, file, start_point, duration) ⇒ Object



302
303
304
305
306
307
308
# File 'lib/matterhorn/smil.rb', line 302

def add_track(kind, file, start_point, duration)
  track = Smil::Track.new(self, kind, file, start_point, duration)
  @track_list << track
  @track_list.sort! { |a, b| a.start_point <=> b.start_point }
  update(track)
  track
end

#attr_listObject

——————————————————————————— methodes —



295
296
297
298
299
# File 'lib/matterhorn/smil.rb', line 295

def attr_list
  attrib_list = super
  attrib_list.delete(:begin)
  attrib_list
end

#propagate(parent_elem) ⇒ Object



319
320
321
322
323
324
325
# File 'lib/matterhorn/smil.rb', line 319

def propagate(parent_elem)
  @rel_begin = start_point - parent_elem.start_point
  @track_list.each do |track|
    # propagate with par element
    track.propagate(parent_elem)
  end
end

#to_xml(bx) ⇒ Object



328
329
330
331
332
333
334
335
336
337
# File 'lib/matterhorn/smil.rb', line 328

def to_xml(bx)
  bx.seq(attr_list) do
    @track_list.each do |track|
      track.to_xml(bx)
    end
    @scene_list.each do |scene|
      scene.to_xml(bx)
    end
  end
end