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.

97 lines
2.9KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla plugin host
  4. # Copyright (C) 2011-2013 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. from carla_patchbay import CarlaPatchbayW
  21. # ------------------------------------------------------------------------------------------------------------
  22. # Main Window
  23. class CarlaHostW(HostWindow):
  24. def __init__(self, parent=None):
  25. HostWindow.__init__(self, parent)
  26. self.fContainer = CarlaPatchbayW(self)
  27. self.setCentralWidget(self.fContainer)
  28. # ------------------------------------------------------------------------------------------------------------
  29. # Main
  30. if __name__ == '__main__':
  31. # -------------------------------------------------------------
  32. # App initialization
  33. app = CarlaApplication()
  34. # -------------------------------------------------------------
  35. # Set-up custom signal handling
  36. setUpSignals()
  37. # -------------------------------------------------------------
  38. # Read CLI args
  39. appName = os.path.basename(__file__) if ("__file__" in dir() and os.path.dirname(__file__) in PATH) else sys.argv[0]
  40. libPrefix = None
  41. projectFilename = None
  42. argv = app.arguments()
  43. argc = len(argv)
  44. for i in range(argc):
  45. if i == 0: continue
  46. argument = argv[i]
  47. if argument.startswith("--with-appname="):
  48. appName = os.path.basename(argument.replace("--with-appname=", ""))
  49. elif argument.startswith("--with-libprefix="):
  50. libPrefix = argument.replace("--with-libprefix=", "")
  51. elif os.path.exists(argument):
  52. projectFilename = argument
  53. # -------------------------------------------------------------
  54. # Init host backend
  55. initHost(appName, libPrefix)
  56. # -------------------------------------------------------------
  57. # Create GUI
  58. Carla.gui = CarlaHostW()
  59. # -------------------------------------------------------------
  60. # Load project file if set
  61. if projectFilename is not None:
  62. Carla.gui.loadProjectLater(projectFilename)
  63. # -------------------------------------------------------------
  64. # Show GUI
  65. Carla.gui.show()
  66. # -------------------------------------------------------------
  67. # App-Loop
  68. sys.exit(app.exec_())