2016-07-03 17:24:33 +00:00
|
|
|
// Copyright (c) 2016- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-10-12 09:32:24 +00:00
|
|
|
#include <functional>
|
|
|
|
|
2016-07-03 17:24:33 +00:00
|
|
|
#include "ui/ui_screen.h"
|
|
|
|
#include "ui/viewgroup.h"
|
|
|
|
#include "UI/MiscScreens.h"
|
2016-07-04 03:48:27 +00:00
|
|
|
#include "UI/MainScreen.h"
|
2016-07-03 17:24:33 +00:00
|
|
|
|
2016-07-04 00:38:29 +00:00
|
|
|
namespace std {
|
|
|
|
class thread;
|
|
|
|
}
|
|
|
|
|
|
|
|
class recursive_mutex;
|
|
|
|
|
2016-07-03 17:24:33 +00:00
|
|
|
class RemoteISOScreen : public UIScreenWithBackground {
|
|
|
|
public:
|
|
|
|
RemoteISOScreen();
|
|
|
|
|
|
|
|
protected:
|
2016-07-03 17:43:35 +00:00
|
|
|
void update(InputState &input) override;
|
2016-07-03 17:24:33 +00:00
|
|
|
void CreateViews() override;
|
|
|
|
|
|
|
|
UI::EventReturn HandleStartServer(UI::EventParams &e);
|
|
|
|
UI::EventReturn HandleStopServer(UI::EventParams &e);
|
2016-07-04 00:38:29 +00:00
|
|
|
UI::EventReturn HandleBrowse(UI::EventParams &e);
|
2016-07-03 17:43:35 +00:00
|
|
|
|
|
|
|
bool serverRunning_;
|
2016-07-03 18:41:27 +00:00
|
|
|
bool serverStopping_;
|
2016-07-03 17:24:33 +00:00
|
|
|
};
|
2016-07-04 00:38:29 +00:00
|
|
|
|
2016-07-04 03:48:27 +00:00
|
|
|
enum class ScanStatus {
|
|
|
|
SCANNING,
|
|
|
|
RETRY_SCAN,
|
|
|
|
FOUND,
|
|
|
|
FAILED,
|
|
|
|
LOADING,
|
|
|
|
LOADED,
|
|
|
|
};
|
|
|
|
|
2016-07-04 00:38:29 +00:00
|
|
|
class RemoteISOConnectScreen : public UIScreenWithBackground {
|
|
|
|
public:
|
|
|
|
RemoteISOConnectScreen();
|
|
|
|
~RemoteISOConnectScreen() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void update(InputState &input) override;
|
|
|
|
void CreateViews() override;
|
|
|
|
|
2016-07-04 03:48:27 +00:00
|
|
|
ScanStatus GetStatus();
|
2016-07-04 00:38:29 +00:00
|
|
|
void ExecuteScan();
|
2016-07-04 03:48:27 +00:00
|
|
|
void ExecuteLoad();
|
2016-07-04 00:38:29 +00:00
|
|
|
|
2016-07-04 03:48:27 +00:00
|
|
|
UI::TextView *statusView_;
|
|
|
|
|
|
|
|
ScanStatus status_;
|
2016-07-04 00:38:29 +00:00
|
|
|
double nextRetry_;
|
|
|
|
std::thread *scanThread_;
|
2016-07-04 03:48:27 +00:00
|
|
|
recursive_mutex *statusLock_;
|
|
|
|
std::string host_;
|
|
|
|
int port_;
|
|
|
|
std::vector<std::string> games_;
|
2016-07-04 00:38:29 +00:00
|
|
|
};
|
|
|
|
|
2016-07-04 03:48:27 +00:00
|
|
|
class RemoteISOBrowseScreen : public MainScreen {
|
2016-07-04 00:38:29 +00:00
|
|
|
public:
|
2016-07-04 03:48:27 +00:00
|
|
|
RemoteISOBrowseScreen(const std::vector<std::string> &games);
|
2016-07-04 00:38:29 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void CreateViews() override;
|
2016-07-04 03:48:27 +00:00
|
|
|
|
|
|
|
std::vector<std::string> games_;
|
2016-07-04 00:38:29 +00:00
|
|
|
};
|