Ejemplo n.º 1
0
 def retranslateUi(self):
     self.cueGroup.setTitle(translate('VolumeControl', 'Cue'))
     self.cueButton.setText(translate('VolumeControl', 'Click to select'))
     self.cueLabel.setText(translate('VolumeControl', 'Not selected'))
     self.volumeGroup.setTitle(translate('VolumeControl',
                                         'Volume to reach'))
     self.fadeGroup.setTitle(translate('VolumeControl', 'Fade'))
Ejemplo n.º 2
0
    def __init__(self, cue_class, **kwargs):
        super().__init__(cue_class, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.keyGroup = QGroupBox(self)
        self.keyGroup.setLayout(QGridLayout())
        self.layout().addWidget(self.keyGroup)

        self.keyboardModel = SimpleTableModel([
            translate('ControllerKeySettings', 'Key'),
            translate('ControllerKeySettings', 'Action')])

        self.keyboardView = KeyboardView(cue_class, parent=self.keyGroup)
        self.keyboardView.setModel(self.keyboardModel)
        self.keyGroup.layout().addWidget(self.keyboardView, 0, 0, 1, 2)

        self.addButton = QPushButton(self.keyGroup)
        self.addButton.clicked.connect(self.__new_key)
        self.keyGroup.layout().addWidget(self.addButton, 1, 0)

        self.removeButton = QPushButton(self.keyGroup)
        self.removeButton.clicked.connect(self.__remove_key)
        self.keyGroup.layout().addWidget(self.removeButton, 1, 1)

        self.retranslateUi()
Ejemplo n.º 3
0
 def retranslateUi(self):
     self.group.setTitle(
         translate('MediaCueSettings', 'Interrupt settings'))
     self.fadeDurationLabel.setText(
         translate('MediaCueSettings', 'Interrupt fade duration'))
     self.fadeTypeLabel.setText(
         translate('MediaCueSettings', 'Interrupt fade type'))
Ejemplo n.º 4
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.devices = self._discover_pcm_devices()
        self.devices['default'] = 'default'

        self.deviceGroup = QGroupBox(self)
        self.deviceGroup.setTitle(translate('AlsaSinkSettings', 'ALSA device'))
        self.deviceGroup.setGeometry(0, 0, self.width(), 100)
        self.deviceGroup.setLayout(QHBoxLayout())
        self.layout().addWidget(self.deviceGroup)

        self.device = QComboBox(self.deviceGroup)
        self.device.addItems(self.devices.keys())
        self.device.setCurrentText('default')
        self.device.setToolTip(
            translate(
                'AlsaSinkSettings', 'ALSA devices, as defined in an '
                'asound configuration file'))
        self.deviceGroup.layout().addWidget(self.device)

        self.label = QLabel(translate('AlsaSinkSettings', 'ALSA device'),
                            self.deviceGroup)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.deviceGroup.layout().addWidget(self.label)
Ejemplo n.º 5
0
 def retranslateUi(self):
     self.volumeBox.setTitle(translate('VolumeSettings', 'Volume'))
     self.volumeLabel.setText('0.0 dB')
     self.normalBox.setTitle(
         translate('VolumeSettings', 'Normalized volume'))
     self.normalLabel.setText('0.0 dB')
     self.normalReset.setText(translate('VolumeSettings', 'Reset'))
Ejemplo n.º 6
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout(self))
        self.layout().setAlignment(Qt.AlignTop)

        self.cue_select = CueSelectDialog(cues=Application().cue_model)

        self.triggersModel = TriggersModel()

        self.triggersView = TriggersView(self.cue_select, parent=self)
        self.triggersView.setModel(self.triggersModel)
        self.layout().addWidget(self.triggersView)

        self.dialogButtons = QDialogButtonBox(self)
        self.dialogButtons.setSizePolicy(QSizePolicy.Minimum,
                                         QSizePolicy.Minimum)
        self.layout().addWidget(self.dialogButtons)

        self.addButton = self.dialogButtons.addButton(
            translate('TriggersSettings', 'Add'), QDialogButtonBox.ActionRole)
        self.addButton.clicked.connect(self._add_trigger)

        self.delButton = self.dialogButtons.addButton(
            translate('TriggersSettings', 'Remove'),
            QDialogButtonBox.ActionRole)
        self.delButton.clicked.connect(self._remove_trigger)
 def retranslateUi(self):
     self.indexGroup.setTitle(translate('IndexActionCue', 'Index'))
     self.relativeCheck.setText(
         translate('IndexActionCue', 'Use a relative index'))
     self.targetIndexLabel.setText(
         translate('IndexActionCue', 'Target index'))
     self.actionGroup.setTitle(translate('IndexActionCue', 'Action'))
