MLT  7.28.0
mlt_events.h
Go to the documentation of this file.
1 
23 #ifndef MLT_EVENTS_H
24 #define MLT_EVENTS_H
25 
26 #include "mlt_types.h"
27 
29 typedef struct
30 {
31  union {
32  int i;
33  void *p;
34  } u;
36 
38 typedef struct
39 {
40  void **thread;
41  int *priority;
43  void *data;
45 
51 typedef void (*mlt_listener)(mlt_properties, void *, mlt_event_data);
52 
53 extern void mlt_events_init(mlt_properties self);
54 extern int mlt_events_register(mlt_properties self, const char *id);
55 extern int mlt_events_fire(mlt_properties self, const char *id, mlt_event_data);
57  void *listener_data,
58  const char *id,
59  mlt_listener listener);
60 extern void mlt_events_block(mlt_properties self, void *listener_data);
61 extern void mlt_events_unblock(mlt_properties self, void *listener_data);
62 extern void mlt_events_disconnect(mlt_properties self, void *listener_data);
63 
64 extern mlt_event mlt_events_setup_wait_for(mlt_properties self, const char *id);
65 extern void mlt_events_wait_for(mlt_properties self, mlt_event event);
67 
68 extern void mlt_event_inc_ref(mlt_event self);
69 extern void mlt_event_block(mlt_event self);
70 extern void mlt_event_unblock(mlt_event self);
71 extern void mlt_event_close(mlt_event self);
72 
76 extern mlt_event_data mlt_event_data_from_string(const char *value);
82 
83 #endif
void(* mlt_listener)(mlt_properties, void *, mlt_event_data)
event handler when receiving an event message
Definition: mlt_events.h:51
Provides forward definitions of all public types.
void *(* mlt_thread_function_t)(void *)
generic thread function pointer
Definition: mlt_types.h:271
struct mlt_properties_s * mlt_properties
pointer to Properties object
Definition: mlt_types.h:245
An event data structure to convey thread parameters.
Definition: mlt_events.h:39
int * priority
a priority level for the thread
Definition: mlt_events.h:41
void ** thread
a pointer to a thread object or handle as determined by you
Definition: mlt_events.h:40
void * data
an opaque data pointer to pass along
Definition: mlt_events.h:43
A container for data that may be supplied with an event.
Definition: mlt_events.h:30
int mlt_event_data_to_int(mlt_event_data event_data)
Get an integer from the event data.
Definition: mlt_events.c:502
int i
Definition: mlt_events.h:32
void * p
Definition: mlt_events.h:33
mlt_event_data mlt_event_data_from_object(void *value)
Initialize event data with opaque data.
Definition: mlt_events.c:566
void * mlt_event_data_to_object(mlt_event_data event_data)
Get a pointer from the event data.
Definition: mlt_events.c:580
mlt_event_data mlt_event_data_from_string(const char *value)
Initialize event data with a string.
Definition: mlt_events.c:514
mlt_event_data mlt_event_data_from_int(int value)
Initialize event data with an integer.
Definition: mlt_events.c:488
const char * mlt_event_data_to_string(mlt_event_data event_data)
Get a string from the event data.
Definition: mlt_events.c:528
mlt_frame mlt_event_data_to_frame(mlt_event_data event_data)
Get a frame from the event data.
Definition: mlt_events.c:554
mlt_event_data mlt_event_data_from_frame(mlt_frame frame)
Initialize event data with a frame.
Definition: mlt_events.c:540
mlt_event_data mlt_event_data_none()
Initialize an empty event data.
Definition: mlt_events.c:474
Event class.
Definition: mlt_events.c:62
void mlt_event_unblock(mlt_event self)
Decrement the block count on self event.
Definition: mlt_events.c:100
void mlt_event_inc_ref(mlt_event self)
Increment the reference count on self event.
Definition: mlt_events.c:76
void mlt_event_block(mlt_event self)
Increment the block count on self event.
Definition: mlt_events.c:88
void mlt_event_close(mlt_event self)
Close self event.
Definition: mlt_events.c:112
void mlt_events_init(mlt_properties self)
Initialise the events structure.
Definition: mlt_events.c:142
int mlt_events_fire(mlt_properties self, const char *id, mlt_event_data event_data)
Fire an event.
Definition: mlt_events.c:196
mlt_event mlt_events_listen(mlt_properties self, void *listener_data, const char *id, mlt_listener listener)
Register a listener.
Definition: mlt_events.c:230
void mlt_events_wait_for(mlt_properties self, mlt_event event)
Wait for an event.
Definition: mlt_events.c:412
int mlt_events_register(mlt_properties self, const char *id)
Register an event.
Definition: mlt_events.c:168
mlt_event mlt_events_setup_wait_for(mlt_properties self, const char *id)
Prepare to wait for an event.
Definition: mlt_events.c:396
void mlt_events_disconnect(mlt_properties self, void *listener_data)
Disconnect all events for a given listener_data.
Definition: mlt_events.c:345
void mlt_events_close_wait_for(mlt_properties self, mlt_event event)
Cleanup after waiting for an event.
Definition: mlt_events.c:427
void mlt_events_block(mlt_properties self, void *listener_data)
Block all events for a given listener_data.
Definition: mlt_events.c:291
void mlt_events_unblock(mlt_properties self, void *listener_data)
Unblock all events for a given listener_data.
Definition: mlt_events.c:318
Frame class.
Definition: mlt_frame.h:90
Properties class.
Definition: mlt_properties.h:40