30-alsa-monitor.lua 762 B

123456789101112131415161718192021222324252627282930
  1. alsa_monitor = {}
  2. alsa_monitor.properties = {}
  3. alsa_monitor.rules = {}
  4. function alsa_monitor.enable()
  5. if alsa_monitor.enabled == false then
  6. return
  7. end
  8. -- The "reserve-device" module needs to be loaded for reservation to work
  9. if alsa_monitor.properties["alsa.reserve"] then
  10. load_module("reserve-device")
  11. end
  12. load_monitor("alsa", {
  13. properties = alsa_monitor.properties,
  14. rules = alsa_monitor.rules,
  15. })
  16. if alsa_monitor.properties["alsa.midi"] then
  17. load_monitor("alsa-midi", {
  18. properties = alsa_monitor.properties,
  19. })
  20. -- The "file-monitor-api" module needs to be loaded for MIDI device monitoring
  21. if alsa_monitor.properties["alsa.midi.monitoring"] then
  22. load_module("file-monitor-api")
  23. end
  24. end
  25. end