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

Methods inherited from Element

#add_scene

Constructor Details

#initialize(parent) ⇒ Seq

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



299
300
301
302
# File 'lib/matterhorn/smil.rb', line 299

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

Instance Method Details

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



314
315
316
317
318
319
320
# File 'lib/matterhorn/smil.rb', line 314

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 —



307
308
309
310
311
# File 'lib/matterhorn/smil.rb', line 307

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

#propagate(parent_elem) ⇒ Object



323
324
325
326
327
328
329
# File 'lib/matterhorn/smil.rb', line 323

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



332
333
334
335
336
337
338
339
340
341
# File 'lib/matterhorn/smil.rb', line 332

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