seq_system.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * ALSA sequencer System Client
  4. * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
  5. */
  6. #ifndef __SND_SEQ_SYSTEM_H
  7. #define __SND_SEQ_SYSTEM_H
  8. #include <sound/seq_kernel.h>
  9. /* entry points for broadcasting system events */
  10. void snd_seq_system_broadcast(int client, int port, int type, bool atomic);
  11. /* normal system notification event broadcast */
  12. #define notify_event(client, port, type) \
  13. snd_seq_system_broadcast(client, port, type, false)
  14. /* notify UMP EP/FB change event */
  15. static inline void snd_seq_system_ump_notify(int client, int block, int type,
  16. bool atomic)
  17. {
  18. /* reuse the existing snd_seq_system_broadcast():
  19. * struct snd_seq_ev_ump_notify is compatible with struct snd_seq_addr
  20. */
  21. snd_seq_system_broadcast(client, block, type, atomic);
  22. }
  23. #define snd_seq_system_client_ev_client_start(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_START)
  24. #define snd_seq_system_client_ev_client_exit(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_EXIT)
  25. #define snd_seq_system_client_ev_client_change(client) notify_event(client, 0, SNDRV_SEQ_EVENT_CLIENT_CHANGE)
  26. #define snd_seq_system_client_ev_port_start(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_START)
  27. #define snd_seq_system_client_ev_port_exit(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_EXIT)
  28. #define snd_seq_system_client_ev_port_change(client, port) notify_event(client, port, SNDRV_SEQ_EVENT_PORT_CHANGE)
  29. int snd_seq_system_notify(int client, int port, struct snd_seq_event *ev,
  30. bool atomic);
  31. /* register our internal client */
  32. int snd_seq_system_client_init(void);
  33. /* unregister our internal client */
  34. void snd_seq_system_client_done(void);
  35. #endif