Skip to content

Commit

Permalink
GUI - live music mixer: Add loudness balance
Browse files Browse the repository at this point in the history
  • Loading branch information
chinosk6 committed Aug 26, 2023
1 parent c72dac1 commit 9d8db64
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 176 deletions.
8 changes: 6 additions & 2 deletions gui/guimain.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,19 @@ def get_widget_all_items(wid: QListWidget):
widget: QListWidget = getattr(self.ui, f"listWidget_mx_{i}")
args0 += [int(i.text()) for i in get_widget_all_items(widget)]
ex = self.get_live_extractor()
save_names = ex.mix_live_song_all_sing(music_id, list(set(args0)), float(self.ui.lineEdit_chara_vol.text()))
chara_vol_str = self.ui.lineEdit_chara_vol.text().strip()
chara_vol_str = chara_vol_str or "-2"
save_names = ex.mix_live_song_all_sing(music_id, list(set(args0)), float(chara_vol_str))
voiceex.log.logger(f"Extract success: {save_names}")
else:
args = []
for i in range(8)[1:]:
widget: QListWidget = getattr(self.ui, f"listWidget_mx_{i}")
args.append([int(i.text()) for i in get_widget_all_items(widget)])
ex = self.get_live_extractor()
save_names = ex.mix_live_song_by_parts(music_id, *args, volume=float(self.ui.lineEdit_chara_vol.text()))
chara_vol_str = self.ui.lineEdit_chara_vol.text().strip()
chara_vol_str = chara_vol_str or "-2"
save_names = ex.mix_live_song_by_parts(music_id, *args, volume=float(chara_vol_str))
voiceex.log.logger(f"Extract success: {save_names}")
finally:
self.set_start_btn_stat_signal.emit(True)
Expand Down
7 changes: 5 additions & 2 deletions gui/qtui/main_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ def setupUi(self, MainWindow):
self.label_15.setObjectName("label_15")
self.gridLayout_5.addWidget(self.label_15, 1, 0, 1, 1)
self.lineEdit_chara_vol = QtWidgets.QLineEdit(self.groupBox_9)
self.lineEdit_chara_vol.setInputMask("")
self.lineEdit_chara_vol.setObjectName("lineEdit_chara_vol")
self.gridLayout_5.addWidget(self.lineEdit_chara_vol, 1, 1, 1, 1)
self.pushButton_start_mix = QtWidgets.QPushButton(self.groupBox_9)
Expand Down Expand Up @@ -530,7 +531,7 @@ def setupUi(self, MainWindow):
self.tabWidget.setCurrentIndex(0)
self.tabWidget_4.setCurrentIndex(0)
self.tabWidget_music_type.setCurrentIndex(0)
self.tabWidget_2.setCurrentIndex(0)
self.tabWidget_2.setCurrentIndex(1)
self.tabWidget_parts.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

Expand Down Expand Up @@ -607,7 +608,9 @@ def retranslateUi(self, MainWindow):
self.pushButton_me_clear.setText(_translate("MainWindow", "Clear"))
self.groupBox_9.setTitle(_translate("MainWindow", "Mix Config"))
self.label_15.setText(_translate("MainWindow", "Character Volume"))
self.lineEdit_chara_vol.setText(_translate("MainWindow", "0.85"))
self.lineEdit_chara_vol.setToolTip(_translate("MainWindow", "Leave blank to automatically balance the loudness. -1 will not change volume. 1.0 is the full volume."))
self.lineEdit_chara_vol.setText(_translate("MainWindow", "-1"))
self.lineEdit_chara_vol.setPlaceholderText(_translate("MainWindow", "Leave blank to automatically balance the loudness. -1 will not change volume. 1.0 is the full volume."))
self.pushButton_start_mix.setText(_translate("MainWindow", "Start Mix"))
self.checkBox_all_singing.setText(_translate("MainWindow", "Force All Singing"))
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate("MainWindow", "Mixer"))
Expand Down
Binary file modified gui/qtui/main_ui.qm
Binary file not shown.
Loading

0 comments on commit 9d8db64

Please sign in to comment.