Esempio n. 1
0
    def __init__(self, main):
        QtGui.QDialog.__init__(self)
        load_ui(self, 'dialogs/wavetable_list.ui')
        self.main = main
        self.wavetable_library = self.main.wavetable_library
        self.wavetable_model = self.wavetable_library.model
        self.wavetable_view.setModel(self.wavetable_model)
        self.wavetable_view.verticalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        self.wavetable_view.horizontalHeader().setResizeMode(
            1, QtGui.QHeaderView.ResizeToContents)
        self.wavetable_view.horizontalHeader().setResizeMode(
            2, QtGui.QHeaderView.ResizeToContents)

        self.new_btn.setIcon(QtGui.QIcon.fromTheme('document-new'))
        self.import_btn.setIcon(QtGui.QIcon.fromTheme('document-open'))
        self.duplicate_btn.setIcon(QtGui.QIcon.fromTheme('edit-copy'))
        self.delete_btn.setIcon(QtGui.QIcon.fromTheme('edit-delete'))

        self.new_btn.clicked.connect(self.new_wavetable)
        self.import_btn.clicked.connect(self.import_wavetable)
        self.duplicate_btn.clicked.connect(self.duplicate)
        self.delete_btn.clicked.connect(self.delete)

        self.wavetable_view.doubleClicked.connect(self.wavetable_show)
        self.wavetable_view.doubleClicked.connect(self.enable_buttons)
        self.wavetable_view.activated.connect(self.enable_buttons)
        self.wavetable_view.clicked.connect(self.enable_buttons)
        self.wavetable_model.columnsInserted.connect(self.update_columns)
        self.wavetable_model.rowsInserted.connect(self.resort)
        self.wavetable_model.rowsRemoved.connect(self.resort)
        self.wavetable_model.rowsRemoved.connect(
            lambda *_: self.duplicate_btn.setEnabled(False)
            if not self.wavetable_model.rowCount() else None)
Esempio n. 2
0
 def __init__(self, parent):
     QtGui.QDialog.__init__(self, parent)
     load_ui(self, 'dialogs/about.ui')
     self.version_lbl.setText('Version: {}'.format(VERSION))
     logo = QtGui.QIcon(local_path('bigglesworth_logo.png')).pixmap(QtCore.QSize(280, 32)).toImage()
     logo_widget = QtGui.QLabel()
     logo_widget.setPixmap(QtGui.QPixmap().fromImage(logo))
     logo_widget.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.MinimumExpanding)
     self.layout().addWidget(logo_widget, 0, 0, 1, 1, QtCore.Qt.AlignCenter)
     self.setFixedSize(400, 300)
Esempio n. 3
0
 def __init__(self, main, parent):
     QtGui.QDialog.__init__(self, parent)
     self.main = main
     load_ui(self, 'dialogs/dumpdialog.ui')
     self.bank_combo.currentIndexChanged.connect(self.update_label)
     self.prog_spin.valueChanged.connect(self.update_label)
     self.store_chk.toggled.connect(self.check)
     self.editor_chk.toggled.connect(self.check)
     self.buttonBox.button(
         QtGui.QDialogButtonBox.Ignore).clicked.disconnect()
     self.buttonBox.button(QtGui.QDialogButtonBox.Ignore).clicked.connect(
         self.reject)
