Merge pull request #3071 from jriwanek-forks/multi-sound

Support up to 4 sound cards
This commit is contained in:
Miran Grča
2023-02-02 12:39:54 +01:00
committed by GitHub
56 changed files with 892 additions and 716 deletions

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Zvuková karta:"
msgid "Sound card 1:"
msgstr "Zvuková karta 1:"
msgid "Sound card 2:"
msgstr "Zvuková karta 2:"
msgid "Sound card 3:"
msgstr "Zvuková karta 3:"
msgid "Sound card 4:"
msgstr "Zvuková karta 4:"
msgid "MIDI Out Device:"
msgstr "MIDI výstup:"
@@ -418,15 +427,6 @@ msgstr "MIDI vstup:"
msgid "Standalone MPU-401"
msgstr "Samostatný MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Použít zvuk FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Soundkarte:"
msgid "Sound card 1:"
msgstr "Soundkarte 1:"
msgid "Sound card 2:"
msgstr "Soundkarte 2:"
msgid "Sound card 3:"
msgstr "Soundkarte 3:"
msgid "Sound card 4:"
msgstr "Soundkarte 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Out-Gerät:"
@@ -418,15 +427,6 @@ msgstr "MIDI In-Gerät:"
msgid "Standalone MPU-401"
msgstr "Standalone-MPU-401-Gerät"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32-Wiedergabe benutzen"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Sound card:"
msgid "Sound card 1:"
msgstr "Sound card 1:"
msgid "Sound card 2:"
msgstr "Sound card 2:"
msgid "Sound card 3:"
msgstr "Sound card 3:"
msgid "Sound card 4:"
msgstr "Sound card 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Out Device:"
@@ -418,15 +427,6 @@ msgstr "MIDI In Device:"
msgid "Standalone MPU-401"
msgstr "Standalone MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Use FLOAT32 sound"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Sound card:"
msgid "Sound card 1:"
msgstr "Sound card 1:"
msgid "Sound card 2:"
msgstr "Sound card 2:"
msgid "Sound card 3:"
msgstr "Sound card 3:"
msgid "Sound card 4:"
msgstr "Sound card 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Out Device:"
@@ -418,15 +427,6 @@ msgstr "MIDI In Device:"
msgid "Standalone MPU-401"
msgstr "Standalone MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Use FLOAT32 sound"

View File

@@ -406,8 +406,17 @@ msgstr "Mando 3..."
msgid "Joystick 4..."
msgstr "Mando 4..."
msgid "Sound card:"
msgstr "Tarjeta de sonido:"
msgid "Sound card 1:"
msgstr "Tarjeta de sonido 1:"
msgid "Sound card 2:"
msgstr "Tarjeta de sonido 2:"
msgid "Sound card 3:"
msgstr "Tarjeta de sonido 3:"
msgid "Sound card 4:"
msgstr "Tarjeta de sonido 4:"
msgid "MIDI Out Device:"
msgstr "Dispositivo MIDI de salida:"
@@ -418,15 +427,6 @@ msgstr "Dispositivo MIDI de entrada:"
msgid "Standalone MPU-401"
msgstr "MPU-401 independiente"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Usar sonido FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Peliohjain 3..."
msgid "Joystick 4..."
msgstr "Peliohjain 4..."
msgid "Sound card:"
msgstr "Äänikortti:"
msgid "Sound card 1:"
msgstr "Äänikortti 1:"
msgid "Sound card 2:"
msgstr "Äänikortti 2:"
msgid "Sound card 3:"
msgstr "Äänikortti 3:"
msgid "Sound card 4:"
msgstr "Äänikortti 4:"
msgid "MIDI Out Device:"
msgstr "MIDI-ulostulo:"
@@ -418,15 +427,6 @@ msgstr "MIDI-sisääntulo:"
msgid "Standalone MPU-401"
msgstr "Erillinen MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Käytä FLOAT32-ääntä"

View File