Ejemplo n.º 8
0
    def __init__(self):
        super().__init__()

        if not os.path.exists(PRESETS_DIR):
            os.makedirs(PRESETS_DIR, exist_ok=True)

        # Entry in mainWindow menu
        self.manageAction = QAction(MainWindow())
        self.manageAction.triggered.connect(self.__edit_presets)
        self.manageAction.setText(translate('Presets', 'Presets'))

        self.menu_action = MainWindow().menuTools.addAction(self.manageAction)

        self.loadOnCueAction = QAction(None)
        self.loadOnCueAction.triggered.connect(self.__load_on_cue)
        self.loadOnCueAction.setText(translate('Presets', 'Load preset'))

        self.createFromCueAction = QAction(None)
        self.createFromCueAction.triggered.connect(self.__create_from_cue)
        self.createFromCueAction.setText(translate('Presets',
                                                   'Save as preset'))

        CueLayout.cm_registry.add_separator()
        CueLayout.cm_registry.add_item(self.loadOnCueAction)
        CueLayout.cm_registry.add_item(self.createFromCueAction)
        CueLayout.cm_registry.add_separator()
Ejemplo n.º 9
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout(self))

        self.cue_dialog = CueSelectDialog(
            cues=Application().cue_model,
            selection_mode=QAbstractItemView.ExtendedSelection)

        self.collectionModel = CollectionModel()
        self.collectionView = CollectionView(self.cue_dialog, parent=self)
        self.collectionView.setModel(self.collectionModel)
        self.collectionView.setAlternatingRowColors(True)
        self.layout().addWidget(self.collectionView)

        # Buttons
        self.dialogButtons = QDialogButtonBox(self)
        self.dialogButtons.setSizePolicy(QSizePolicy.Minimum,
                                         QSizePolicy.Minimum)
        self.layout().addWidget(self.dialogButtons)

        self.addButton = self.dialogButtons.addButton(
            translate('CollectionCue', 'Add'), QDialogButtonBox.ActionRole)
        self.addButton.clicked.connect(self._add_dialog)

        self.delButton = self.dialogButtons.addButton(
            translate('CollectionCue', 'Remove'), QDialogButtonBox.ActionRole)
        self.delButton.clicked.connect(self._remove_selected)
Ejemplo n.º 10
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.º 11
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        # Startup layout
        self.layoutGroup = QGroupBox(self)
        self.layoutGroup.setTitle(
            translate('AppGeneralSettings', 'Startup layout'))
        self.layoutGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.layoutGroup)

        self.startupDialogCheck = QCheckBox(self.layoutGroup)
        self.startupDialogCheck.setText(
            translate('AppGeneralSettings', 'Use startup dialog'))
        self.layoutGroup.layout().addWidget(self.startupDialogCheck)

        self.layoutCombo = QComboBox(self.layoutGroup)
        self.layoutCombo.addItems([lay.NAME for lay in layouts.get_layouts()])
        self.layoutGroup.layout().addWidget(self.layoutCombo)

        self.startupDialogCheck.clicked.connect(
            lambda check: self.layoutCombo.setEnabled(not check))

        # Application style
        self.themeGroup = QGroupBox(self)
        self.themeGroup.setTitle(
            translate('AppGeneralSettings', 'Application theme'))
        self.themeGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.themeGroup)

        self.themeCombo = QComboBox(self.themeGroup)
        self.themeCombo.addItems(styles.styles())
        self.themeGroup.layout().addWidget(self.themeCombo)