Esempio n. 4
0
    def __init__(self, main, parent):
        QtGui.QDialog.__init__(self, parent)
        load_ui(self, 'dialogs/settings.ui')
        self.main = main
        self.settings = main.settings
        self.setModal(True)

        self.preset_group.buttonClicked.connect(self.set_preset_labels)

        self.editor_appearance_filter_matrix_group.setId(
            self.adv_filter_radio, 0)
        self.editor_appearance_filter_matrix_group.setId(
            self.adv_matrix_radio, 1)
        self.editor_appearance_filter_matrix_group.setId(
            self.adv_last_radio, 2)
        self.editor_appearance_efx_arp_group.setId(self.arp_efx_radio, 0)
        self.editor_appearance_efx_arp_group.setId(self.arp_arp_radio, 1)
        self.editor_appearance_efx_arp_group.setId(self.arp_last_radio, 2)
        self.editor_appearance_efx_arp_group.buttonClicked.connect(
            self.editor_appearance_groups_check)
        self.editor_appearance_filter_matrix_group.buttonClicked.connect(
            self.editor_appearance_groups_check)
        self.editor_appearance_remember_last_chk.toggled.connect(
            self.editor_appearance_groups_check)
        self.editor_appearance_efx_arp_latest = self.editor_appearance_filter_matrix_latest = 0

        self.previous_id = 0
        self.deviceID_spin.valueChanged.connect(
            lambda value: self.deviceID_hex_lbl.setText('({:02X}h)'.format(
                value)))
        self.deviceID_spin.valueChanged.connect(self.check_broadcast)
        self.broadcast_chk.toggled.connect(self.set_broadcast)
        self.deviceID_detect_btn.clicked.connect(self.detect)
        self.main.midi_duplex_state_change.connect(
            self.deviceID_detect_btn.setEnabled)
        self.detect_msgbox = QtGui.QMessageBox(
            QtGui.QMessageBox.Information, 'Detecting Device ID',
            'Waiting for the Blofeld to reply, please wait...',
            QtGui.QMessageBox.Abort, self)

        self.detect_timer = QtCore.QTimer()
        self.detect_timer.setInterval(5000)
        self.detect_timer.setSingleShot(True)
        self.detect_timer.timeout.connect(self.no_response)

        self.no_response_msgbox = QtGui.QMessageBox(
            QtGui.QMessageBox.Warning, 'No response',
            'We got no response from the Blofeld.\nPlease check MIDI connections or try to switch it off and on again.',
            QtGui.QMessageBox.Ok, self)
Esempio n. 5
0
    def __init__(self, main, parent):
        QtGui.QDialog.__init__(self, parent)
        load_ui(self, 'dialogs/summary.ui')
        self.main = main

        dump_btn = QtGui.QPushButton('Dump')
        dump_btn.clicked.connect(self.sound_dump)
        dump_btn.setIcon(self.style().standardIcon(QtGui.QStyle.SP_ArrowRight))
        self.buttonBox.addButton(dump_btn, QtGui.QDialogButtonBox.ActionRole)

        dial_icon = QtGui.QIcon()
        dial_icon.addFile(local_path('dial_icon.png'))
        edit_btn = QtGui.QPushButton('Edit')
        edit_btn.clicked.connect(self.sound_edit)
        edit_btn.setIcon(dial_icon)
        self.buttonBox.addButton(edit_btn, QtGui.QDialogButtonBox.AcceptRole)

        self.bank_combo.addItems([uppercase[l] for l in range(8)])
        self.import_btn.clicked.connect(self.open)
        self.buttonBox.button(QtGui.QDialogButtonBox.Discard).clicked.connect(self.reject)
        self.summary_widget.setFocus()
