Ejemplo n.º 1
0
    return os.environ.get("XPRA_SOUND_CODEC_ENABLE_%s" % codec_name.upper().replace("+", "_"), "0")=="1"


NAME_TO_SRC_PLUGIN = {
    "auto"          : "autoaudiosrc",
    "alsa"          : "alsasrc",
    "oss"           : "osssrc",
    "oss4"          : "oss4src",
    "jack"          : "jackaudiosrc",
    "osx"           : "osxaudiosrc",
    "test"          : "audiotestsrc",
    "pulse"         : "pulsesrc",
    "direct"        : "directsoundsrc",
    "wasapi"        : "wasapisrc",
    }
SRC_TO_NAME_PLUGIN = reverse_dict(NAME_TO_SRC_PLUGIN)
SRC_HAS_DEVICE_NAME = ["alsasrc", "osssrc", "oss4src", "jackaudiosrc", "pulsesrc", "directsoundsrc", "osxaudiosrc"]
PLUGIN_TO_DESCRIPTION = {
    "pulsesrc"      : "Pulseaudio",
    "jacksrc"       : "JACK Audio Connection Kit",
    }

NAME_TO_INFO_PLUGIN = {
    "auto"          : "Automatic audio source selection",
    "alsa"          : "ALSA Linux Sound",
    "oss"           : "OSS sound cards",
    "oss4"          : "OSS version 4 sound cards",
    "jack"          : "JACK audio sound server",
    "osx"           : "Mac OS X sound cards",
    "test"          : "Test signal",
    "pulse"         : "PulseAudio",
Ejemplo n.º 2
0
    "NAME": 8,
    "REMOTE": 16,
    "SHARED": 32,
    "NETWORK": 64,
    "EXPAND": 16384,
    "CONTAINER": 32768,
    "ICON1": 65536 * 1,
    "ICON2": 65536 * 2,
    "ICON3": 65536 * 3,
    "ICON4": 65536 * 4,
    "ICON5": 65536 * 5,
    "ICON6": 65536 * 6,
    "ICON7": 65536 * 7,
    "ICON8": 65536 * 8,
}
PRINTER_ENUM_NAMES = reverse_dict(PRINTER_ENUM_VALUES)
log("PRINTER_ENUM_VALUES: %s", PRINTER_ENUM_VALUES)

log("PRINTER_FLAGS=%s", csv(PRINTER_FLAGS))
VALID_PRINTER_FLAGS = ("LOCAL", "SHARED", "CONNECTIONS", "NETWORK", "REMOTE")


def get_printer_enums():
    printer_enums = []
    for v in PRINTER_FLAGS:  #ie: "SHARED+NETWORK+CONNECTIONS"
        flags = v.replace('|', '+').split(
            "+")  #ie: ["SHARED", "NETWORK", "CONNECTIONS"]
        values = []
        for flag in flags:  #ie: "SHARED"
            if flag not in VALID_PRINTER_FLAGS:
                log.warn(