Grabber::addListener Method |
|||||||||||||||||
This method registers a callback handler object for the specified events. | |||||||||||||||||
Syntax: | void addListener( GrabberListener* pListener, DWORD callback = -1 ); |
||||||||||||||||
|
|||||||||||||||||
Remarks: | This method is used to add a GrabberListener object to an internal list of the grabber. If one of the events occur that is defined by GrabberListener::tListenerType, the grabber calls the callback methods of all listener objects in the list that were added for this event. One GrabberListener object may handle more than one event. The parameter callback specifies the set of events that will be handled by the listener object. For possible values of callback, refer to GrabberListener::tListenerType. For more informations about callbacks, refer to GrabberListener. The GrabberListener::frameReady method will be called, if the sink is a FrameHandlerSink and snap mode is set to false or snap mode is set to true and FrameHandlerSink::snapImages was called. The GrabberListener::frameReady method will only be called, if a MemBufferCollection is used. To do so, create and set a FrameHandlerSink with at least one image buffer. |
||||||||||||||||
Sample: | For an example of how to use the addListener method, see Using a Callback Function. |
||||||||||||||||
See also: | Grabber, Grabber::removeListener, Grabber::isListenerRegistered, GrabberListener, GrabberListener::tListenerType, GrabberListener::frameReady, FrameHandlerSink, FrameHandlerSink::create, FrameHandlerSink::setSnapMode |