@@ -406,8 +406,17 @@ msgstr "Manette 3..."
msgid "Joystick 4..."
msgstr "Manette 4..."
msgid "Sound card:"
msgstr "Carte son:"
msgid "Sound card 1:"
msgstr "Carte son 1:"
msgid "Sound card 2:"
msgstr "Carte son 2:"
msgid "Sound card 3:"
msgstr "Carte son 3:"
msgid "Sound card 4:"
msgstr "Carte son 4:"
msgid "MIDI Out Device:"
msgstr "Sortie MIDI:"
@@ -418,15 +427,6 @@ msgstr "Entrée MIDI:"
msgid "Standalone MPU-401"
msgstr "MPU-401 autonome"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Utiliser le son FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Palica za igru 3..."
msgid "Joystick 4..."
msgstr "Palica za igru 4..."
msgid "Sound card:"
msgstr "Zvučna kartica:"
msgid "Sound card 1:"
msgstr "Zvučna kartica 1:"
msgid "Sound card 2:"
msgstr "Zvučna kartica 2:"
msgid "Sound card 3:"
msgstr "Zvučna kartica 3:"
msgid "Sound card 4:"
msgstr "Zvučna kartica 4:"
msgid "MIDI Out Device:"
msgstr "Izlazni uređaj MIDI:"
@@ -418,15 +427,6 @@ msgstr "Ulazni uređaj MIDI:"
msgid "Standalone MPU-401"
msgstr "Samostalni MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Koristi FLOAT32 za zvuk"

View File

@@ -406,8 +406,17 @@ msgstr "Játékvez. 3..."
msgid "Joystick 4..."
msgstr "Játékvez. 4..."
msgid "Sound card:"
msgstr "Hangkártya:"
msgid "Sound card 1:"
msgstr "Hangkártya 1:"
msgid "Sound card 2:"
msgstr "Hangkártya 2:"
msgid "Sound card 3:"
msgstr "Hangkártya 3:"
msgid "Sound card 4:"
msgstr "Hangkártya 4:"
msgid "MIDI Out Device:"
msgstr "MIDI-kimenet:"
@@ -418,15 +427,6 @@ msgstr "MIDI-bemenet:"
msgid "Standalone MPU-401"
msgstr "Különálló MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32 használata"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Scheda audio:"
msgid "Sound card 1:"
msgstr "Scheda audio 1:"
msgid "Sound card 2:"
msgstr "Scheda audio 2:"
msgid "Sound card 3:"
msgstr "Scheda audio 3:"
msgid "Sound card 4:"
msgstr "Scheda audio 4:"
msgid "MIDI Out Device:"
msgstr "Uscita MIDI:"
@@ -418,15 +427,6 @@ msgstr "Entrata MIDI:"
msgid "Standalone MPU-401"
msgstr "MPU-401 autonomo"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Usa suono FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "ジョイスティック3..."
msgid "Joystick 4..."
msgstr "ジョイスティック4..."
msgid "Sound card:"
msgstr "サウンドカード:"
msgid "Sound card 1:"
msgstr "サウンドカード 1:"
msgid "Sound card 2:"
msgstr "サウンドカード 2:"
msgid "Sound card 3:"
msgstr "サウンドカード 3:"
msgid "Sound card 4:"
msgstr "サウンドカード 4:"
msgid "MIDI Out Device:"
msgstr "MIDI出力デバイス:"
@@ -418,15 +427,6 @@ msgstr "MIDI入力デバイス:"
msgid "Standalone MPU-401"
msgstr "独立型MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32サウンドを使用する"

View File

