当前位置: 首页>>代码示例>>Python>>正文


Python SESSION.tuner方法代码示例

本文整理汇总了Python中mod.session.SESSION.tuner方法的典型用法代码示例。如果您正苦于以下问题:Python SESSION.tuner方法的具体用法?Python SESSION.tuner怎么用?Python SESSION.tuner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mod.session.SESSION的用法示例。


在下文中一共展示了SESSION.tuner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _process_msg

# 需要导入模块: from mod.session import SESSION [as 别名]
# 或者: from mod.session.SESSION import tuner [as 别名]
    def _process_msg(self, msg):
        from mod.session import SESSION

        try:
            cmd, instance, port, value =  msg.replace("\x00", "").split()
            assert cmd == "monitor"
            instance = int(instance)
            value = float(value)
        except (ValueError, AssertionError) as e:
            # TODO: tratar error
            pass
        else:
            if instance == CLIPMETER_IN:
                if port == CLIPMETER_MON_L:
                    SESSION.clipmeter(0, value)
                elif port == CLIPMETER_MON_R:
                    SESSION.clipmeter(1, value)

            elif instance == CLIPMETER_OUT:
                if port == CLIPMETER_MON_L:
                    SESSION.clipmeter(2, value)
                elif port == CLIPMETER_MON_R:
                    SESSION.clipmeter(3, value)

            elif instance == PEAKMETER_IN:
                if port == PEAKMETER_MON_VALUE_L:
                    self.pkm_inl_value = value
                    SESSION.peakmeter(0, self.pkm_inl_value, self.pkm_inl_peak)
                elif port == PEAKMETER_MON_VALUE_R:
                    self.pkm_inr_value = value
                    SESSION.peakmeter(1, self.pkm_inr_value, self.pkm_inr_peak)

                if port == PEAKMETER_MON_PEAK_L:
                    self.pkm_inl_peak = value
                    SESSION.peakmeter(0, self.pkm_inl_value, self.pkm_inl_peak)
                elif port == PEAKMETER_MON_PEAK_R:
                    self.pkm_inr_peak = value
                    SESSION.peakmeter(1, self.pkm_inr_value, self.pkm_inr_peak)

            elif instance == PEAKMETER_OUT:
                if port == PEAKMETER_MON_VALUE_L:
                    self.pkm_outl_value = value
                    SESSION.peakmeter(2, self.pkm_outl_value, self.pkm_outl_peak)
                elif port == PEAKMETER_MON_VALUE_R:
                    self.pkm_outr_value = value
                    SESSION.peakmeter(3, self.pkm_outr_value, self.pkm_outr_peak)

                if port == PEAKMETER_MON_PEAK_L:
                    self.pkm_outl_peak = value
                    SESSION.peakmeter(2, self.pkm_outl_value, self.pkm_outl_peak)
                elif port == PEAKMETER_MON_PEAK_R:
                    self.pkm_outr_peak = value
                    SESSION.peakmeter(3, self.pkm_outr_value, self.pkm_outr_peak)

            elif instance == TUNER:
                SESSION.tuner(value)
        self._handle_conn()
开发者ID:ViktorNova,项目名称:mod-ui,代码行数:59,代码来源:monitor.py

示例2: handle_stream

# 需要导入模块: from mod.session import SESSION [as 别名]
# 或者: from mod.session.SESSION import tuner [as 别名]
                    SESSION.peakmeter(0, self.pkm_inl_value, self.pkm_inl_peak)
                elif port == PEAKMETER_MON_PEAK_R:
                    self.pkm_inr_peak = value
                    SESSION.peakmeter(1, self.pkm_inr_value, self.pkm_inr_peak)

            elif instance == PEAKMETER_OUT:
                if port == PEAKMETER_MON_VALUE_L:
                    self.pkm_outl_value = value
                    SESSION.peakmeter(2, self.pkm_outl_value, self.pkm_outl_peak)
                elif port == PEAKMETER_MON_VALUE_R:
                    self.pkm_outr_value = value
                    SESSION.peakmeter(3, self.pkm_outr_value, self.pkm_outr_peak)

                if port == PEAKMETER_MON_PEAK_L:
                    self.pkm_outl_peak = value
                    SESSION.peakmeter(2, self.pkm_outl_value, self.pkm_outl_peak)
                elif port == PEAKMETER_MON_PEAK_R:
                    self.pkm_outr_peak = value
                    SESSION.peakmeter(3, self.pkm_outr_value, self.pkm_outr_peak)

            elif instance == TUNER:
                SESSION.tuner(value)
        self._handle_conn()

    def handle_stream(self, s, addr):
        self._stream = s
        self._handle_conn()

    def _handle_conn(self):
        self._stream.read_until("\x00", self._process_msg)
开发者ID:alercunha,项目名称:mod-ui,代码行数:32,代码来源:monitor.py


注:本文中的mod.session.SESSION.tuner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。