Esempio n. 1
0
        def combobox_changed(a_self=None, a_val=None):
            f_str = str(f_device_name_combobox.currentText())
            if not f_str:
                return
            self.device_name = f_str
            f_samplerate = str(
                int(f_result_dict[self.subsystem
                ][self.device_name].defaultSampleRate))
            if f_samplerate in self.sample_rates:
                f_samplerate_combobox.setCurrentIndex(
                    f_samplerate_combobox.findText(f_samplerate))
            if not pydaw_util.IS_WINDOWS and not pydaw_util.IS_MAC_OSX:
                f_in_count = f_result_dict[
                    self.subsystem][self.device_name].maxInputChannels
                f_in_count = pydaw_util.pydaw_clip_value(f_in_count, 0, 128)
                f_audio_in_spinbox.setMaximum(f_in_count)
                f_audio_in_spinbox.setValue(
                    f_in_count if f_in_count < 16 else 16)

            f_out_count = f_result_dict[
                self.subsystem][self.device_name].maxOutputChannels
            f_out_count = pydaw_util.pydaw_clip_value(f_out_count, 0, 128)
            if f_out_count == 1:
                f_audio_out_spinbox.setMinimum(1)
            else:
                f_audio_out_spinbox.setMinimum(2)
            f_audio_out_spinbox.setMaximum(f_out_count)
Esempio n. 2
0
        def combobox_changed(a_self=None, a_val=None):
            f_str = str(f_device_name_combobox.currentText())
            if not f_str:
                return
            self.device_name = f_str
            f_samplerate = str(
                int(f_result_dict[self.subsystem][
                    self.device_name].defaultSampleRate))
            if f_samplerate in self.sample_rates:
                f_samplerate_combobox.setCurrentIndex(
                    f_samplerate_combobox.findText(f_samplerate))
            if not pydaw_util.IS_WINDOWS and not pydaw_util.IS_MAC_OSX:
                f_in_count = f_result_dict[self.subsystem][
                    self.device_name].maxInputChannels
                f_in_count = pydaw_util.pydaw_clip_value(f_in_count, 0, 128)
                f_audio_in_spinbox.setMaximum(f_in_count)
                f_audio_in_spinbox.setValue(
                    f_in_count if f_in_count < 16 else 16)

            f_out_count = f_result_dict[self.subsystem][
                self.device_name].maxOutputChannels
            f_out_count = pydaw_util.pydaw_clip_value(f_out_count, 0, 128)
            if f_out_count == 1:
                f_audio_out_spinbox.setMinimum(1)
            else:
                f_audio_out_spinbox.setMinimum(2)
            f_audio_out_spinbox.setMaximum(f_out_count)
Esempio n. 3
0
 def input_combobox_changed(a_self=None, a_val=None):
     f_str = str(f_input_name_combobox.currentText())
     self.input_name = f_str
     if not f_str:
         f_audio_in_spinbox.setMaximum(0)
         return
     f_in_count = f_result_dict[self.subsystem][self.input_name].maxInputChannels
     f_in_count = pydaw_util.pydaw_clip_value(f_in_count, 0, 128)
     f_audio_in_spinbox.setMaximum(f_in_count)
Esempio n. 4
0
 def input_combobox_changed(a_self=None, a_val=None):
     f_str = str(f_input_name_combobox.currentText())
     self.input_name = f_str
     if not f_str:
         f_audio_in_spinbox.setMaximum(0)
         return
     f_in_count = f_result_dict[self.subsystem][
         self.input_name].maxInputChannels
     f_in_count = pydaw_util.pydaw_clip_value(f_in_count, 0, 128)
     f_audio_in_spinbox.setMaximum(f_in_count)
     f_audio_in_spinbox.setValue(f_in_count if f_in_count < 16 else 16)
Esempio n. 5
0
def pydaw_center_widget_on_screen(a_widget):
    f_desktop_center = QApplication.desktop().screen().rect().center()
    f_widget_center = a_widget.rect().center()
    f_x = pydaw_clip_value(f_desktop_center.x() - f_widget_center.x(), 0, 300)
    f_y = pydaw_clip_value(f_desktop_center.y() - f_widget_center.y(), 0, 200)
    a_widget.move(f_x, f_y)
Esempio n. 6
0
def pydaw_center_widget_on_screen(a_widget):
    f_desktop_center = QApplication.desktop().screen().rect().center()
    f_widget_center = a_widget.rect().center()
    f_x = pydaw_clip_value(f_desktop_center.x() - f_widget_center.x(), 0, 300)
    f_y = pydaw_clip_value(f_desktop_center.y() - f_widget_center.y(), 0, 200)
    a_widget.move(f_x, f_y)