@@ -406,8 +406,17 @@ msgstr "조이스틱 3..."
msgid "Joystick 4..."
msgstr "조이스틱 4..."
msgid "Sound card:"
msgstr "사운드 카드:"
msgid "Sound card 1:"
msgstr "사운드 카드 1:"
msgid "Sound card 2:"
msgstr "사운드 카드 2:"
msgid "Sound card 3:"
msgstr "사운드 카드 3:"
msgid "Sound card 4:"
msgstr "사운드 카드 4:"
msgid "MIDI Out Device:"
msgstr "MIDI 출력 장치:"
@@ -418,15 +427,6 @@ msgstr "MIDI 입력 장치:"
msgid "Standalone MPU-401"
msgstr "MPU-401 단독 사용"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32 사운드 사용"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Karta dźwiękowa:"
msgid "Sound card 1:"
msgstr "Karta dźwiękowa 1:"
msgid "Sound card 2:"
msgstr "Karta dźwiękowa 2:"
msgid "Sound card 3:"
msgstr "Karta dźwiękowa 3:"
msgid "Sound card 4:"
msgstr "Karta dźwiękowa 4:"
msgid "MIDI Out Device:"
msgstr "Urządzenie wyjściowe MIDI:"
@@ -418,15 +427,6 @@ msgstr "Urządzenie wejściowe MIDI:"
msgid "Standalone MPU-401"
msgstr "Samodzielne urządzenie MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Użyj dźwięku FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Placa de som:"
msgid "Sound card 1:"
msgstr "Placa de som 1:"
msgid "Sound card 2:"
msgstr "Placa de som 2:"
msgid "Sound card 3:"
msgstr "Placa de som 3:"
msgid "Sound card 4:"
msgstr "Placa de som 4:"
msgid "MIDI Out Device:"
msgstr "Disp. de saída MIDI:"
@@ -418,15 +427,6 @@ msgstr "Disp. de entrada MIDI:"
msgid "Standalone MPU-401"
msgstr "MPU-401 autônomo"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Usar som FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Joystick 3..."
msgid "Joystick 4..."
msgstr "Joystick 4..."
msgid "Sound card:"
msgstr "Placa de som:"
msgid "Sound card 1:"
msgstr "Placa de som 1:"
msgid "Sound card 2:"
msgstr "Placa de som 2:"
msgid "Sound card 3:"
msgstr "Placa de som 3:"
msgid "Sound card 4:"
msgstr "Placa de som 4:"
msgid "MIDI Out Device:"
msgstr "Disp. saída MIDI:"
@@ -418,15 +427,6 @@ msgstr "Disp. entrada MIDI:"
msgid "Standalone MPU-401"
msgstr "MPU-401 autónomo"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Utilizar som FLOAT32"

View File

@@ -406,8 +406,17 @@ msgstr "Джойстик 3..."
msgid "Joystick 4..."
msgstr "Джойстик 4..."
msgid "Sound card:"
msgstr "Звуковая карта:"
msgid "Sound card 1:"
msgstr "Звуковая карта 1:"
msgid "Sound card 2:"
msgstr "Звуковая карта 2:"
msgid "Sound card 3:"
msgstr "Звуковая карта 3:"
msgid "Sound card 4:"
msgstr "Звуковая карта 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Out устр-во:"
@@ -418,15 +427,6 @@ msgstr "MIDI In устр-во:"
msgid "Standalone MPU-401"
msgstr "Отдельный MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32 звук"

View File

@@ -406,8 +406,17 @@ msgstr "Igralna palica 3..."
msgid "Joystick 4..."
msgstr "Igralna palica 4..."
msgid "Sound card:"
msgstr "Zvočna kartica:"
msgid "Sound card 1:"
msgstr "Zvočna kartica 1:"
msgid "Sound card 2:"
msgstr "Zvočna kartica 2:"
msgid "Sound card 3:"
msgstr "Zvočna kartica 3:"
msgid "Sound card 4:"
msgstr "Zvočna kartica 4:"
msgid "MIDI Out Device:"
msgstr "Izhodna naprava MIDI:"
@@ -418,15 +427,6 @@ msgstr "Vhodna naprava MIDI:"
msgid "Standalone MPU-401"
msgstr "Samostojen MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "Uporabi FLOAT32 za zvok"

View File