Esempio n. 6
0
    def __init__(self, main, parent):
        QtGui.QDialog.__init__(self, parent)
        load_ui(self, 'dialogs/midi_import.ui')
        self.main = main

        self.import_btn = QtGui.QPushButton('Import to library')
        self.import_btn.setIcon(self.style().standardIcon(
            QtGui.QStyle.SP_DialogSaveButton))
        self.buttonBox.addButton(self.import_btn,
                                 QtGui.QDialogButtonBox.ActionRole)
        self.import_btn.clicked.connect(self.import_sounds)

        self.export_state = False
        self.midi_state = False

        self.dump_btn = QtGui.QPushButton('Dump all')
        self.dump_btn.setEnabled(False)
        self.dump_btn.setIcon(self.style().standardIcon(
            QtGui.QStyle.SP_ArrowRight))
        self.buttonBox.addButton(self.dump_btn,
                                 QtGui.QDialogButtonBox.ActionRole)
        self.dump_btn.clicked.connect(self.dump_sounds)

        self.splitter.setCollapsible(1, True)

        self.sound_list = []
        self.export_list = []

        self.model = self.sounds_table.model()
        self.sounds_table.setColumnCount(len(self.sound_headers))
        self.sounds_table.setHorizontalHeaderLabels(self.sound_headers)
        self.sounds_table.horizontalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        self.sounds_table.horizontalHeader().setResizeMode(
            3, QtGui.QHeaderView.Stretch)
        self.sounds_table.verticalHeader().setVisible(False)
        self.sounds_table.horizontalHeader().setVisible(True)
        self.sounds_table.verticalHeader().setResizeMode(
            QtGui.QHeaderView.ResizeToContents)
        self.bankmap_combo.addItems([uppercase[b] for b in range(8)])
        self.bankmap_btn.setIcon(self.style().standardIcon(
            QtGui.QStyle.SP_DialogApplyButton))

        self.destination_group.setId(self.sound_buffer_radio, 0)
        self.destination_group.setId(self.multi_buffer_radio, 1)
        self.destination_group.setId(self.library_radio, 2)

        self.name_edit.setValidator(
            QtGui.QRegExpValidator(QtCore.QRegExp('[\x20-\x7f°]*')))
        self.cat_combo.addItems(categories)
        self.bank_combo.addItems([uppercase[b] for b in range(8)])
        self.single_dump_btn.setIcon(self.style().standardIcon(
            QtGui.QStyle.SP_ArrowRight))
        self.apply_btn.setIcon(self.style().standardIcon(
            QtGui.QStyle.SP_DialogApplyButton))

        self.file_open_btn.clicked.connect(self.file_open)
        self.sounds_table.currentChanged = self.currentChanged
        self.sounds_table.selectionChanged = self.selectionChanged
        self.sounds_table.customContextMenuRequested.connect(self.sound_menu)
        self.sounds_table.cellDoubleClicked.connect(self.dump_temp)
        self.check_btn.clicked.connect(lambda: self.check_selection(True))
        self.uncheck_btn.clicked.connect(lambda: self.check_selection(False))
        self.single_dump_btn.clicked.connect(self.dump_single)
        self.bankmap_btn.clicked.connect(self.bankmap_update)

        self.name_edit.textChanged.connect(
            lambda t: self.apply_btn.setEnabled(True))
        self.cat_combo.currentIndexChanged.connect(
            lambda i: self.apply_btn.setEnabled(True))
        self.apply_btn.clicked.connect(self.sound_update)