Ejemplo n.º 12
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.midiGroup = QGroupBox(self)
        self.midiGroup.setTitle(
            translate('MIDISettings', 'MIDI default devices'))
        self.midiGroup.setLayout(QGridLayout())
        self.layout().addWidget(self.midiGroup)

        self.inputLabel = QLabel(translate('MIDISettings', 'Input'),
                                 self.midiGroup)
        self.midiGroup.layout().addWidget(self.inputLabel, 0, 0)
        self.inputCombo = QComboBox(self.midiGroup)
        self.midiGroup.layout().addWidget(self.inputCombo, 0, 1)

        self.outputLabel = QLabel(translate('MIDISettings', 'Output'),
                                  self.midiGroup)
        self.midiGroup.layout().addWidget(self.outputLabel, 1, 0)
        self.outputCombo = QComboBox(self.midiGroup)
        self.midiGroup.layout().addWidget(self.outputCombo, 1, 1)

        self.midiGroup.layout().setColumnStretch(0, 2)
        self.midiGroup.layout().setColumnStretch(1, 3)

        if check_module('Midi'):
            try:
                self._load_devices()
            except Exception:
                self.setEnabled(False)
        else:
            self.setEnabled(False)
Ejemplo n.º 13
0
    def __exec_command(self):
        if not self.command.strip():
            return

        # If no_output is True, discard all the outputs
        std = subprocess.DEVNULL if self.no_output else None
        # Execute the command
        self.__process = subprocess.Popen(self.command,
                                          shell=True,
                                          stdout=std,
                                          stderr=std)
        rcode = self.__process.wait()

        if rcode == 0 or rcode == -9 or self.no_error:
            # If terminate normally, killed or in no-error mode
            if not self.__stopped:
                self._ended()

            self.__process = None
            self.__stopped = False
        elif not self.no_error:
            # If an error occurs and not in no-error mode
            self._error(
                translate('CommandCue', 'Process ended with an error status.'),
                translate('CommandCue', 'Exit code: ') + str(rcode))
Ejemplo n.º 14
0
    def register_cue_menu_action(self,
                                 name,
                                 function,
                                 category='',
                                 shortcut=''):
        '''Register a new-cue choice for the edit-menu

        param name: The name for the MenuAction
        param function: The function that add the new cue(s)
        param category: The optional menu where insert the MenuAction
        param shortcut: An optional shortcut for the MenuAction
        '''
        action = QAction(self)
        action.setText(translate('MainWindow', name))
        action.triggered.connect(function)
        if shortcut != '':
            action.setShortcut(translate('MainWindow', shortcut))

        if category != '':
            if category not in self._cue_add_menu:
                menu = QMenu(category, self)
                self._cue_add_menu[category] = menu
                self.menuEdit.insertMenu(self.cueSeparator, menu)

            self._cue_add_menu[category].addAction(action)
        else:
            self.menuEdit.insertAction(self.cueSeparator, action)
Ejemplo n.º 15
0
    def __init__(self, parent, info, title):
        super().__init__(parent)

        self.setWindowTitle(
            translate('MediaInfo', 'Media Info') + ' - ' + title)
        self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.setMinimumSize(550, 300)
        self.resize(550, 500)

        self.vLayout = QVBoxLayout(self)

        self.infoTree = QTreeWidget(self)
        self.infoTree.setColumnCount(2)
        self.infoTree.setHeaderLabels(
            [translate('MediaInfo', 'Info'),
             translate('MediaInfo', 'Value')])
        self.infoTree.setAlternatingRowColors(True)
        self.infoTree.setSelectionMode(QAbstractItemView.NoSelection)
        self.infoTree.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.infoTree.header().setStretchLastSection(False)
        self.infoTree.header().setSectionResizeMode(
            QHeaderView.ResizeToContents)
        self.vLayout.addWidget(self.infoTree)

        self.__generate_items(info)
        self.infoTree.expandAll()

        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Close)
        self.vLayout.addWidget(self.buttonBox)

        self.buttonBox.rejected.connect(self.close)
