Class: Matterhorn::Smil::Track

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

Overview

Matterhorn::Smil::Track ===

Instance Attribute Summary

Attributes inherited from Element

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

Instance Method Summary collapse

Methods inherited from Element

#attr_list

Constructor Details

#initialize(parent, kind, file, start_point, duration) ⇒ Track

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



351
352
353
354
355
356
357
# File 'lib/matterhorn/smil.rb', line 351

def initialize(parent, kind, file, start_point, duration)
  super(parent)
  @kind = kind
  @src = file
  self.start_point = start_point
  self.duration = duration
end

Instance Method Details

#propagate(parent_elem) ⇒ Object

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



362
363
364
# File 'lib/matterhorn/smil.rb', line 362

def propagate(parent_elem)
  @rel_begin = start_point - parent_elem.start_point
end

#to_xml(bx) ⇒ Object



367
368
369
370
371
372
373
# File 'lib/matterhorn/smil.rb', line 367

def to_xml(bx)
  attributes = attr_list
  if !@src.nil?
    attributes[:src] = @src.to_s
  end
  bx.send(@kind, attributes)
end