mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 15:19:53 -06:00
actually hook up most of that dialog
This commit is contained in:
@ -107,7 +107,9 @@ int FirmwareFavouriteColour;
|
|||||||
std::string FirmwareMessage;
|
std::string FirmwareMessage;
|
||||||
std::string FirmwareMAC;
|
std::string FirmwareMAC;
|
||||||
|
|
||||||
bool SocketBindAnyAddr;
|
int MPAudioMode;
|
||||||
|
int MPRecvTimeout;
|
||||||
|
|
||||||
std::string LANDevice;
|
std::string LANDevice;
|
||||||
bool DirectLAN;
|
bool DirectLAN;
|
||||||
|
|
||||||
@ -273,7 +275,9 @@ ConfigEntry ConfigFile[] =
|
|||||||
{"FirmwareMessage", 2, &FirmwareMessage, (std::string)"", true},
|
{"FirmwareMessage", 2, &FirmwareMessage, (std::string)"", true},
|
||||||
{"FirmwareMAC", 2, &FirmwareMAC, (std::string)"", true},
|
{"FirmwareMAC", 2, &FirmwareMAC, (std::string)"", true},
|
||||||
|
|
||||||
{"SockBindAnyAddr", 1, &SocketBindAnyAddr, false, false},
|
{"MPAudioMode", 0, &MPAudioMode, 1, false},
|
||||||
|
{"MPRecvTimeout", 0, &MPRecvTimeout, 25, false},
|
||||||
|
|
||||||
{"LANDevice", 2, &LANDevice, (std::string)"", false},
|
{"LANDevice", 2, &LANDevice, (std::string)"", false},
|
||||||
{"DirectLAN", 1, &DirectLAN, false, false},
|
{"DirectLAN", 1, &DirectLAN, false, false},
|
||||||
|
|
||||||
|
@ -143,7 +143,9 @@ extern int FirmwareFavouriteColour;
|
|||||||
extern std::string FirmwareMessage;
|
extern std::string FirmwareMessage;
|
||||||
extern std::string FirmwareMAC;
|
extern std::string FirmwareMAC;
|
||||||
|
|
||||||
extern bool SocketBindAnyAddr;
|
extern int MPAudioMode;
|
||||||
|
extern int MPRecvTimeout;
|
||||||
|
|
||||||
extern std::string LANDevice;
|
extern std::string LANDevice;
|
||||||
extern bool DirectLAN;
|
extern bool DirectLAN;
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ const u32 kReplyStart = kQueueSize / 2;
|
|||||||
const u32 kPacketEnd = kReplyStart;
|
const u32 kPacketEnd = kReplyStart;
|
||||||
const u32 kReplyEnd = kQueueSize;
|
const u32 kReplyEnd = kQueueSize;
|
||||||
|
|
||||||
const int RecvTimeout = 25;
|
int RecvTimeout;
|
||||||
|
|
||||||
int LastHostID;
|
int LastHostID;
|
||||||
|
|
||||||
@ -287,6 +287,8 @@ bool Init()
|
|||||||
|
|
||||||
printf("MP comm init OK, instance ID %d\n", InstanceID);
|
printf("MP comm init OK, instance ID %d\n", InstanceID);
|
||||||
|
|
||||||
|
RecvTimeout = 25;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,6 +307,11 @@ void DeInit()
|
|||||||
delete MPQueue;
|
delete MPQueue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetRecvTimeout(int timeout)
|
||||||
|
{
|
||||||
|
RecvTimeout = timeout;
|
||||||
|
}
|
||||||
|
|
||||||
void Begin()
|
void Begin()
|
||||||
{
|
{
|
||||||
MPQueue->lock();
|
MPQueue->lock();
|
||||||
|
@ -26,8 +26,12 @@ namespace LocalMP
|
|||||||
|
|
||||||
bool Init();
|
bool Init();
|
||||||
void DeInit();
|
void DeInit();
|
||||||
|
|
||||||
|
void SetRecvTimeout(int timeout);
|
||||||
|
|
||||||
void Begin();
|
void Begin();
|
||||||
void End();
|
void End();
|
||||||
|
|
||||||
int SendPacket(u8* data, int len, u64 timestamp);
|
int SendPacket(u8* data, int len, u64 timestamp);
|
||||||
int RecvPacket(u8* data, u64* timestamp);
|
int RecvPacket(u8* data, u64* timestamp);
|
||||||
int SendCmd(u8* data, int len, u64 timestamp);
|
int SendCmd(u8* data, int len, u64 timestamp);
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
MPSettingsDialog* MPSettingsDialog::currentDlg = nullptr;
|
MPSettingsDialog* MPSettingsDialog::currentDlg = nullptr;
|
||||||
|
|
||||||
bool MPSettingsDialog::needsReset = false;
|
|
||||||
|
|
||||||
extern bool RunningSomething;
|
extern bool RunningSomething;
|
||||||
|
|
||||||
|
|
||||||
@ -43,7 +41,13 @@ MPSettingsDialog::MPSettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
// todo
|
grpAudioMode = new QButtonGroup(this);
|
||||||
|
grpAudioMode->addButton(ui->rbAudioAll, 0);
|
||||||
|
grpAudioMode->addButton(ui->rbAudioOneOnly, 1);
|
||||||
|
grpAudioMode->addButton(ui->rbAudioActiveOnly, 2);
|
||||||
|
grpAudioMode->button(Config::MPAudioMode)->setChecked(true);
|
||||||
|
|
||||||
|
ui->sbReceiveTimeout->setValue(Config::MPRecvTimeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPSettingsDialog::~MPSettingsDialog()
|
MPSettingsDialog::~MPSettingsDialog()
|
||||||
@ -53,11 +57,10 @@ MPSettingsDialog::~MPSettingsDialog()
|
|||||||
|
|
||||||
void MPSettingsDialog::done(int r)
|
void MPSettingsDialog::done(int r)
|
||||||
{
|
{
|
||||||
needsReset = false;
|
|
||||||
|
|
||||||
if (r == QDialog::Accepted)
|
if (r == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
// TODO save shit here
|
Config::MPAudioMode = grpAudioMode->checkedId();
|
||||||
|
Config::MPRecvTimeout = ui->sbReceiveTimeout->value();
|
||||||
|
|
||||||
Config::Save();
|
Config::Save();
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#define MPSETTINGSDIALOG_H
|
#define MPSETTINGSDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
|
||||||
namespace Ui { class MPSettingsDialog; }
|
namespace Ui { class MPSettingsDialog; }
|
||||||
class MPSettingsDialog;
|
class MPSettingsDialog;
|
||||||
@ -50,8 +51,6 @@ public:
|
|||||||
currentDlg = nullptr;
|
currentDlg = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool needsReset;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void done(int r);
|
void done(int r);
|
||||||
|
|
||||||
@ -59,6 +58,8 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MPSettingsDialog* ui;
|
Ui::MPSettingsDialog* ui;
|
||||||
|
|
||||||
|
QButtonGroup* grpAudioMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MPSETTINGSDIALOG_H
|
#endif // MPSETTINGSDIALOG_H
|
||||||
|
@ -64,6 +64,9 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>1000</number>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
|
@ -1772,6 +1772,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||||||
{
|
{
|
||||||
actEmuSettings->setEnabled(false);
|
actEmuSettings->setEnabled(false);
|
||||||
actVideoSettings->setEnabled(false);
|
actVideoSettings->setEnabled(false);
|
||||||
|
actMPSettings->setEnabled(false);
|
||||||
actWifiSettings->setEnabled(false);
|
actWifiSettings->setEnabled(false);
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@ -2801,11 +2802,7 @@ void MainWindow::onOpenMPSettings()
|
|||||||
|
|
||||||
void MainWindow::onMPSettingsFinished(int res)
|
void MainWindow::onMPSettingsFinished(int res)
|
||||||
{
|
{
|
||||||
/*LocalMP::DeInit();
|
LocalMP::SetRecvTimeout(Config::MPRecvTimeout);
|
||||||
LocalMP::Init();
|
|
||||||
|
|
||||||
if (MPSettingsDialog::needsReset)
|
|
||||||
onReset();*/
|
|
||||||
|
|
||||||
emuThread->emuUnpause();
|
emuThread->emuUnpause();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user