~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to UI/RemoteISOScreen.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2016- PPSSPP Project.
 
2
 
 
3
// This program is free software: you can redistribute it and/or modify
 
4
// it under the terms of the GNU General Public License as published by
 
5
// the Free Software Foundation, version 2.0 or later versions.
 
6
 
 
7
// This program is distributed in the hope that it will be useful,
 
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
// GNU General Public License 2.0 for more details.
 
11
 
 
12
// A copy of the GPL 2.0 should have been included with the program.
 
13
// If not, see http://www.gnu.org/licenses/
 
14
 
 
15
// Official git repository and contact information can be found at
 
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
 
17
 
 
18
#pragma once
 
19
 
 
20
#include "base/functional.h"
 
21
#include "ui/ui_screen.h"
 
22
#include "ui/viewgroup.h"
 
23
#include "UI/MiscScreens.h"
 
24
#include "UI/MainScreen.h"
 
25
 
 
26
namespace std {
 
27
        class thread;
 
28
}
 
29
 
 
30
class recursive_mutex;
 
31
 
 
32
class RemoteISOScreen : public UIScreenWithBackground {
 
33
public:
 
34
        RemoteISOScreen();
 
35
 
 
36
protected:
 
37
        void update(InputState &input) override;
 
38
        void CreateViews() override;
 
39
 
 
40
        UI::EventReturn HandleStartServer(UI::EventParams &e);
 
41
        UI::EventReturn HandleStopServer(UI::EventParams &e);
 
42
        UI::EventReturn HandleBrowse(UI::EventParams &e);
 
43
 
 
44
        bool serverRunning_;
 
45
        bool serverStopping_;
 
46
};
 
47
 
 
48
enum class ScanStatus {
 
49
        SCANNING,
 
50
        RETRY_SCAN,
 
51
        FOUND,
 
52
        FAILED,
 
53
        LOADING,
 
54
        LOADED,
 
55
};
 
56
 
 
57
class RemoteISOConnectScreen : public UIScreenWithBackground {
 
58
public:
 
59
        RemoteISOConnectScreen();
 
60
        ~RemoteISOConnectScreen() override;
 
61
 
 
62
protected:
 
63
        void update(InputState &input) override;
 
64
        void CreateViews() override;
 
65
 
 
66
        ScanStatus GetStatus();
 
67
        void ExecuteScan();
 
68
        void ExecuteLoad();
 
69
 
 
70
        UI::TextView *statusView_;
 
71
 
 
72
        ScanStatus status_;
 
73
        double nextRetry_;
 
74
        std::thread *scanThread_;
 
75
        recursive_mutex *statusLock_;
 
76
        std::string host_;
 
77
        int port_;
 
78
        std::vector<std::string> games_;
 
79
};
 
80
 
 
81
class RemoteISOBrowseScreen : public MainScreen {
 
82
public:
 
83
        RemoteISOBrowseScreen(const std::vector<std::string> &games);
 
84
 
 
85
protected:
 
86
        void CreateViews() override;
 
87
 
 
88
        std::vector<std::string> games_;
 
89
};