Ejemplo n.º 1
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        try:
            osc_plugin = get_plugin('Osc')
        except PluginNotLoadedError:
            self._caption.setText('OSC Plugin either not Installed or Enabled')
            return

        if not osc_plugin.is_loaded():
            self._caption.setText('OSC Plugin is not Enabled')
            return

        osc_plugin.server.new_message.connect(self.on_new_osc_message,
                                              Connection.QtQueued)
        osc_plugin.Config.changed.connect(self._update_caption)
        osc_plugin.Config.updated.connect(self._update_caption)
        self._update_caption()

        try:
            qlab_mimic = get_plugin('QlabMimic')
            if qlab_mimic.is_loaded():
                qlab_mimic.server.new_message.connect(self.on_new_osc_message,
                                                      Connection.QtQueued)
        except PluginNotLoadedError:
            pass
Ejemplo n.º 2
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        self.setLayout(QVBoxLayout())

        self._caption = QLabel(parent=self)
        self._caption.setAlignment(Qt.AlignHCenter)
        self.layout().addWidget(self._caption)

        self._textfield = QTextEdit(parent=self)
        self._textfield.setReadOnly(True)
        self.layout().addWidget(self._textfield)

        self._button_clear = QPushButton(parent=self)
        self._button_clear.setText(translate('protocol_monitor', 'Clear'))
        self._button_clear.setFocusPolicy(Qt.NoFocus)
        self._button_clear.pressed.connect(self.clear_textfield)
        self.layout().addWidget(self._button_clear)

        self._groupbox = QGroupBox(parent=self)
        self._groupbox.setTitle(translate('protocol_monitor', 'Options'))
        self._groupbox.setFocusPolicy(Qt.NoFocus)
        self._groupbox.setLayout(QFormLayout())

        protocol = self.__module__.split('.')[-1]
        for key, option in self.options.items():
            option['widget'] = QCheckBox(parent=self._groupbox)
            option['widget'].setFocusPolicy(Qt.NoFocus)
            option['widget'].setText(option['caption'])
            option['widget'].setChecked(
                get_plugin('ProtocolMonitor').Config.get('.'.join(
                    [protocol, key])))
            option['widget'].toggled.connect(self._update_option)
            self._groupbox.layout().addWidget(option['widget'])
        self.layout().addWidget(self._groupbox)
Ejemplo n.º 3
0
 def _update_option(self, isChecked):
     protocol = self.__module__.split('.')[-1]
     config = get_plugin('ProtocolMonitor').Config
     for key, option in self.options.items():
         if option['widget'] is not self.sender():
             continue
         config.set('.'.join([protocol, key]), isChecked)
         config.write()
         return
Ejemplo n.º 4
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        try:
            midi_plugin = get_plugin('Midi')
        except PluginNotLoadedError:
            self._caption.setText(
                'MIDI Plugin either not Installed or Enabled')
            return

        if not midi_plugin.is_loaded():
            self._caption.setText('MIDI Plugin is not Enabled')
            return

        self._caption.hide()

        midi_plugin.input.new_message.connect(self.on_new_midi_message,
                                              Connection.QtQueued)
Ejemplo n.º 5
0
 def _update_caption(self):
     self._caption.setText(
         translate('osc_viewer',
                   'Listening on <b>{}</b>, port <b>{}</b>').format(
                       get_lan_ip(),
                       get_plugin('Osc').server.in_port))