@@ -406,8 +406,17 @@ msgstr "Oyun kolu 3..."
msgid "Joystick 4..."
msgstr "Oyun kolu 4..."
msgid "Sound card:"
msgstr "Ses kartı:"
msgid "Sound card 1:"
msgstr "Ses kartı 1:"
msgid "Sound card 2:"
msgstr "Ses kartı 2:"
msgid "Sound card 3:"
msgstr "Ses kartı 3:"
msgid "Sound card 4:"
msgstr "Ses kartı 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Çıkış Cihazı:"
@@ -418,15 +427,6 @@ msgstr "MIDI Giriş Cihazı:"
msgid "Standalone MPU-401"
msgstr "Bağımsız MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32 ses kullan"

View File

@@ -406,8 +406,17 @@ msgstr "Джойстик 3..."
msgid "Joystick 4..."
msgstr "Джойстик 4..."
msgid "Sound card:"
msgstr "Звукова карта:"
msgid "Sound card 1:"
msgstr "Звукова карта 1:"
msgid "Sound card 2:"
msgstr "Звукова карта 2:"
msgid "Sound card 3:"
msgstr "Звукова карта 3:"
msgid "Sound card 4:"
msgstr "Звукова карта 4:"
msgid "MIDI Out Device:"
msgstr "MIDI Out при-ій:"
@@ -418,15 +427,6 @@ msgstr "MIDI In при-ій:"
msgid "Standalone MPU-401"
msgstr "Окремий MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "FLOAT32 звук"

View File

@@ -406,8 +406,17 @@ msgstr "操纵杆 3..."
msgid "Joystick 4..."
msgstr "操纵杆 4..."
msgid "Sound card:"
msgstr "声卡:"
msgid "Sound card 1:"
msgstr "声卡 1:"
msgid "Sound card 2:"
msgstr "声卡 2:"
msgid "Sound card 3:"
msgstr "声卡 3:"
msgid "Sound card 4:"
msgstr "声卡 4:"
msgid "MIDI Out Device:"
msgstr "MIDI 输出设备:"
@@ -418,15 +427,6 @@ msgstr "MIDI 输入设备:"
msgid "Standalone MPU-401"
msgstr "独立 MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "使用单精度浮点 (FLOAT32)"

View File

@@ -406,8 +406,17 @@ msgstr "搖桿 3..."
msgid "Joystick 4..."
msgstr "搖桿 4..."
msgid "Sound card:"
msgstr "音訊卡:"
msgid "Sound card 1:"
msgstr "音訊卡 1:"
msgid "Sound card 2:"
msgstr "音訊卡 2:"
msgid "Sound card 3:"
msgstr "音訊卡 3:"
msgid "Sound card 4:"
msgstr "音訊卡 4:"
msgid "MIDI Out Device:"
msgstr "MIDI 輸出裝置:"
@@ -418,15 +427,6 @@ msgstr "MIDI 輸入裝置:"
msgid "Standalone MPU-401"
msgstr "獨立 MPU-401"
msgid "Innovation SSI-2001"
msgstr "Innovation SSI-2001"
msgid "CMS / Game Blaster"
msgstr "CMS / Game Blaster"
msgid "Gravis Ultrasound"
msgstr "Gravis Ultrasound"
msgid "Use FLOAT32 sound"
msgstr "使用單精度浮點 (FLOAT32)"

View File

