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

10 years ago
10 years ago
10 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 doc/GPL.txt file.
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Config)
  19. from carla_config import *
  20. # ------------------------------------------------------------------------------------------------------------
  21. # Imports (Global)
  22. if config_UseQt5:
  23. from PyQt5.QtCore import QEvent
  24. from PyQt5.QtWidgets import QLabel, QTabWidget
  25. else:
  26. from PyQt4.QtCore import QEvent
  27. from PyQt4.QtGui import QLabel, QTabWidget
  28. # ------------------------------------------------------------------------------------------------------------
  29. # Imports (Custom Stuff)
  30. from carla_host import *
  31. # ------------------------------------------------------------------------------------------------------------
  32. # Main
  33. if __name__ == '__main__':
  34. # -------------------------------------------------------------
  35. # Read CLI args
  36. initName = os.path.basename(__file__) if ("__file__" in dir() and os.path.dirname(__file__) in PATH) else sys.argv[0]
  37. libPrefix = None
  38. for arg in sys.argv:
  39. if arg.startswith("--with-appname="):
  40. initName = os.path.basename(arg.replace("--with-initname=", ""))
  41. elif arg.startswith("--with-libprefix="):
  42. libPrefix = arg.replace("--with-libprefix=", "")
  43. # -------------------------------------------------------------
  44. # App initialization
  45. app = CarlaApplication("Carla2", libPrefix)
  46. # -------------------------------------------------------------
  47. # Set-up custom signal handling
  48. setUpSignals()
  49. # -------------------------------------------------------------
  50. # Init host backend
  51. host = initHost(initName, libPrefix, False, False, True)
  52. loadHostSettings(host)
  53. # -------------------------------------------------------------
  54. # Create GUI
  55. gui = HostWindow(host, True)
  56. # -------------------------------------------------------------
  57. # Load project file if set
  58. args = app.arguments()
  59. if len(args) > 1:
  60. arg = args[-1]
  61. if arg.startswith("--with-appname=") or arg.startswith("--with-libprefix="):
  62. pass
  63. elif os.path.exists(arg):
  64. gui.loadProjectLater(arg)
  65. # -------------------------------------------------------------
  66. # Show GUI
  67. gui.show()
  68. # -------------------------------------------------------------
  69. # App-Loop
  70. app.exit_exec()