Beispiel #1
0
    def __init__(self, alsa_mixer_name="DSPVolume"):
        self.restore = False

        self.server = SigmaTCPServer()
        if "--alsa" in sys.argv:
            logging.info("initializiong ALSA mixer control")
            alsasync = AlsaSync()
            alsasync.set_alsa_control(alsa_mixer_name)
            SigmaTCPHandler.alsasync = alsasync
            volreg = SigmaTCPHandler.get_meta(ATTRIBUTE_VOL_CTL)
            if volreg is not None and len(volreg) > 0:
                reg = datatools.parse_int(volreg)
                alsasync.set_volume_register(reg)
            alsasync.start()
        else:
            logging.info("not using ALSA volume control")
            self.alsa_mixer_name = None

        if "--lgsoundsync" in sys.argv:
            try:
                logging.info("initializing LG SoundSync")
                SigmaTCPHandler.lgsoundsync = SoundSync()
                SigmaTCPHandler.lgsoundsync.start()
                SigmaTCPHandler.update_lgsoundsync()
            except Exception as e:
                logging.exception(e)
        else:
            logging.info("not enabling LG SoundSync")

        if "--restore" in sys.argv:
            self.restore = True

        logging.info("server initialization finished")
Beispiel #2
0
    def __init__(self, alsa_mixer_name="DSPVolume"):
        self.restore = False

        self.server = SigmaTCPServer()
        if "--alsa" in sys.argv:
            logging.info("initializiong ALSA mixer control")
            alsasync = AlsaSync()
            alsasync.set_alsa_control(alsa_mixer_name)
            SigmaTCPHandler.alsasync = alsasync
            volreg = SigmaTCPHandler.get_meta(ATTRIBUTE_VOL_CTL)
            if volreg is not None and len(volreg) > 0:
                reg = datatools.parse_int(volreg)
                alsasync.set_volume_register(reg)
            alsasync.start()
        else:
            logging.info("not using ALSA volume control")
            self.alsa_mixer_name = None

        if "--restore" in sys.argv:
            self.restore = False
Beispiel #3
0
    def __init__(self, alsa_mixer_name="DSPVolume"):
        self.restore = False
        self.abort = False
        self.zeroconf = None

        self.server = SigmaTCPServer()

        params = self.parse_config()
        if params["alsa"]:
            logging.info("initializing ALSA mixer control %s", alsa_mixer_name)
            alsasync = AlsaSync()
            if alsasync.set_alsa_control(alsa_mixer_name):
                SigmaTCPHandler.alsasync = alsasync
                volreg = SigmaTCPHandler.get_meta(ATTRIBUTE_VOL_CTL)
                if volreg is not None and len(volreg) > 0:
                    reg = datatools.parse_int(volreg)
                    alsasync.set_volume_register(reg)
                alsasync.start()
            else:
                logging.error("can't create mixer control - aborting")
                self.abort = True
        else:
            logging.info("not using ALSA volume control")
            self.alsa_mixer_name = None

        if params["lgsoundsync"]:
            try:
                logging.info("initializing LG Sound Sync")
                SigmaTCPHandler.lgsoundsync = SoundSync()
                SigmaTCPHandler.lgsoundsync.start()
                SigmaTCPHandler.update_lgsoundsync()
            except Exception as e:
                logging.exception(e)
        else:
            logging.info("not enabling LG Sound Sync")

        if this.notify_on_updates is not None:
            logging.info("Sending notifies on program updates to %s",
                         this.notify_on_updates)

        if params["restore"]:
            self.restore = True