Skip to content
Snippets Groups Projects
Commit 4a15ad05 authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

spa-device: add an "object-removed" signal

This is useful for monitors to destroy the associated device reservation
object. And it may be useful for other things in the future...
parent 13a56a74
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,7 @@ struct _WpSpaDevice
enum
{
SIGNAL_CREATE_OBJECT,
SIGNAL_OBJECT_REMOVED,
SPA_DEVICE_LAST_SIGNAL,
};
......@@ -380,6 +381,7 @@ spa_device_event_object_info (void *data, uint32_t id,
id, type, info->factory_name, props);
}
else {
g_signal_emit (self, spa_device_signals[SIGNAL_OBJECT_REMOVED], 0, id);
wp_spa_device_store_managed_object (self, id, NULL);
}
}
......@@ -509,6 +511,23 @@ wp_spa_device_class_init (WpSpaDeviceClass * klass)
"create-object", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL, G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_STRING,
G_TYPE_STRING, WP_TYPE_PROPERTIES);
/**
* WpSpaDevice::object-removed:
* @self: the #WpSpaDevice
* @id: the id of the managed object that was removed
*
* This signal is emitted when the device has deleted a managed object.
* The handler may optionally release additional resources associated
* with this object.
*
* It is not necessary to call wp_spa_device_store_managed_object()
* to remove the managed object, as this is done internally after this
* signal is fired.
*/
spa_device_signals[SIGNAL_OBJECT_REMOVED] = g_signal_new (
"object-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment