mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
http: Allow sharing automatically on PPSSPP start.
Since that might always be something you want, on your desktop.
This commit is contained in:
parent
caf9eca2db
commit
721f5877eb
@ -377,6 +377,7 @@ static ConfigSetting generalSettings[] = {
|
||||
ConfigSetting("LastRemoteISOServer", &g_Config.sLastRemoteISOServer, ""),
|
||||
ConfigSetting("LastRemoteISOPort", &g_Config.iLastRemoteISOPort, 0),
|
||||
ConfigSetting("RemoteISOManualConfig", &g_Config.bRemoteISOManual, false),
|
||||
ConfigSetting("RemoteShareOnStartup", &g_Config.bRemoteShareOnStartup, false),
|
||||
ConfigSetting("RemoteISOSubdir", &g_Config.sRemoteISOSubdir, "/"),
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
@ -143,6 +143,7 @@ public:
|
||||
std::string sLastRemoteISOServer;
|
||||
int iLastRemoteISOPort;
|
||||
bool bRemoteISOManual;
|
||||
bool bRemoteShareOnStartup;
|
||||
std::string sRemoteISOSubdir;
|
||||
bool bMemStickInserted;
|
||||
|
||||
|
@ -92,6 +92,7 @@
|
||||
#include "UI/HostTypes.h"
|
||||
#include "UI/OnScreenDisplay.h"
|
||||
#include "UI/MiscScreens.h"
|
||||
#include "UI/RemoteISOScreen.h"
|
||||
#include "UI/TiltEventProcessor.h"
|
||||
#include "UI/BackgroundAudio.h"
|
||||
#include "UI/TextureUtil.h"
|
||||
@ -544,6 +545,10 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
|
||||
screenManager->switchScreen(new LogoScreen());
|
||||
}
|
||||
|
||||
if (g_Config.bRemoteShareOnStartup) {
|
||||
StartRemoteISOSharing();
|
||||
}
|
||||
|
||||
std::string sysName = System_GetProperty(SYSPROP_NAME);
|
||||
isOuya = KeyMap::IsOuya(sysName);
|
||||
|
||||
|
@ -186,6 +186,20 @@ static void ExecuteServer() {
|
||||
UpdateStatus(ServerStatus::STOPPED);
|
||||
}
|
||||
|
||||
bool StartRemoteISOSharing() {
|
||||
std::lock_guard<std::mutex> guard(serverStatusLock);
|
||||
|
||||
if (serverStatus != ServerStatus::STOPPED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
serverStatus = ServerStatus::STARTING;
|
||||
serverThread = new std::thread(&ExecuteServer);
|
||||
serverThread->detach();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool FindServer(std::string &resultHost, int &resultPort) {
|
||||
http::Client http;
|
||||
Buffer result;
|
||||
@ -412,16 +426,10 @@ void RemoteISOScreen::CreateViews() {
|
||||
}
|
||||
|
||||
UI::EventReturn RemoteISOScreen::HandleStartServer(UI::EventParams &e) {
|
||||
std::lock_guard<std::mutex> guard(serverStatusLock);
|
||||
|
||||
if (serverStatus != ServerStatus::STOPPED) {
|
||||
if (!StartRemoteISOSharing()) {
|
||||
return EVENT_SKIPPED;
|
||||
}
|
||||
|
||||
serverStatus = ServerStatus::STARTING;
|
||||
serverThread = new std::thread(&ExecuteServer);
|
||||
serverThread->detach();
|
||||
|
||||
return EVENT_DONE;
|
||||
}
|
||||
|
||||
@ -651,7 +659,7 @@ void RemoteISOBrowseScreen::CreateViews() {
|
||||
}
|
||||
|
||||
RemoteISOSettingsScreen::RemoteISOSettingsScreen() {
|
||||
serverRunning_ = RetrieveStatus() != ServerStatus::STOPPED;;
|
||||
serverRunning_ = RetrieveStatus() != ServerStatus::STOPPED;
|
||||
}
|
||||
|
||||
void RemoteISOSettingsScreen::update() {
|
||||
@ -674,7 +682,8 @@ void RemoteISOSettingsScreen::CreateViews() {
|
||||
remoteisoSettingsScroll->Add(remoteisoSettings);
|
||||
|
||||
remoteisoSettings->Add(new ItemHeader(ri->T("Remote disc streaming")));
|
||||
remoteisoSettings->Add(new CheckBox(&g_Config.bRemoteISOManual, ri->T("Manual Mode Client", "Manual Mode Client")));
|
||||
remoteisoSettings->Add(new CheckBox(&g_Config.bRemoteShareOnStartup, ri->T("Share on PPSSPP startup")));
|
||||
remoteisoSettings->Add(new CheckBox(&g_Config.bRemoteISOManual, ri->T("Manual Mode Client", "Manually configure client")));
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
PopupTextInputChoice *remoteServer = remoteisoSettings->Add(new PopupTextInputChoice(&g_Config.sLastRemoteISOServer, ri->T("Remote Server"), "", 255, screenManager()));
|
||||
#else
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "UI/MiscScreens.h"
|
||||
#include "UI/MainScreen.h"
|
||||
|
||||
bool StartRemoteISOSharing();
|
||||
|
||||
class RemoteISOScreen : public UIScreenWithBackground {
|
||||
public:
|
||||
RemoteISOScreen();
|
||||
|
Loading…
Reference in New Issue
Block a user