Ejemplo n.º 16
0
 def retranslateUi(self):
     self.groupBox.setTitle(
         translate('AudioDynamicSettings', 'Compressor/Expander'))
     self.modeLabel.setText(translate('AudioDynamicSettings', 'Type'))
     self.chLabel.setText(translate('AudioDynamicSettings', 'Curve Shape'))
     self.ratioLabel.setText(translate('AudioDynamicSettings', 'Ratio'))
     self.thresholdLabel.setText(
         translate('AudioDynamicSettings', 'Threshold (dB)'))
Ejemplo n.º 17
0
 def retranslateUi(self):
     self.groupBox.setTitle(translate('DbMeterSettings',
                                      'DbMeter settings'))
     self.intervalLabel.setText(
         translate('DbMeterSettings', 'Time between levels (ms)'))
     self.ttlLabel.setText(translate('DbMeterSettings', 'Peak ttl (ms)'))
     self.falloffLabel.setText(
         translate('DbMeterSettings', 'Peak falloff (dB/sec)'))
Ejemplo n.º 18
0
def save_preset_dialog(base_name=''):
    name, confirm = QInputDialog.getText(MainWindow(),
                                         translate('Presets', 'Presets'),
                                         translate('Presets', 'Preset name'),
                                         text=base_name)

    if confirm:
        return name
Ejemplo n.º 19
0
    def pan_changed(self, value):
        if value < 0:
            position = translate('AudioPanSettings', 'Left')
        elif value > 0:
            position = translate('AudioPanSettings', 'Right')
        else:
            position = translate('AudioPanSettings', 'Center')

        self.panLabel.setText('{0} - {1}'.format(value, position))
Ejemplo n.º 20
0
 def retranslateUi(self):
     self.groupBox.setTitle(
         translate('TimecodeSettings', 'OLA Timecode Settings'))
     self.activateBox.setText(translate('TimecodeSettings',
                                        'Enable Plugin'))
     self.hresBox.setText(
         translate('TimecodeSettings', 'High-Resolution Timecode'))
     self.formatLabel.setText(
         translate('TimecodeSettings', 'Timecode Format:'))
Ejemplo n.º 21
0
def check_override_dialog(preset_name):
    answer = QMessageBox.question(MainWindow(),
                                  translate('Presets', 'Presets'),
                                  translate(
                                      'Presets',
                                      'Preset already exists, overwrite?'),
                                  buttons=QMessageBox.Yes | QMessageBox.Cancel)

    return answer == QMessageBox.Yes
Ejemplo n.º 22
0
    def __init__(self):
        # NOTE: The model does fixed-indices operations based on this list
        super().__init__([
            translate('TriggersSettings', 'Trigger'),
            translate('TriggersSettings', 'Cue'),
            translate('TriggersSettings', 'Action')
        ])

        self.rows_cc = []
Ejemplo n.º 23
0
 def testOla(self):
     if self.activateBox.isChecked():
         try:
             client = OlaClient()
             del client
         except OLADNotRunningException:
             QMessageBox.warning(
                 MainWindow(), translate('TimecodeSettings', 'OLA status'),
                 translate('TimecodeSettings',
                           'OLA is not running - start the OLA daemon.'))
Ejemplo n.º 24
0
 def retranslateUi(self):
     self.group.setTitle(translate('CommandCue', 'Command'))
     self.commandLineEdit.setPlaceholderText(
         translate('CommandCue', 'Command to execute, as in a shell'))
     self.noOutputCheckBox.setText(
         translate('CommandCue', 'Discard command output'))
     self.noErrorCheckBox.setText(
         translate('CommandCue', 'Ignore command errors'))
     self.killCheckBox.setText(
         translate('CommandCue', 'Kill instead of terminate'))
Ejemplo n.º 25
0
 def retranslateUi(self):
     self.setWindowTitle(
         translate('ReplayGain', 'ReplayGain / Normalization'))
     self.cpuLabel.setText(translate('ReplayGain', 'Threads number'))
     self.selectionMode.setText(
         translate('ReplayGain', 'Apply only to selected media'))
     self.gainRadio.setText(
         translate('ReplayGain', 'ReplayGain to (dB SPL)'))
     self.normalizeRadio.setText(
         translate('ReplayGain', 'Normalize to (dB)'))
