Module uk.co.caprica.vlcj
Class NativeEventManager<E,L>
java.lang.Object
uk.co.caprica.vlcj.support.eventmanager.NativeEventManager<E,L>
- Type Parameters:
E
- type of the event objectL
- type of the event listener
- Direct Known Subclasses:
MediaListPlayerNativeEventManager
Common implementation for a component that deals with a native LibVlc event manager.
Native events will only be delivered if there is at least one event listener.
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addEventListener
(L listener) Add a component to be notified of events.final void
raiseEvent
(EventNotification<L> event) Raise a new event (dispatch it to listeners).final void
release()
Release this component.final void
removeEventListener
(L listener) Remove a component that was previously interested in notifications of events.
-
Method Details
-
addEventListener
Add a component to be notified of events.- Parameters:
listener
- component to notify
-
removeEventListener
Remove a component that was previously interested in notifications of events.- Parameters:
listener
- component to stop notifying
-
raiseEvent
Raise a new event (dispatch it to listeners).Events are processed on the native callback thread, so must execute quickly and certainly must never block.
It is also generally forbidden for an event handler to call back into LibVLC.
- Parameters:
event
- event to raise, may benull
and if so will be ignored
-
release
public final void release()Release this component.
-