#include <stdint.h>
#include <libngf/proplist.h>
Go to the source code of this file.
◆ NgfCallback
Event state callback for receiving event completion status (failed, completed)
◆ NgfClient
Internal client structure.
◆ NgfEventState
◆ NgfTransport
◆ _NgfEventState
Enumerator |
---|
NGF_EVENT_FAILED | Event fails when we are unable to get resources for it or we just can't play it.
|
NGF_EVENT_COMPLETED | Event is completed when the event has been played or cancelled by higher priority event.
|
NGF_EVENT_PLAYING | Event is in playing state when playback is successfully started or continued.
|
NGF_EVENT_PAUSED | Event is in paused state when pause is called.
|
◆ _NgfTransport
Enumerator |
---|
NGF_TRANSPORT_DBUS | DBus transport is the only supported transport currently.
|
NGF_TRANSPORT_INTERNAL | Reserved for internal use.
|
◆ ngf_client_create()
Create a client instance to play events.
- Parameters
-
transport | NgfTransport. Currently only NGF_TRANSPORT_DBUS supported. |
... | Variable arguments passed to transports. |
- Returns
- NgfClient instance or NULL on error.
DBusConnection *conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL);
dbus_connection_setup_with_g_main (conn, NULL);
if (!client) {
fprintf (stderr, "Failed to create client!");
}
NgfClient * ngf_client_create(NgfTransport transport,...)
Create a client instance to play events.
struct _NgfClient NgfClient
Internal client structure.
Definition client.h:57
@ NGF_TRANSPORT_DBUS
DBus transport is the only supported transport currently.
Definition client.h:34
◆ ngf_client_destroy()
void ngf_client_destroy |
( |
NgfClient * | client | ) |
|
Free the clients resources.
- Parameters
-
◆ ngf_client_pause_event()
void ngf_client_pause_event |
( |
NgfClient * | client, |
|
|
uint32_t | id ) |
Pause active event.
- Parameters
-
client | NgfClient instance |
id | Event id. |
◆ ngf_client_play_event()
Play event with optional properties.
- Parameters
-
client | NgfClient instance |
event | Event identifier |
proplist | NgfProplist or NULL. |
- Returns
- Id of the event
uint32_t id = 0;
if (id == 0) {
fprintf (stderr, "Failed to play event!");
}
uint32_t ngf_client_play_event(NgfClient *client, const char *event, NgfProplist *proplist)
Play event with optional properties.
struct _NgfProplist NgfProplist
Internal property list instance.
Definition proplist.h:39
NgfProplist * ngf_proplist_new(void)
Create a new property list instance.
int ngf_proplist_sets(NgfProplist *proplist, const char *key, const char *value)
Set a string value to property list.
void ngf_proplist_free(NgfProplist *proplist)
Free property list.
◆ ngf_client_resume_event()
void ngf_client_resume_event |
( |
NgfClient * | client, |
|
|
uint32_t | id ) |
Resume paused event.
- Parameters
-
client | NgfClient instance |
id | Event id. |
◆ ngf_client_set_callback()
Set a callback to receive event completion updates.
- Parameters
-
client | NgfClient instance |
callback | Callback function, |
- See also
- NgfCallback
- Parameters
-
◆ ngf_client_stop_event()
void ngf_client_stop_event |
( |
NgfClient * | client, |
|
|
uint32_t | id ) |
Stop an active event.
- Parameters
-
client | NgfClient instance |
id | Event id. If no such event, nothing is done. |