Esempio n. 1
0
 def reload_midi_config(self):
     zynconf.load_config()
     midi_profile_fpath = os.environ.get("ZYNTHIAN_SCRIPT_MIDI_PROFILE")
     if midi_profile_fpath:
         zynconf.load_config(True, midi_profile_fpath)
         zynthian_gui_config.set_midi_config()
         self.init_midi()
Esempio n. 2
0
	def reload_midi_config(self):
		zynconf.load_config()
		midi_profile_fpath=zynconf.get_midi_config_fpath()
		if midi_profile_fpath:
			zynconf.load_config(True,midi_profile_fpath)
			zynthian_gui_config.set_midi_config()
			self.init_midi()
Esempio n. 3
0
	def reload_midi_config(self):
		zynconf.load_config()
		midi_profile_fpath=zynconf.get_midi_config_fpath()
		if midi_profile_fpath:
			zynconf.load_config(True,midi_profile_fpath)
			zynthian_gui_config.set_midi_config()
			self.init_midi()
			self.init_midi_services()
			self.zynautoconnect(True)
Esempio n. 4
0
 def prepare(self):
     zynconf.load_config()
     zynconf.load_midi_config()
     self.genjson = False
     try:
         if self.get_query_argument("json"):
             self.genjson = True
     except:
         pass
Esempio n. 5
0
sys.path.append(os.environ.get('ZYNTHIAN_UI_DIR', "/zynthian/zynthian-ui"))
import zynconf

#--------------------------------------------------------------------

input_envars_file = sys.argv[1]
envars_file = "{}/zynthian_envars.sh".format(
    os.environ.get('ZYNTHIAN_CONFIG_DIR', "/zynthian/config"))
envars_backup_file = "{}/zynthian_envars_backup.sh".format(
    os.environ.get('ZYNTHIAN_CONFIG_DIR', "/zynthian/config"))

if os.path.isfile(input_envars_file):
    try:
        print("Loading config input file '{}' ...".format(input_envars_file))
        config = zynconf.load_config(False, input_envars_file)
    except Exception as e:
        print(
            "ERROR: Config input file {} can't be parsed. Check the syntax! => \n{}"
            .format(input_envars_file, e))
    try:
        print("Saving config backup '{}' ...".format(envars_backup_file))
        shutil.copyfile(envars_file, envars_backup_file)
    except Exception as e:
        print("ERROR: Can't perform a config backup! => \n{}".format(e))
    try:
        print("Updating config on '{}' ...".format(envars_file))
        zynconf.save_config(config, True)
    except Exception as e:
        print("ERROR: Config can't be updated! => \n{}".format(e))
    try: