Collection of tools useful for audio production
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.

56 lines
2.2KB

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Helper functions for extra jacklib functionality
  4. # Copyright (C) 2012 Filipe Coelho <falktx@gmail.com>
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the COPYING file
  17. import jacklib
  18. def get_jack_status_error_string(c_status):
  19. status = c_status.value
  20. error_string = ""
  21. if (status & jacklib.JackFailure):
  22. error_string += "Overall operation failed;\n"
  23. if (status & jacklib.JackInvalidOption):
  24. error_string += "The operation contained an invalid or unsupported option;\n"
  25. if (status & jacklib.JackNameNotUnique):
  26. error_string += "The desired client name was not unique;\n"
  27. if (status & jacklib.JackServerStarted):
  28. error_string += "The JACK server was started as a result of this operation;\n"
  29. if (status & jacklib.JackServerFailed):
  30. error_string += "Unable to connect to the JACK server;\n"
  31. if (status & jacklib.JackServerError):
  32. error_string += "Communication error with the JACK server;\n"
  33. if (status & jacklib.JackNoSuchClient):
  34. error_string += "Requested client does not exist;\n"
  35. if (status & jacklib.JackLoadFailure):
  36. error_string += "Unable to load internal client;\n"
  37. if (status & jacklib.JackInitFailure):
  38. error_string += "Unable to initialize client;\n"
  39. if (status & jacklib.JackShmFailure):
  40. error_string += "Unable to access shared memory;\n"
  41. if (status & jacklib.JackVersionError):
  42. error_string += "Client's protocol version does not match;\n"
  43. if (status & jacklib.JackBackendError):
  44. error_string += "Backend Error;\n"
  45. if (status & jacklib.JackClientZombie):
  46. error_string += "Client is being shutdown against its will;\n"
  47. if (error_string):
  48. error_string = error_string.strip().rsplit(";", 1)[0]+"."
  49. return error_string