def cmd_mpc(ensoapi, action): """Control Media Player Classic using Enso IMPORTANT: Web Interface should be enabled in MPC settings. <br>NOTE: the command is based on <a href="https://github.com/Grokzen/mpcapi">mpcapi</a>. <br>Due to the vast number of arguments the command is disabled by default. <br>Issue 'mpc enable' to make it available.""" if action == "enable": config.MPC_ENABLED = True config.store_value("MPC_ENABLED", True) cmd_mpc.valid_args = ["disable", "randomize"] + get_mpc_commands() elif action == "disable": config.MPC_ENABLED = False config.store_value("MPC_ENABLED", False) cmd_mpc.valid_args = ["enable"] elif action == "randomize": mpc_randomize() else: getattr(mpcapi.MpcAPI(host=MPC_HOST, port=MPC_PORT), action.replace(" ", "_"))()
def get_enso_set_config(key, value): config.store_value(key.upper(), value) return ""
def get_enso_commands_enable(command): if command in config.DISABLED_COMMANDS: config.DISABLED_COMMANDS.remove(command) config.COMMAND_STATE_CHANGED = True config.store_value("DISABLED_COMMANDS", config.DISABLED_COMMANDS) return ""
def get_enso_commands_disable(command): if command not in config.DISABLED_COMMANDS: config.DISABLED_COMMANDS += [command] config.COMMAND_STATE_CHANGED = True config.store_value("DISABLED_COMMANDS", config.DISABLED_COMMANDS) return ""