Audio plugin host https://kx.studio/carla
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.

carla_utils.py 2.5KB

10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend utils
  4. # Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or 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 doc/GPL.txt file.
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Custom)
  19. from carla_backend import *
  20. # ------------------------------------------------------------------------------------------------------------
  21. def getPluginTypeAsString(ptype):
  22. if ptype == PLUGIN_NONE:
  23. return "NONE"
  24. if ptype == PLUGIN_INTERNAL:
  25. return "Internal"
  26. if ptype == PLUGIN_LADSPA:
  27. return "LADSPA"
  28. if ptype == PLUGIN_DSSI:
  29. return "DSSI"
  30. if ptype == PLUGIN_LV2:
  31. return "LV2"
  32. if ptype == PLUGIN_VST:
  33. return "VST"
  34. if ptype == PLUGIN_VST3:
  35. return "VST3"
  36. if ptype == PLUGIN_AU:
  37. return "AU"
  38. if ptype == PLUGIN_GIG:
  39. return "GIG"
  40. if ptype == PLUGIN_SF2:
  41. return "SF2"
  42. if ptype == PLUGIN_SFZ:
  43. return "SFZ"
  44. print("getPluginTypeAsString(%i) - invalid type" % ptype);
  45. return "Unknown"
  46. def getPluginTypeFromString(stype):
  47. if not stype:
  48. return PLUGIN_NONE
  49. stype = stype.lower()
  50. if stype == "none":
  51. return PLUGIN_NONE
  52. if stype == "internal":
  53. return PLUGIN_INTERNAL
  54. if stype == "ladspa":
  55. return PLUGIN_LADSPA
  56. if stype == "dssi":
  57. return PLUGIN_DSSI
  58. if stype == "lv2":
  59. return PLUGIN_LV2
  60. if stype == "vst":
  61. return PLUGIN_VST
  62. if stype == "vst3":
  63. return PLUGIN_VST3
  64. if stype == "au":
  65. return PLUGIN_AU
  66. if stype == "gig":
  67. return PLUGIN_GIG
  68. if stype == "sf2":
  69. return PLUGIN_SF2
  70. if stype == "sfz":
  71. return PLUGIN_SFZ
  72. print("getPluginTypeFromString(\"%s\") - invalid string type" % stype)
  73. return PLUGIN_NONE
  74. # ------------------------------------------------------------------------------------------------------------