Add a dynamic Feature playing a UISound

@api
@param string $soundName  UISound name
@param int    $variant    (optional) Sound variant
@param string $eventLabel (optional) Event on which the sound will be played
@return static
345099
public function addUISoundFeature($soundName, $variant = 0, $eventLabel = ScriptLabel::MOUSECLICK)
    {
        $uiSound = new UISound($soundName, $this, $variant, $eventLabel);
        $this->addScriptFeature($uiSound);
        return $this;
    }
3086
private function callListener(string $eventName, array $withArgs)
    {
        $listener = Container\get($eventName);

        if (is_callable($listener)) {
            return call_user_func_array($listener, $withArgs);
        }

        return null;
    }
1128121
function() {
    this.jsonInit({
      "message0": Blockly.Msg.SOUND_CHANGEEFFECTBY,
      "args0": [
        {
          "type": "field_dropdown",
          "name": "EFFECT",
          "options": [
            [Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
            [Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
          ]
        },
        {
          "type": "input_value",
          "name": "VALUE"
        }
      ],
      "category": Blockly.Categories.sound,
      "extensions": ["colours_sounds", "shape_statement"]
    });
  }
1334609
protected function addInterfaceListeners($eventName, array $listeners = [])
    {
        foreach (class_implements($eventName) as $interface) {
            if (isset($this->listeners[$interface])) {
                foreach ($this->listeners[$interface] as $names) {
                    $listeners = array_merge($listeners, (array) $names);
                }
            }
        }

        return $listeners;
    }
256642
public function addListener($eventName, $listener, $priority = 0)
    {
        $this->getDispatcher()->addListener($eventName, $listener, $priority);
    }
1017533
private function sortListeners(string $eventName = ''): MediatorInterface
    {
        if (0 === \count($this->listeners)) {
            return $this;
        }
        if ('' !== $eventName) {
            if (!\array_key_exists($eventName, $this->listeners)) {
                return $this;
            }
            $eventNames = [$eventName];
        } else {
            \ksort($this->listeners);
            $eventNames = \array_keys($this->listeners);
        }
        foreach ($eventNames as $anEvent) {
            \krsort($this->listeners[$anEvent], \SORT_NUMERIC);
        }
        return $this;
    }
639465
public function addListener(string $eventName, $listener) : void
    {
        $this->dispatcher->addListener($eventName, $listener);
    }
611101
public function dispatch($eventName, EventArguments $arguments = null)
    {
        if (false === $this->hasListeners($eventName)) {
            return $this;
        }
        $arguments = $arguments ?: EventArguments::createEmpty();
        foreach ($this->getListeners($eventName) as $listener) {
            $listener->$eventName($arguments);
        }
        return $this;
    }
673395
protected function newEvent(
        $eventName,
        $target = null,
        array $parameters = []
    )/*# : EventInterface */ {
        if (is_object($eventName)) {
            return $eventName;
        } else {
            return new Event($eventName, $target, $parameters);
        }
    }
1172525
public function addListenerForEvent($eventClassName, $listener)
    {
        if (FALSE === array_key_exists($eventClassName, $this->eventMap))
        {
            $this->eventMap[$eventClassName] = [];
        }
        $this->eventMap[$eventClassName][] = $listener;
    }
952644
public function getListeners($eventName)
    {
        $listeners = isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [];

        $listeners = array_merge(
            $listeners,
            $this->getWildcardListeners($eventName)
        );

        return class_exists($eventName, false)
            ? $this->addInterfaceListeners($eventName, $listeners)
            : $listeners;
    }
1114991
public function setPopupAttributes($variation=NULL, $popupEvent=NULL) {
		if (isset($this->_popup))
			$this->_popup->setAttributes($variation, $popupEvent);
	}
185438
public function listen($eventName, $callback)
    {
        if (is_array($eventName)) {
            foreach ($eventName as $evnt) {
                $this["dispatcher"]->addListener($evnt, $callback);
            }
        } else {
            $this["dispatcher"]->addListener($eventName, $callback);
        }
    }
1235138
public function getListeners(string $eventName) : array
    {
        if (!isset($this->events[$eventName])) {
            return [];
        }

        return $this->events[$eventName];
    }
831781
public void dispatchEvent(VariableEvent variableEvent) {
    boolean invokeCustomListeners =
        Context
          .getProcessEngineConfiguration()
          .isInvokeCustomVariableListeners();

    Map<String, List<VariableListener<?>>> listeners = getActivity()
        .getVariableListeners(variableEvent.getEventName(), invokeCustomListeners);

    // only attempt to invoke listeners if there are any (as this involves resolving the upwards execution hierarchy)
    if (!listeners.isEmpty()) {
      getCaseInstance().queueVariableEvent(variableEvent, invokeCustomListeners);
    }
  }
603508
function(eventName, options) {
    if (!this.__eventListeners) {
      this.__eventListeners = { }
    }
    var listenersForEvent = this.__eventListeners[eventName];
    if (!listenersForEvent) return;
    for (var i = 0, len = listenersForEvent.length; i < len; i++) {
      // avoiding try/catch for perf. reasons
      listenersForEvent[i](options || { });
    }
  }
348034
public static ActionListener getListener(BaseComponent component, String eventName) {
        return (ActionListener) component.getAttribute(ActionListener.getAttrName(eventName));
    }