com.brightcove.player.mediacontroller

## Class BrightcoveMediaControlRegistryImpl

- java.lang.Object
- - com.brightcove.player.mediacontroller.BrightcoveMediaControlRegistryImpl

- All Implemented Interfaces:
    BrightcoveMediaControlRegistry

      public class BrightcoveMediaControlRegistryImpl
      extends java.lang.Object
      implements BrightcoveMediaControlRegistry

  Provides a button controller registry where collections of button controllers are managed.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BrightcoveMediaControlRegistryImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears out the media controls and button controllers.
    `ButtonController` | `getButtonController(int id)` Gets a button controller for a given Android resource identifier.
    `java.util.List<ButtonController>` | `getButtonControllers()` Gets the list of registered button controllers.
    `int` | `getId(android.view.View view)` Gets the Android resource id for a given view.
    `int` | `getManagedState(int id)` Gets the managed state for a controller with a given button resource id.
    `java.util.List<ButtonState>` | `getStateList(int id)` Implements a getter for the state list associated with a given button.
    `android.view.View` | `getView(int id)` Implements a getter to obtain a button widget for a given button resource id.
    `android.view.View` | `getView(java.lang.String resourceTag)` Implements a getter to obtain a view given the tag part of a resource id, i.e.
    `void` | `register(ButtonController controller)` Implements to register a given button controller.
    `void` | `register(android.view.View view)` Registers a View object as a media control.

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

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

- - ### Constructor Detail

    - #### BrightcoveMediaControlRegistryImpl

          public BrightcoveMediaControlRegistryImpl()

  - ### Method Detail

    - #### clear

          public void clear()

      Clears out the media controls and button controllers.
      Specified by:
        `clear` in interface `BrightcoveMediaControlRegistry`
      See Also:
        `BrightcoveMediaControlRegistry.clear()`

    - #### getButtonControllers

          public java.util.List<ButtonController> getButtonControllers()

      Gets the list of registered button controllers.
      Specified by:
        `getButtonControllers` in interface `BrightcoveMediaControlRegistry`
      Returns:
        An empty list if not controllers are registered, the list of registered controllers otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getButtonControllers()`

    - #### getButtonController

          public ButtonController getButtonController(int id)

      Gets a button controller for a given Android resource identifier.
      Specified by:
        `getButtonController` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `id` - The given button identifier.
      Returns:
        null if there is no associated button controller, the associated ButtonController object otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getButtonController(int)`

    - #### getView

          public android.view.View getView(int id)

      Implements a getter to obtain a button widget for a given button resource id.
      Specified by:
        `getView` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `id` - The Android resource identifier.
      Returns:
        null if no such control exists in the registry, the View object otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getView(int)`

    - #### getView

          public android.view.View getView(java.lang.String resourceTag)

      Implements a getter to obtain a view given the tag part of a resource id, i.e. "@+id/tag".
      Specified by:
        `getView` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `resourceTag` - The Android resource identifier.
      Returns:
        null if no such control exists in the registry, the View object otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getView(String)`

    - #### getManagedState

          public int getManagedState(int id)

      Gets the managed state for a controller with a given button resource id.
      Specified by:
        `getManagedState` in interface `BrightcoveMediaControlRegistry`
      Returns:
        -1 if no matching controller is found, the non-negative value otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getManagedState(int)`

    - #### register

          public void register(ButtonController controller)

      Implements to register a given button controller.
      Specified by:
        `register` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `controller` - The given button controller.
      See Also:
        `BrightcoveMediaControlRegistry.register(com.brightcove.player.mediacontroller.buttons.ButtonController)`

    - #### register

          public void register(android.view.View view)

      Registers a View object as a media control. If the view is a ViewGroup, all children will be registered recursively.
      Specified by:
        `register` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `view` - The View to register.

    - #### getId

          public int getId(android.view.View view)

      Gets the Android resource id for a given view.
      Specified by:
        `getId` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `view` - The given media control view.
      Returns:
        -1 if there is no such View in the registry, the associated resource id otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getId(View)`

    - #### getStateList

          public java.util.List<ButtonState> getStateList(int id)

      Implements a getter for the state list associated with a given button.
      Specified by:
        `getStateList` in interface `BrightcoveMediaControlRegistry`
      Parameters:
        `id` - The given button resource id.
      Returns:
        an empty list if no button state has been defined for the given button, a non-empty list otherwise.
      See Also:
        `BrightcoveMediaControlRegistry.getStateList(int)`