# ControlBroadcaster (Javadocs: controlP5)
Date: 2014-04-27

controlP5

## Class ControlBroadcaster

- java.lang.Object
- - controlP5.ControlBroadcaster

    public class ControlBroadcaster
    extends java.lang.Object

The ControlBroadcaster handles all controller value changes and distributes them accordingly to its listeners. The ControlBroadcaster is primarily for internal use only but can be accessed through an instance of the ControlP5 class. Instead of accessing the ControlBroadcaster directly, use the convenience methods available from the ControlP5 class.

See Also:
  `ControlP5.getControlBroadcaster()`

### Method Summary

Methods
`ControlBroadcaster` `addCallback(CallbackListener... theListeners)`
`ControlBroadcaster` `addCallback(CallbackListener theListener)`
`void` `addCallback(CallbackListener theListener, Controller<?>... theController)` Adds a CallbackListener for a list of controllers.
`ControlBroadcaster` `addListener(ControlListener... theListeners)`
`ControlBroadcaster` `broadcast(ControlEvent theControlEvent, int theType)`
`ControlListener` `getListener(int theIndex)` Returns a ControlListener by index
`static void` `ignoreErrorMessage(boolean theFlag)`
`int` `listenerSize()` Returns the size of the ControlListener list
`ControlBroadcaster` `plug(java.lang.Object theObject, Controller<?> theController, java.lang.String theTargetMethod)`
`ControlBroadcaster` `plug(java.lang.Object theObject, java.lang.String theControllerName, java.lang.String theTargetMethod)`
`void` `plug(java.lang.String theControllerName, java.lang.String theTargetMethod)` Deprecated.
`ControlBroadcaster` `removeCallback(CallbackListener... theListeners)`
`ControlBroadcaster` `removeCallback(CallbackListener theListener)`
`ControlBroadcaster` `removeCallback(Controller<?>... theControllers)` Removes a CallbackListener for a particular controller
`ControlBroadcaster` `removeListener(ControlListener... theListeners)`
`static void` `setPrintStackTrace(boolean theFlag)`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### addCallback

    public ControlBroadcaster addCallback(CallbackListener... theListeners)

#### addCallback

    public ControlBroadcaster addCallback(CallbackListener theListener)

#### addCallback

    public void addCallback(CallbackListener theListener,
                   Controller<?>... theController)

Adds a CallbackListener for a list of controllers.

Parameters:
  `theListener` -
  `theController` -

#### addListener

    public ControlBroadcaster addListener(ControlListener... theListeners)

#### broadcast

    public ControlBroadcaster broadcast(ControlEvent theControlEvent,
                               int theType)

#### getListener

    public ControlListener getListener(int theIndex)

Returns a ControlListener by index

Parameters:
  `theIndex` -
Returns:

#### ignoreErrorMessage

    public static void ignoreErrorMessage(boolean theFlag)

#### listenerSize

    public int listenerSize()

Returns the size of the ControlListener list

Returns:

#### plug

    public ControlBroadcaster plug(java.lang.Object theObject,
                          Controller<?> theController,
                          java.lang.String theTargetMethod)

#### plug

    public ControlBroadcaster plug(java.lang.Object theObject,
                          java.lang.String theControllerName,
                          java.lang.String theTargetMethod)

#### plug

    @Deprecated
    public void plug(java.lang.String theControllerName,
                       java.lang.String theTargetMethod)

Deprecated.

#### removeCallback

    public ControlBroadcaster removeCallback(CallbackListener... theListeners)

#### removeCallback

    public ControlBroadcaster removeCallback(CallbackListener theListener)

#### removeCallback

    public ControlBroadcaster removeCallback(Controller<?>... theControllers)

Removes a CallbackListener for a particular controller

Parameters:
  `theController` -

#### removeListener

    public ControlBroadcaster removeListener(ControlListener... theListeners)

#### setPrintStackTrace

    public static void setPrintStackTrace(boolean theFlag)