Esempio n. 7
0
 def __init__(self, main, parent):
     QtGui.QDialog.__init__(self, parent)
     load_ui(self, 'dialogs/update_info.ui')
     self.main = main
     self.info_text.document().setIndentWidth(20)
     self.css_base = '''
Esempio n. 8
0
    def __init__(self, main, parent):
        QtGui.QDialog.__init__(self, parent)
        load_ui(self, 'dialogs/print_library.ui')
        self.setModal(True)
        self.main = main
        self.format_group.setId(self.text_radio, TEXT)
        self.format_group.setId(self.pdf_radio, 1)
        self.mode = TEXT
        self.monofont = QtGui.QFont('Monospace')
        self.monofont.setPixelSize(10)
        self.font_size_spin.setValue(9)
        self.font_combo.setCurrentFont(self.monofont)
        self.format_group.buttonClicked[int].connect(self.mode_set)

        self.text = ''
        self.monotext = QtGui.QGraphicsTextItem(self.text)
        self.output = QtGui.QPrinter()
        self.output.setOutputFormat(QtGui.QPrinter.PdfFormat)
        self.output.setFontEmbeddingEnabled(True)
        self.output.setPaperSize(QtGui.QPrinter.A4)
        pagefont = QtGui.QFont('Monospace')
        pagefont.setPixelSize(9)
        self.page = PrinterPageRect(self, self.output, pagefont)
        self.outside.connect(lambda state: self.outside_widget.setVisible(True if state else False))
        self.outside_widget.hide()


        page_sizes = []
        self.ps_ids = {}
        ps_id = 0
        a4_id = None
        for attr in dir(QtGui.QPrinter):
            ps = getattr(QtGui.QPrinter, attr)
            if attr == 'Custom': continue
            if isinstance(ps, QtGui.QPrinter.PageSize):
                page_sizes.append(attr)
                self.ps_ids[ps_id] = ps
                if attr == 'A4': a4_id = ps_id
                ps_id += 1
        self.ps_ids[len(page_sizes)] = QtGui.QPrinter.Custom
        page_sizes.append('Custom')
        self.format_combo.addItems(page_sizes)

        self.format_combo.setCurrentIndex(a4_id)
        self.page.pageUpdate()

        self.printview = QtGui.QGraphicsView()
        self.gridLayout.addWidget(self.printview)
        self.printscene = QtGui.QGraphicsScene()
        self.printscene.addItem(self.monotext)
        self.monotext.hide()
        self.printscene.addItem(self.page)
        self.page.hide()
        self.printview.setScene(self.printscene)

        self.col_spin.valueChanged.connect(self.redraw)
        self.col_spin.valueChanged.connect(lambda value: self.vertical_chk.setEnabled(True if value > 1 else False))
        self.vertical_chk.toggled.connect(self.redraw)
        self.format_combo.currentIndexChanged.connect(self.setPageSize)
        self.font_combo.currentFontChanged.connect(self.setFont)
        self.font_size_spin.valueChanged.connect(self.setFontSize)
        self.orientation_combo.currentIndexChanged.connect(self.setOrientation)
        self.spacing_spin.valueChanged.connect(self.setSpacing)
        self.banks_combo.selectionChanged.connect(self.bank_selection_update)
        self.bank_selection = tuple(range(len(self.main.blofeld_library.data)))
Esempio n. 9
0
    def __init__(self, main, parent):
        pt = namedtuple('pt', 'index delta')
        pt.__new__.__defaults__ = (0, )
        QtGui.QDialog.__init__(self, parent)
        load_ui(self, 'dialogs/globals.ui')
        self.setModal(True)

        self.main = main
#        if self.main.backend == ALSA:
        self.graph = main.graph
        self.input = main.input
        self.output = main.output
        self.sysex = []
        self.data = []
        self.original_data = []
        self.receiving = False
        self.general_layout = self.general_group.layout()
        self.system_layout = self.system_group.layout()
        self.midi_layout = self.midi_group.layout()
        self.layouts = self.general_layout, self.system_layout, self.midi_layout

        self.resetBtn = self.buttonBox.button(QtGui.QDialogButtonBox.Reset)
        self.resetBtn.setText('Reload from Blofeld')
        self.applyBtn = self.buttonBox.button(QtGui.QDialogButtonBox.Apply)
        self.applyBtn.clicked.connect(self.send_data)
        self.okBtn = self.buttonBox.button(QtGui.QDialogButtonBox.Ok)
        self.accepted.connect(self.check_changes)
        self.main.input_conn_state_change.connect(self.conn_check)
        self.main.output_conn_state_change.connect(self.conn_check)

        self.transp_spin.valueChanged.connect(lambda value: self.transp_spin.setPrefix('+' if value >= 0 else ''))
        self.transp_spin.valueChanged.emit(self.transp_spin.value())
        self.param_dict = {
                           self.volume_spin: pt(55), 
                           self.cat_combo: pt(56), 
                           self.tune_spin: pt(40, 376), 
                           self.transp_spin: pt(41, -64), 
                           self.freeBtn_combo: pt(59), 
                           self.devId_spin: pt(37), 
                           self.autoEdit_chk: pt(35), 
                           self.contrast_spin: pt(39), 
                           self.popup_spin: pt(38), 
                           self.velocity_combo: pt(50), 
                           self.pedal_combo: pt(60), 
                           self.channel_spin: pt(36), 
                           self.clock_combo: pt(48), 
                           self.pgmSend_chk: pt(46), 
                           self.localCtrl_chk: pt(57), 
                           self.ctrlSend_combo: pt(44), 
                           self.ctrlReceive_chk: pt(45), 
                           self.ctrlW_spin: pt(51), 
                           self.ctrlX_spin: pt(52), 
                           self.ctrlY_spin: pt(53), 
                           self.ctrlZ_spin: pt(54), 
                           }
        for w in self.param_dict:
            if isinstance(w, QtGui.QSpinBox):
                w.valueChanged.connect(self.editData)
            elif isinstance(w, PopupSpin):
                w.indexChanged.connect(self.editData)
            elif isinstance(w, QtGui.QComboBox):
                w.currentIndexChanged.connect(self.editData)
            else:
                w.toggled.connect(self.editData)