mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
simplify events and commands
This commit is contained in:
parent
0373f73bac
commit
d3dd90bb05
25 changed files with 220 additions and 252 deletions
|
|
@ -216,7 +216,7 @@ alsa_on_fd_events (SpaPollNotifyData *data)
|
|||
SpaALSAMonitor *this = data->user_data;
|
||||
struct udev_device *dev;
|
||||
const char *str;
|
||||
SpaMonitorEvent event;
|
||||
SpaMonitorItem *item;
|
||||
|
||||
dev = udev_monitor_receive_device (this->umonitor);
|
||||
if (fill_item (&this->uitem, dev) < 0)
|
||||
|
|
@ -225,16 +225,17 @@ alsa_on_fd_events (SpaPollNotifyData *data)
|
|||
if ((str = udev_device_get_action (dev)) == NULL)
|
||||
str = "change";
|
||||
|
||||
item = &this->uitem.item;
|
||||
|
||||
if (strcmp (str, "add") == 0) {
|
||||
event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
|
||||
item->event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
|
||||
} else if (strcmp (str, "change") == 0) {
|
||||
event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
|
||||
item->event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
|
||||
} else if (strcmp (str, "remove") == 0) {
|
||||
event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
|
||||
item->event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
|
||||
}
|
||||
event.data = &this->uitem.item;
|
||||
event.size = sizeof (this->uitem);
|
||||
this->event_cb (&this->monitor, &event, this->user_data);
|
||||
item->event.size = sizeof (this->uitem);
|
||||
this->event_cb (&this->monitor, &item->event, this->user_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue