Class Mixer


  • public class Mixer
    extends java.lang.Object
    The mixer determines the final on-screen and in-ear state for visual elements and audio. An element is represented by a "Slot" that has a number of associated parameters to place an image stream spatially and set the gain of an audio stream from a device. Each slot can be bound to a single image device (such as a camera) and a single audio device (such as a microphone).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addSlot​(BroadcastConfiguration.Mixer.Slot slot)
      Add a new slot to the mixer configuration
      boolean bind​(Device device, java.lang.String slot)
      Bind a device's output to a mixer slot (specified in the mixer configuration) A common source of failure for this API is if a slot does not exist matching the provided slotName.
      java.lang.String getDeviceBinding​(Device device)
      Get a device's current binding, if it is bound.
      BroadcastConfiguration.Mixer.Slot[] getSlots()
      Returns the currently added slots.
      boolean removeSlot​(java.lang.String name)
      Remove a slot from the mixer configuration
      boolean transition​(java.lang.String slot, BroadcastConfiguration.Mixer.Slot nextState, double duration, java.lang.Runnable onComplete)
      Transition a slot to a new state Multiple concurrent transitions are not supported on the same slot.
      boolean unbind​(Device device)
      Unbind a device's output from a mixer slot (specified in the mixer configuration)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • bind

        public boolean bind​(Device device,
                            java.lang.String slot)
        Bind a device's output to a mixer slot (specified in the mixer configuration) A common source of failure for this API is if a slot does not exist matching the provided slotName. Use getSlots() to verify the slot exists.
        Parameters:
        device - The device to bind to the mixer
        slot - The target slot's name
        Throws:
        java.lang.IllegalArgumentException - If the device is null
      • unbind

        public boolean unbind​(Device device)
        Unbind a device's output from a mixer slot (specified in the mixer configuration)
        Parameters:
        device - The device to unbind from the mixer
        Throws:
        java.lang.IllegalArgumentException - If the device is null
      • getDeviceBinding

        @Nullable
        public java.lang.String getDeviceBinding​(Device device)
        Get a device's current binding, if it is bound.
        Parameters:
        device - The device to query
        Returns:
        A slot name if it is bound, otherwise null
        Throws:
        java.lang.IllegalArgumentException - If the device is null
      • transition

        public boolean transition​(java.lang.String slot,
                                  BroadcastConfiguration.Mixer.Slot nextState,
                                  double duration,
                                  @Nullable
                                  java.lang.Runnable onComplete)
        Transition a slot to a new state Multiple concurrent transitions are not supported on the same slot. If you initiate a second transition before the first is finished, the transition will start over from the original slot state and transition to the new state as if the first transition had never been made. If there are no devices to to the slot being animated, the duration parameter will be ignored and the slot will be updated immediately.
        Parameters:
        slot - The target slot's name
        nextState - The new state for the slot
        duration - The amount of time to animate the transition for
        onComplete - An optional callback that will be called when the animation has completed
        Returns:
        true if a matching slot was found and updated, false otherwise
      • addSlot

        public boolean addSlot​(BroadcastConfiguration.Mixer.Slot slot)
        Add a new slot to the mixer configuration
        Parameters:
        slot - The slot configuration to be added
        Returns:
        Success
      • removeSlot

        public boolean removeSlot​(java.lang.String name)
        Remove a slot from the mixer configuration
        Parameters:
        name - The slot to be removed
        Returns:
        Success
      • getSlots

        public BroadcastConfiguration.Mixer.Slot[] getSlots()
        Returns the currently added slots. For slots that are performing an animated transition, this will return the state of the slot before the transition.
        Returns:
        added slots