2013-04-18 03:43:35 +00:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2009-07-06 02:10:26 +00:00
|
|
|
|
|
|
|
#ifndef _NETWINDOW_H_
|
|
|
|
#define _NETWINDOW_H_
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
#include "CommonTypes.h"
|
|
|
|
|
|
|
|
#include <queue>
|
2009-07-06 02:10:26 +00:00
|
|
|
#include <string>
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
#include <wx/wx.h>
|
2012-03-18 09:31:19 +00:00
|
|
|
#include <wx/event.h>
|
2009-07-06 02:10:26 +00:00
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/dialog.h>
|
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/gbsizer.h>
|
|
|
|
#include <wx/listbox.h>
|
2010-05-05 04:31:21 +00:00
|
|
|
#include <wx/spinctrl.h>
|
2010-05-01 19:10:35 +00:00
|
|
|
|
|
|
|
#include "GameListCtrl.h"
|
|
|
|
|
2010-11-16 01:55:29 +00:00
|
|
|
#include "FifoQueue.h"
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2013-08-05 09:05:06 +00:00
|
|
|
#include "NetPlayClient.h"
|
2011-02-08 15:36:15 +00:00
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
NP_GUI_EVT_CHANGE_GAME = 45,
|
|
|
|
NP_GUI_EVT_START_GAME,
|
|
|
|
NP_GUI_EVT_STOP_GAME,
|
|
|
|
};
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
class NetPlaySetupDiag : public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
2010-05-02 23:01:50 +00:00
|
|
|
NetPlaySetupDiag(wxWindow* const parent, const CGameListCtrl* const game_list);
|
2010-06-06 03:52:11 +00:00
|
|
|
~NetPlaySetupDiag();
|
2010-05-01 19:10:35 +00:00
|
|
|
private:
|
|
|
|
void OnJoin(wxCommandEvent& event);
|
|
|
|
void OnHost(wxCommandEvent& event);
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2013-07-22 08:21:56 +00:00
|
|
|
void MakeNetPlayDiag(int port, const std::string &game, bool is_hosting);
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
wxTextCtrl *m_nickname_text,
|
|
|
|
*m_host_port_text,
|
|
|
|
*m_connect_port_text,
|
|
|
|
*m_connect_ip_text;
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
wxListBox* m_game_lbox;
|
2013-07-09 00:13:02 +00:00
|
|
|
#ifdef USE_UPNP
|
|
|
|
wxCheckBox* m_upnp_chk;
|
|
|
|
#endif
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
const CGameListCtrl* const m_game_list;
|
2009-07-06 02:10:26 +00:00
|
|
|
};
|
|
|
|
|
2011-02-08 15:36:15 +00:00
|
|
|
class NetPlayDiag : public wxFrame, public NetPlayUI
|
2009-07-06 02:10:26 +00:00
|
|
|
{
|
2010-05-01 19:10:35 +00:00
|
|
|
public:
|
2010-05-02 23:01:50 +00:00
|
|
|
NetPlayDiag(wxWindow* const parent, const CGameListCtrl* const game_list
|
2010-05-01 19:10:35 +00:00
|
|
|
, const std::string& game, const bool is_hosting = false);
|
|
|
|
~NetPlayDiag();
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2010-11-16 01:55:29 +00:00
|
|
|
Common::FifoQueue<std::string> chat_msgs;
|
2010-05-01 19:10:35 +00:00
|
|
|
|
|
|
|
void OnStart(wxCommandEvent& event);
|
|
|
|
|
2011-02-08 15:36:15 +00:00
|
|
|
// implementation of NetPlayUI methods
|
|
|
|
void BootGame(const std::string& filename);
|
|
|
|
void StopGame();
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
void AppendChat(const std::string& msg);
|
|
|
|
|
|
|
|
void OnMsgChangeGame(const std::string& filename);
|
|
|
|
void OnMsgStartGame();
|
|
|
|
void OnMsgStopGame();
|
|
|
|
|
2011-02-27 02:27:43 +00:00
|
|
|
static NetPlayDiag *&GetInstance() { return npd; };
|
|
|
|
|
2013-09-03 19:50:41 +00:00
|
|
|
bool IsRecording();
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
void OnChat(wxCommandEvent& event);
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
void OnThread(wxCommandEvent& event);
|
2010-05-02 23:01:50 +00:00
|
|
|
void OnChangeGame(wxCommandEvent& event);
|
2010-05-05 04:31:21 +00:00
|
|
|
void OnAdjustBuffer(wxCommandEvent& event);
|
2010-06-06 03:52:11 +00:00
|
|
|
void OnConfigPads(wxCommandEvent& event);
|
2013-07-22 08:21:56 +00:00
|
|
|
void GetNetSettings(NetSettings &settings);
|
2013-08-13 18:47:32 +00:00
|
|
|
std::string FindGame();
|
2010-05-01 19:10:35 +00:00
|
|
|
|
|
|
|
wxListBox* m_player_lbox;
|
|
|
|
wxTextCtrl* m_chat_text;
|
|
|
|
wxTextCtrl* m_chat_msg_text;
|
2013-04-07 16:18:07 +00:00
|
|
|
wxCheckBox* m_memcard_write;
|
2013-09-03 19:50:41 +00:00
|
|
|
wxCheckBox* m_record_chkbox;
|
2010-05-01 19:10:35 +00:00
|
|
|
|
|
|
|
std::string m_selected_game;
|
|
|
|
wxButton* m_game_btn;
|
2013-08-14 22:14:29 +00:00
|
|
|
wxButton* m_start_btn;
|
2010-05-01 19:10:35 +00:00
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
std::vector<int> m_playerids;
|
|
|
|
|
2010-05-01 19:10:35 +00:00
|
|
|
const CGameListCtrl* const m_game_list;
|
2011-02-27 02:27:43 +00:00
|
|
|
|
|
|
|
static NetPlayDiag* npd;
|
2009-07-06 02:10:26 +00:00
|
|
|
};
|
|
|
|
|
2010-05-02 23:01:50 +00:00
|
|
|
class ChangeGameDiag : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ChangeGameDiag(wxWindow* const parent, const CGameListCtrl* const game_list, wxString& game_name);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void OnPick(wxCommandEvent& event);
|
|
|
|
|
|
|
|
wxListBox* m_game_lbox;
|
|
|
|
wxString& m_game_name;
|
|
|
|
};
|
|
|
|
|
2010-06-06 03:52:11 +00:00
|
|
|
class PadMapDiag : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2013-09-22 18:27:52 +00:00
|
|
|
PadMapDiag(wxWindow* const parent, PadMapping map[], PadMapping wiimotemap[], std::vector<const Player *>& player_list);
|
2010-06-06 03:52:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void OnAdjust(wxCommandEvent& event);
|
|
|
|
|
2013-08-07 03:48:52 +00:00
|
|
|
wxChoice* m_map_cbox[8];
|
2013-08-18 13:43:01 +00:00
|
|
|
PadMapping* const m_mapping;
|
2013-09-22 18:27:52 +00:00
|
|
|
PadMapping* const m_wiimapping;
|
2013-08-18 13:43:01 +00:00
|
|
|
std::vector<const Player *>& m_player_list;
|
2010-06-06 03:52:11 +00:00
|
|
|
};
|
|
|
|
|
2013-08-14 21:50:21 +00:00
|
|
|
namespace NetPlay
|
|
|
|
{
|
|
|
|
void StopGame();
|
|
|
|
}
|
|
|
|
|
2009-07-06 02:10:26 +00:00
|
|
|
#endif // _NETWINDOW_H_
|
|
|
|
|