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
3.0KB

  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. from carla_rack import CarlaRackW
  21. # ------------------------------------------------------------------------------------------------------------
  22. # Main Window
  23. class CarlaHostW(HostWindow):
  24. def __init__(self, host):
  25. HostWindow.__init__(self, host)
  26. self.fContainer = CarlaRackW(self, host)
  27. self.setupContainer(False)
  28. # ------------------------------------------------------------------------------------------------------------
  29. # Main
  30. if __name__ == '__main__':
  31. # -------------------------------------------------------------
  32. # Read CLI args
  33. initName = os.path.basename(__file__) if ("__file__" in dir() and os.path.dirname(__file__) in PATH) else sys.argv[0]
  34. libPrefix = None
  35. for arg in sys.argv:
  36. if arg.startswith("--with-appname="):
  37. initName = os.path.basename(arg.replace("--with-initname=", ""))
  38. elif arg.startswith("--with-libprefix="):
  39. libPrefix = arg.replace("--with-libprefix=", "")
  40. # -------------------------------------------------------------
  41. # App initialization
  42. app = CarlaApplication("Carla2-Rack", libPrefix)
  43. # -------------------------------------------------------------
  44. # Set-up custom signal handling
  45. setUpSignals()
  46. # -------------------------------------------------------------
  47. # Init host backend
  48. host = initHost(initName, libPrefix, False, False, True)
  49. host.processMode = ENGINE_PROCESS_MODE_CONTINUOUS_RACK
  50. host.processModeForced = True
  51. loadHostSettings(host)
  52. # -------------------------------------------------------------
  53. # Create GUI
  54. gui = CarlaHostW(host)
  55. # -------------------------------------------------------------
  56. # Load project file if set
  57. args = app.arguments()
  58. if len(args) > 1:
  59. arg = args[-1]
  60. if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="):
  61. pass
  62. elif os.path.exists(arg):
  63. gui.loadProjectLater(arg)
  64. # -------------------------------------------------------------
  65. # Show GUI
  66. gui.show()
  67. # -------------------------------------------------------------
  68. # App-Loop
  69. app.exit_exec()