Class: UEncode::CaptureOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/uencode/elements.rb

Constant Summary collapse

ATTRIBUTES =
[:rate, :stretch, :crop, :zip, :prefix]

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ CaptureOutput

Returns a new instance of CaptureOutput.



139
140
141
142
# File 'lib/uencode/elements.rb', line 139

def initialize(options)
  @destinations = []
  super
end

Instance Method Details

#add_destination(dest) ⇒ Object



144
145
146
# File 'lib/uencode/elements.rb', line 144

def add_destination(dest)
  @destinations << dest
end

#max_sizeObject



162
163
164
# File 'lib/uencode/elements.rb', line 162

def max_size
  @max_size
end

#max_size=(_max_size) ⇒ Object



157
158
159
160
# File 'lib/uencode/elements.rb', line 157

def max_size=(_max_size)
  _max_size = MaxSize.new(_max_size) unless _max_size.instance_of?(MaxSize) || _max_size.nil?
  instance_variable_set :@max_size, _max_size
end

#overlayObject



171
172
173
# File 'lib/uencode/elements.rb', line 171

def overlay
  @overlay
end

#overlay=(_overlay) ⇒ Object



166
167
168
169
# File 'lib/uencode/elements.rb', line 166

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

#sizeObject



153
154
155
# File 'lib/uencode/elements.rb', line 153

def size
  @size
end

#size=(_size) ⇒ Object



148
149
150
151
# File 'lib/uencode/elements.rb', line 148

def size=(_size)
  _size = Size.new(_size) unless _size.instance_of?(Size) || _size.nil?
  instance_variable_set :@size, _size
end

#to_xmlObject



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/uencode/elements.rb', line 175

def to_xml
  %Q{
    <capture>
        <rate>#{rate}</rate>
        #{!zip.nil? ? '<zip>' + zip.to_s + '</zip>' : ""}
        #{!prefix.nil? ? '<prefix>' + prefix.to_s + '</prefix>' : ""}
        <destinations>
          #{@destinations.inject("") { |s, dest| s << dest.to_xml}}
        </destinations>
      #{@size ? @size.to_xml : ""}
      #{@max_size ? @max_size.to_xml : ""}                    
      #{@overlay ? @overlay.to_xml : ""}
      </capture>
  }
end