@@ -11,8 +11,10 @@
*
*
* Authors: Joakim L. Gilje <jgilje@jgilje.net>
* Jasmine Iwanek <jriwanek@gmail.com>
*
* Copyright 2021 Joakim L. Gilje
* Copyright 2021 Joakim L. Gilje
* Copyright 2022-2023 Jasmine Iwanek
*/
#include "qt_settingssound.hpp"
#include "ui_qt_settingssound.h"
@@ -47,17 +49,17 @@ SettingsSound::~SettingsSound()
void
SettingsSound::save()
{
sound_card_current = ui->comboBoxSoundCard->currentData().toInt();
for (uint8_t i = 0; i < SOUND_CARD_MAX; ++i) {
auto *cbox = findChild<QComboBox *>(QString("comboBoxSoundCard%1").arg(i + 1));
sound_card_current[i] = cbox->currentData().toInt();
}
midi_output_device_current = ui->comboBoxMidiOut->currentData().toInt();
midi_input_device_current = ui->comboBoxMidiIn->currentData().toInt();
mpu401_standalone_enable = ui->checkBoxMPU401->isChecked() ? 1 : 0;
SSI2001 = ui->checkBoxSSI2001->isChecked() ? 1 : 0;
;
GAMEBLASTER = ui->checkBoxCMS->isChecked() ? 1 : 0;
GUS = ui->checkBoxGUS->isChecked() ? 1 : 0;
;
sound_is_float = ui->checkBoxFloat32->isChecked() ? 1 : 0;
;
if (ui->radioButtonYMFM->isChecked())
fm_driver = FM_DRV_YMFM;
else
@@ -69,41 +71,45 @@ SettingsSound::onCurrentMachineChanged(int machineId)
{
this->machineId = machineId;
auto *model = ui->comboBoxSoundCard->model();
auto removeRows = model->rowCount();
int c = 0;
int selectedRow = 0;
while (true) {
/* Skip "internal" if machine doesn't have it. */
if ((c == 1) && (machine_has_flags(machineId, MACHINE_SOUND) == 0)) {
c++;
continue;
}
int c = 0;
int selectedRow = 0;
auto *sound_dev = sound_card_getdevice(c);
QString name = DeviceConfig::DeviceName(sound_dev, sound_card_get_internal_name(c), 1);
if (name.isEmpty()) {
break;
}
for (uint8_t i = 0; i < SOUND_CARD_MAX; ++i) {
auto *cbox = findChild<QComboBox *>(QString("comboBoxSoundCard%1").arg(i + 1));
auto *model = cbox->model();
auto removeRows = model->rowCount();
c = 0;
selectedRow = 0;
if (sound_card_available(c)) {
if (device_is_valid(sound_dev, machineId)) {
while (true) {
/* Skip "internal" if machine doesn't have it for the first card, always skip for others. */
if (((c == 1) && (machine_has_flags(machineId, MACHINE_SOUND) == 0)) || (i != 0)) {
c++;
continue;
}
auto name = DeviceConfig::DeviceName(sound_card_getdevice(c), sound_card_get_internal_name(c), 1);
if (name.isEmpty()) {
break;
}
if (sound_card_available(c) && device_is_valid(sound_card_getdevice(c), machineId)) {
int row = Models::AddEntry(model, name, c);
if (c == sound_card_current) {
if (c == sound_card_current[i]) {
selectedRow = row - removeRows;
}
}
c++;
}
c++;
model->removeRows(0, removeRows);
cbox->setEnabled(model->rowCount() > 0);
cbox->setCurrentIndex(-1);
cbox->setCurrentIndex(selectedRow);
}
model->removeRows(0, removeRows);
ui->comboBoxSoundCard->setEnabled(model->rowCount() > 0);
ui->comboBoxSoundCard->setCurrentIndex(-1);
ui->comboBoxSoundCard->setCurrentIndex(selectedRow);
model = ui->comboBoxMidiOut->model();
removeRows = model->rowCount();
auto model = ui->comboBoxMidiOut->model();
auto removeRows = model->rowCount();
c = 0;
selectedRow = 0;
while (true) {
@@ -150,19 +156,8 @@ SettingsSound::onCurrentMachineChanged(int machineId)
ui->comboBoxMidiIn->setCurrentIndex(selectedRow);
ui->checkBoxMPU401->setChecked(mpu401_standalone_enable > 0);
ui->checkBoxSSI2001->setChecked(SSI2001 > 0);
ui->checkBoxCMS->setChecked(GAMEBLASTER > 0);
ui->checkBoxGUS->setChecked(GUS > 0);
ui->checkBoxFloat32->setChecked(sound_is_float > 0);
bool hasIsa = machine_has_bus(machineId, MACHINE_BUS_ISA) > 0;
bool hasIsa16 = machine_has_bus(machineId, MACHINE_BUS_ISA16) > 0;
ui->checkBoxCMS->setEnabled(hasIsa);
ui->pushButtonConfigureCMS->setEnabled((GAMEBLASTER > 0) && hasIsa);
ui->checkBoxGUS->setEnabled(hasIsa16);
ui->pushButtonConfigureGUS->setEnabled((GUS > 0) && hasIsa16);
ui->checkBoxSSI2001->setEnabled(hasIsa);
ui->pushButtonConfigureSSI2001->setEnabled((SSI2001 > 0) && hasIsa);
switch (fm_driver) {
case FM_DRV_YMFM:
ui->radioButtonYMFM->setChecked(true);
@@ -192,18 +187,63 @@ allowMpu401(Ui::SettingsSound *ui)
}
void
SettingsSound::on_comboBoxSoundCard_currentIndexChanged(int index)
SettingsSound::on_comboBoxSoundCard1_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
ui->pushButtonConfigureSoundCard->setEnabled(sound_card_has_config(ui->comboBoxSoundCard->currentData().toInt()));
ui->pushButtonConfigureSoundCard1->setEnabled(sound_card_has_config(ui->comboBoxSoundCard1->currentData().toInt()));
}
void
SettingsSound::on_pushButtonConfigureSoundCard_clicked()
SettingsSound::on_pushButtonConfigureSoundCard1_clicked()
{
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard1->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsSound::on_comboBoxSoundCard2_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
ui->pushButtonConfigureSoundCard2->setEnabled(sound_card_has_config(ui->comboBoxSoundCard2->currentData().toInt()));
}
void
SettingsSound::on_pushButtonConfigureSoundCard2_clicked()
{
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard2->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsSound::on_comboBoxSoundCard3_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
ui->pushButtonConfigureSoundCard3->setEnabled(sound_card_has_config(ui->comboBoxSoundCard3->currentData().toInt()));
}
void
SettingsSound::on_pushButtonConfigureSoundCard3_clicked()
{
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard3->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsSound::on_comboBoxSoundCard4_currentIndexChanged(int index)
{
if (index < 0) {
return;
}
ui->pushButtonConfigureSoundCard1->setEnabled(sound_card_has_config(ui->comboBoxSoundCard4->currentData().toInt()));
}
void
SettingsSound::on_pushButtonConfigureSoundCard4_clicked()
{
DeviceConfig::ConfigureDevice(sound_card_getdevice(ui->comboBoxSoundCard4->currentData().toInt()), 0, qobject_cast<Settings *>(Settings::settings));
}
void
@@ -246,24 +286,6 @@ SettingsSound::on_checkBoxMPU401_stateChanged(int state)
ui->pushButtonConfigureMPU401->setEnabled(state == Qt::Checked);
}
void
SettingsSound::on_checkBoxSSI2001_stateChanged(int state)
{
ui->pushButtonConfigureSSI2001->setEnabled(state == Qt::Checked);
}
void
SettingsSound::on_checkBoxCMS_stateChanged(int state)
{
ui->pushButtonConfigureCMS->setEnabled(state == Qt::Checked);
}
void
SettingsSound::on_checkBoxGUS_stateChanged(int state)
{
ui->pushButtonConfigureGUS->setEnabled(state == Qt::Checked);
}
void
SettingsSound::on_pushButtonConfigureMPU401_clicked()
{
@@ -273,21 +295,3 @@ SettingsSound::on_pushButtonConfigureMPU401_clicked()
DeviceConfig::ConfigureDevice(&mpu401_device, 0, qobject_cast<Settings *>(Settings::settings));
}
}
void
SettingsSound::on_pushButtonConfigureSSI2001_clicked()
{
DeviceConfig::ConfigureDevice(&ssi2001_device, 0, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsSound::on_pushButtonConfigureCMS_clicked()
{
DeviceConfig::ConfigureDevice(&cms_device, 0, qobject_cast<Settings *>(Settings::settings));
}
void
SettingsSound::on_pushButtonConfigureGUS_clicked()
{
DeviceConfig::ConfigureDevice(&gus_device, 0, qobject_cast<Settings *>(Settings::settings));
}

View File

@@ -20,20 +20,20 @@ public slots:
void onCurrentMachineChanged(int machineId);
private slots:
void on_pushButtonConfigureGUS_clicked();
void on_pushButtonConfigureCMS_clicked();
void on_pushButtonConfigureSSI2001_clicked();
void on_pushButtonConfigureMPU401_clicked();
void on_checkBoxGUS_stateChanged(int arg1);
void on_checkBoxCMS_stateChanged(int arg1);
void on_checkBoxSSI2001_stateChanged(int arg1);
void on_checkBoxMPU401_stateChanged(int arg1);
void on_pushButtonConfigureMidiIn_clicked();
void on_pushButtonConfigureMidiOut_clicked();
void on_comboBoxMidiIn_currentIndexChanged(int index);
void on_comboBoxMidiOut_currentIndexChanged(int index);
void on_pushButtonConfigureSoundCard_clicked();
void on_comboBoxSoundCard_currentIndexChanged(int index);
void on_pushButtonConfigureSoundCard1_clicked();
void on_comboBoxSoundCard1_currentIndexChanged(int index);
void on_pushButtonConfigureSoundCard2_clicked();
void on_comboBoxSoundCard2_currentIndexChanged(int index);
void on_pushButtonConfigureSoundCard3_clicked();
void on_comboBoxSoundCard3_currentIndexChanged(int index);
void on_pushButtonConfigureSoundCard4_clicked();
void on_comboBoxSoundCard4_currentIndexChanged(int index);
private:
Ui::SettingsSound *ui;

View File

@@ -26,42 +26,73 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item row="2" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>MIDI In Device:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSSI2001">
<property name="text">
<string>Innovation SSI-2001</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBoxGUS">
<property name="text">
<string>Gravis Ultrasound</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Sound card:</string>
<string>Sound card #1:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="pushButtonConfigureSoundCard">
<widget class="QPushButton" name="pushButtonConfigureSoundCard1">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Sound card #2:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QPushButton" name="pushButtonConfigureSoundCard2">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Sound card #3:</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QPushButton" name="pushButtonConfigureSoundCard3">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Sound card #4:</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="pushButtonConfigureSoundCard4">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="comboBoxMidiIn">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -71,49 +102,35 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>MIDI Out Device:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<item row="6" column="0">
<widget class="QCheckBox" name="checkBoxMPU401">
<property name="text">
<string>Standalone MPU-401</string>
</property>
</widget>
</item>
<item row="3" column="3">
<item row="6" column="3">
<widget class="QPushButton" name="pushButtonConfigureMPU401">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="2" column="3">
<item row="5" column="3">
<widget class="QPushButton" name="pushButtonConfigureMidiIn">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QPushButton" name="pushButtonConfigureSSI2001">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBoxCMS">
<property name="text">
<string>CMS / Game Blaster</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="4" column="1">
<widget class="QComboBox" name="comboBoxMidiOut">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -123,35 +140,21 @@
</property>
</widget>
</item>
<item row="1" column="3">
<item row="4" column="3">
<widget class="QPushButton" name="pushButtonConfigureMidiOut">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="7" column="0">
<item row="10" column="0">
<widget class="QCheckBox" name="checkBoxFloat32">
<property name="text">
<string>Use FLOAT32 sound</string>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QPushButton" name="pushButtonConfigureCMS">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QPushButton" name="pushButtonConfigureGUS">
<property name="text">
<string>Configure</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="11" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -180,7 +183,7 @@
</layout>
</widget>
</item>
<item row="9" column="0">
<item row="12" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -194,7 +197,37 @@
</spacer>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBoxSoundCard">
<widget class="QComboBox" name="comboBoxSoundCard1">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBoxSoundCard2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboBoxSoundCard3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBoxSoundCard4">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>