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-patchbay 2.6KB

10 years ago
10 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla plugin host
  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 GPL.txt file
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Custom Stuff)
  19. from carla_host import *
  20. # ------------------------------------------------------------------------------------------------------------
  21. # Main
  22. if __name__ == '__main__':
  23. # -------------------------------------------------------------
  24. # Read CLI args
  25. initName = os.path.basename(__file__) if ("__file__" in dir() and os.path.dirname(__file__) in PATH) else sys.argv[0]
  26. libPrefix = None
  27. for arg in sys.argv:
  28. if arg.startswith("--with-appname="):
  29. initName = os.path.basename(arg.replace("--with-initname=", ""))
  30. elif arg.startswith("--with-libprefix="):
  31. libPrefix = arg.replace("--with-libprefix=", "")
  32. # -------------------------------------------------------------
  33. # App initialization
  34. app = CarlaApplication("Carla2-Patchbay", libPrefix)
  35. # -------------------------------------------------------------
  36. # Set-up custom signal handling
  37. setUpSignals()
  38. # -------------------------------------------------------------
  39. # Init host backend
  40. host = initHost(initName, libPrefix, False, False, True)
  41. host.processMode = ENGINE_PROCESS_MODE_PATCHBAY
  42. host.processModeForced = True
  43. loadHostSettings(host)
  44. # -------------------------------------------------------------
  45. # Create GUI
  46. gui = HostWindow(host, True)
  47. # -------------------------------------------------------------
  48. # Load project file if set
  49. args = app.arguments()
  50. if len(args) > 1:
  51. arg = args[-1]
  52. if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="):
  53. pass
  54. elif os.path.exists(arg):
  55. gui.loadProjectLater(arg)
  56. # -------------------------------------------------------------
  57. # Show GUI
  58. gui.show()
  59. # -------------------------------------------------------------
  60. # App-Loop
  61. app.exit_exec()