Class: UEncode::VideoOutput

Inherits:
Object
  • Object
show all
Includes:
Enumerable, AttrSetting
Defined in:
lib/uencode/elements.rb

Constant Summary collapse

ATTRIBUTES =
[:destination, :container]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttrSetting

included, #set_attributes

Constructor Details

#initialize(options) ⇒ VideoOutput

Returns a new instance of VideoOutput.



273
274
275
276
277
# File 'lib/uencode/elements.rb', line 273

def initialize(options)
  @streams = VideoStreams.new
  @destinations = []
  super
end

Instance Attribute Details

#container=(value) ⇒ Object (writeonly)

Sets the attribute container

Parameters:

  • value

    the value to set the attribute container to.



241
242
243
# File 'lib/uencode/elements.rb', line 241

def container=(value)
  @container = value
end

#streamsObject

Returns the value of attribute streams.



242
243
244
# File 'lib/uencode/elements.rb', line 242

def streams
  @streams
end

Instance Method Details

#add_destination(dest) ⇒ Object



283
284
285
# File 'lib/uencode/elements.rb', line 283

def add_destination(dest)
  @destinations << dest
end

#clipObject



259
260
261
# File 'lib/uencode/elements.rb', line 259

def clip
  @clip
end

#clip=(_clip) ⇒ Object



254
255
256
257
# File 'lib/uencode/elements.rb', line 254

def clip=(_clip)
  _clip = Clip.new(_clip) unless _clip.instance_of?(Clip) || _clip.nil?
  instance_variable_set :@clip, _clip
end

#eachObject



279
280
281
# File 'lib/uencode/elements.rb', line 279

def each
  @items.each { |item|  yield item }
end

#metadataObject



268
269
270
# File 'lib/uencode/elements.rb', line 268

def 
  @metadata
end

#metadata=(_metadata) ⇒ Object



263
264
265
266
# File 'lib/uencode/elements.rb', line 263

def metadata=()
   = Metadata.new() unless .instance_of?(Metadata) || .nil?
  instance_variable_set :@metadata, 
end

#overlayObject



250
251
252
# File 'lib/uencode/elements.rb', line 250

def overlay
  @overlay
end

#overlay=(_overlay) ⇒ Object



245
246
247
248
# File 'lib/uencode/elements.rb', line 245

def overlay=(_overlay)
  _overlay = Overlay.new(_overlay) unless _overlay.instance_of?(Overlay) || _overlay.nil?
  instance_variable_set :@overlay, _overlay
end

#to_xmlObject



287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/uencode/elements.rb', line 287

def to_xml
  %Q{
      <video>
        <destinations>
        #{@destinations.inject("") { |s, dest| s << dest.to_xml}}                        
        </destinations>
        #{.nil? ? "" : .to_xml}
        #{clip.nil? ? "" : clip.to_xml}
        #{overlay.nil? ? "" : overlay.to_xml}
        <container>#{container}</container>
        #{@streams.to_xml}
      </video>
  }
end