Class: CineSync::MediaBase
- Inherits:
-
Object
- Object
- CineSync::MediaBase
- Defined in:
- lib/cinesync/xml.rb,
lib/cinesync/media_file.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#active ⇒ Object
(also: #active?)
Returns the value of attribute active.
-
#current_frame ⇒ Object
Returns the value of attribute current_frame.
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#play_range ⇒ Object
Returns the value of attribute play_range.
-
#user_data ⇒ Object
Returns the value of attribute user_data.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MediaBase
constructor
A new instance of MediaBase.
-
#to_xml(x) ⇒ Object
MediaBase = aUserData? & attribute active { tBool }? & attribute currentFrame { tFrameNumber }? & eGroup* & ePlayRange?.
- #uses_pro_features? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
Instance Attribute Details
#active ⇒ Object Also known as: active?
Returns the value of attribute active.
11 12 13 |
# File 'lib/cinesync/media_file.rb', line 11 def active @active end |
#current_frame ⇒ Object
Returns the value of attribute current_frame.
11 12 13 |
# File 'lib/cinesync/media_file.rb', line 11 def current_frame @current_frame end |
#groups ⇒ Object
Returns the value of attribute groups.
12 13 14 |
# File 'lib/cinesync/media_file.rb', line 12 def groups @groups end |
#play_range ⇒ Object
Returns the value of attribute play_range.
12 13 14 |
# File 'lib/cinesync/media_file.rb', line 12 def play_range @play_range end |
#user_data ⇒ Object
Returns the value of attribute user_data.
11 12 13 |
# File 'lib/cinesync/media_file.rb', line 11 def user_data @user_data end |
Class Method Details
.load(elem) ⇒ Object
96 97 98 99 |
# File 'lib/cinesync/xml.rb', line 96 def self.load(elem) klass = elem.elements['groupMovie'] ? GroupMovie : MediaFile klass.load(elem) end |
Instance Method Details
#to_xml(x) ⇒ Object
MediaBase =
aUserData? &
attribute active { tBool }? &
attribute currentFrame { tFrameNumber }? &
eGroup* &
ePlayRange?
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/cinesync/xml.rb', line 80 def to_xml(x) fail "#{self.inspect}: Invalid" unless valid? attrs = {} attrs['userData'] = user_data unless user_data.empty? attrs['active'] = active? if active? attrs['currentFrame'] = current_frame if current_frame != 1 x.media(attrs) { yield x groups.each {|g| x.group(g) } play_range.to_xml(x) } end |
#uses_pro_features? ⇒ Boolean
25 26 27 |
# File 'lib/cinesync/media_file.rb', line 25 def uses_pro_features? false end |
#valid? ⇒ Boolean
29 30 31 |
# File 'lib/cinesync/media_file.rb', line 29 def valid? current_frame >= 1 and play_range.valid? end |