Ejemplo n.º 26
0
 def retranslateUi(self):
     self.setWindowTitle(
         translate('SyncPeerDialog', 'Manage connected peers'))
     self.discoverPeersButton.setText(
         translate('SyncPeerDialog', 'Discover peers'))
     self.addPeerButton.setText(
         translate('SyncPeerDialog', 'Manually add a peer'))
     self.removePeerButton.setText(
         translate('SyncPeerDialog', 'Remove selected peer'))
     self.removeAllButton.setText(
         translate('SyncPeerDialog', 'Remove all peers'))
Ejemplo n.º 27
0
    def set_pipe(self, pipe):
        if pipe:
            if not self._app_mode:
                self.inputBox.setCurrentText(
                    translate('MediaElementName', elements.input_name(pipe[0])))

            self.outputBox.setCurrentText(
                translate('MediaElementName', elements.output_name(pipe[-1])))

        self.__init_current_plugins(pipe)
        self.__init_available_plugins(pipe)
Ejemplo n.º 28
0
    def session_init(self):
        file = self.sessionFileEdit.text()

        if os.path.exists(file):
            self.session = Session(file)
            self.session_analyze()
        elif file.strip() != '':
            QMessageBox.critical(
                self, translate('UriChanger', 'Error'),
                translate('UriChanger',
                          'Session file "{}" not found'.format(file)))
Ejemplo n.º 29
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.groupBox = QGroupBox(self)
        self.groupBox.setGeometry(0, 0, self.width(), 240)
        self.groupBox.setLayout(QGridLayout())
        self.layout().addWidget(self.groupBox)

        # AudioDynamic mode
        self.modeComboBox = QComboBox(self.groupBox)
        self.modeComboBox.addItem(
            translate('AudioDynamicSettings', 'Compressor'), 'compressor')
        self.modeComboBox.addItem(
            translate('AudioDynamicSettings', 'Expander'), 'expander')
        self.groupBox.layout().addWidget(self.modeComboBox, 0, 0, 1, 1)

        self.modeLabel = QLabel(self.groupBox)
        self.modeLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.groupBox.layout().addWidget(self.modeLabel, 0, 1, 1, 1)

        # AudioDynamic characteristic
        self.chComboBox = QComboBox(self.groupBox)
        self.chComboBox.addItem(
            translate('AudioDynamicSettings', 'Soft Knee'), 'soft-knee')
        self.chComboBox.addItem(
            translate('AudioDynamicSettings', 'Hard Knee'), 'hard-knee')
        self.groupBox.layout().addWidget(self.chComboBox, 1, 0, 1, 1)

        self.chLabel = QLabel(self.groupBox)
        self.chLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.groupBox.layout().addWidget(self.chLabel, 1, 1, 1, 1)

        # AudioDynamic ratio
        self.ratioSpin = QDoubleSpinBox(self.groupBox)
        self.groupBox.layout().addWidget(self.ratioSpin, 2, 0, 1, 1)

        self.ratioLabel = QLabel(self.groupBox)
        self.ratioLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.groupBox.layout().addWidget(self.ratioLabel, 2, 1, 1, 1)

        # AudioDynamic threshold
        self.thresholdSpin = QDoubleSpinBox(self.groupBox)
        self.thresholdSpin.setMaximum(0)
        self.thresholdSpin.setMinimum(-100)
        self.thresholdSpin.setSingleStep(1)
        self.groupBox.layout().addWidget(self.thresholdSpin, 3, 0, 1, 1)

        self.thresholdLabel = QLabel(self.groupBox)
        self.thresholdLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.groupBox.layout().addWidget(self.thresholdLabel, 3, 1, 1, 1)

        self.retranslateUi()
Ejemplo n.º 30
0
    def show_description(self, index):
        layout = self.layoutCombo.currentData()

        details = '<ul>'
        for detail in layout.DETAILS:
            details += '<li>' + translate('LayoutDetails', detail)
        details += '</ul>'

        self.description.setHtml(
            '<center><h2>' + layout.NAME + '</h2>'
            '<i><h4>' + translate('LayoutDescription', layout.DESCRIPTION) +
            '</h4></i></center>' + details)