Update CI version
[carla.git] / source / frontend / carla-control
bloba7e32ed701d2a56047e0dda1dd7dea664305b74b
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
4 # Carla plugin host
5 # Copyright (C) 2011-2021 Filipe Coelho <falktx@falktx.com>
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # For a full copy of the GNU General Public License see the doc/GPL.txt file.
19 # ----------------------------------------------------------------------------------------------------------------------
20 # Imports (Custom Stuff)
22 from carla_host_control import (
23     ENGINE_PROCESS_MODE_BRIDGE,
24     CarlaApplication,
25     CarlaHostOSC,
26     HostWindowOSC,
27     handleInitialCommandLineArguments,
28     initHost,
29     loadHostSettings,
30     setUpSignals,
33 import sys
35 # ----------------------------------------------------------------------------------------------------------------------
36 # Main
38 if __name__ == '__main__':
39     # ------------------------------------------------------------------------------------------------------------------
40     # Read CLI args
42     initName, libPrefix = handleInitialCommandLineArguments(__file__ if "__file__" in dir() else None)
44     for arg in sys.argv:
45         if arg.startswith("osc."):
46             oscAddr = arg
47             break
48     else:
49         oscAddr = None
51     # ------------------------------------------------------------------------------------------------------------------
52     # App initialization
54     app = CarlaApplication("Carla2-Control", libPrefix)
56     # ------------------------------------------------------------------------------------------------------------------
57     # Set-up custom signal handling
59     setUpSignals()
61     # ------------------------------------------------------------------------------------------------------------------
62     # Init host backend
64     host = initHost(initName, libPrefix, True, False, True, CarlaHostOSC)
65     host.processMode       = ENGINE_PROCESS_MODE_BRIDGE
66     host.processModeForced = True
67     loadHostSettings(host)
69     # ------------------------------------------------------------------------------------------------------------------
70     # Create GUI
72     gui = HostWindowOSC(host, oscAddr)
74     # ------------------------------------------------------------------------------------------------------------------
75     # Show GUI
77     gui.show()
79     # ------------------------------------------------------------------------------------------------------------------
80     # App-Loop
82     app.exit_exec()