# class Gst::Bin

### Public Instance Methods

<<(element) click to toggle source

    # File lib/gst/bin.rb, line 29
    def <<(element)
      add_element(element)
      self
    end

add(*elements)
Also aliased as: add_element
Alias for: add_elements
add_element(*elements)
Alias for: add
add_elements(*elements) click to toggle source

    # File lib/gst/bin.rb, line 22
    def add_elements(*elements)
      elements.each do |element|
        add_element(element)
      end
    end

Also aliased as: add
each(options={}) { |value| ... } click to toggle source

    # File lib/gst/bin.rb, line 34
    def each(options={})
      return to_enum(:each, options) unless block_given?

      if options[:recurse]
        iterator = iterate_recurse
      elsif options[:sink]
        iterator = iterate_sinks
      elsif options[:sorted]
        iterator = iterate_sorted
      elsif options[:sources]
        iterator = iterate_sources
      elsif options[:interface]
        iterator = iterate_all_by_interface(options[:interface])
      else
        iterator = iterate_elements
      end

      loop do
        result, element = iterator.next
        case result
        when IteratorResult::DONE
          break
        when IteratorResult::OK
          yield(element.value)
        when IteratorResult::RESYNC
          iterator.resync
        when IteratorResult::ERROR
          raise "failed to iterate"
        end
      end
    end