You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
714 B

  1. from calculate.utils.package import PackageAtomParser
  2. def get_available_audio_system():
  3. audio_systems = (
  4. ('alsa', None),
  5. ('pulseaudio', 'media-sound/pulseaudio')
  6. )
  7. package_db = PackageAtomParser()
  8. return [
  9. audio_system
  10. for audio_system, pkg in audio_systems
  11. if pkg is None or package_db.is_package_exists(pkg)
  12. ]
  13. def get_audio_selected(available_systems, cmdline_audio):
  14. available_systems = available_systems.value
  15. if 'pulseaudio' in available_systems:
  16. cmdline_audio = cmdline_audio.value
  17. if cmdline_audio and cmdline_audio == 'alsa':
  18. return 'alsa'
  19. else:
  20. return 'pulseaudio'
  21. return 'alsa'