Пример #1
0
ControllerEmu::ControlGroup* GetGroup(int pad_num, PadGroup group)
{
  return static_cast<GCPad*>(s_config.GetController(pad_num))->GetGroup(group);
}
Пример #2
0
KeyboardStatus GetStatus(int port)
{
	return static_cast<GCKeyboard*>(s_config.GetController(port))->GetInput();
}
Пример #3
0
GCPadStatus GetStatus(int pad_num)
{
  return static_cast<GCPad*>(s_config.GetController(pad_num))->GetInput();
}
Пример #4
0
bool GetMicButton(const u8 pad_num)
{
	return static_cast<GCPad*>(s_config.GetController(pad_num))->GetMicButton();
}
Пример #5
0
ControllerEmu::ControlGroup* GetGroup(int port, KeyboardGroup group)
{
	return static_cast<GCKeyboard*>(s_config.GetController(port))->GetGroup(group);
}
Пример #6
0
void Rumble(const u8 pad_num, const ControlState strength)
{
	static_cast<GCPad*>(s_config.GetController(pad_num))->SetOutput(strength);
}
Пример #7
0
GamepadPage::GamepadPage(wxWindow* parent, InputConfig& config, const int pad_num,
                         InputConfigDialog* const config_dialog)
    : wxPanel(parent, wxID_ANY), controller(config.GetController(pad_num)),
      m_config_dialog(config_dialog), m_config(config)
{
  wxBoxSizer* control_group_sizer = new ControlGroupsSizer(controller, this, this, &control_groups);

  wxStaticBoxSizer* profile_sbox = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Profile"));

  // device chooser

  wxStaticBoxSizer* const device_sbox = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Device"));

  device_cbox = new wxComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(64, -1));
  device_cbox->ToggleWindowStyle(wxTE_PROCESS_ENTER);

  wxButton* refresh_button =
      new wxButton(this, wxID_ANY, _("Refresh"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);

  device_cbox->Bind(wxEVT_COMBOBOX, &GamepadPage::SetDevice, this);
  device_cbox->Bind(wxEVT_TEXT_ENTER, &GamepadPage::SetDevice, this);
  refresh_button->Bind(wxEVT_BUTTON, &GamepadPage::RefreshDevices, this);

  device_sbox->Add(device_cbox, 1, wxLEFT | wxRIGHT, 3);
  device_sbox->Add(refresh_button, 0, wxRIGHT | wxBOTTOM, 3);

  wxButton* const default_button =
      new wxButton(this, wxID_ANY, _("Default"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
  wxButton* const clearall_button =
      new wxButton(this, wxID_ANY, _("Clear"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);

  wxStaticBoxSizer* const clear_sbox = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Reset"));
  clear_sbox->Add(default_button, 1, wxLEFT, 3);
  clear_sbox->Add(clearall_button, 1, wxRIGHT, 3);

  clearall_button->Bind(wxEVT_BUTTON, &GamepadPage::ClearAll, this);
  default_button->Bind(wxEVT_BUTTON, &GamepadPage::LoadDefaults, this);

  profile_cbox = new wxComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(64, -1));

  wxButton* const pload_btn =
      new wxButton(this, wxID_ANY, _("Load"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
  wxButton* const psave_btn =
      new wxButton(this, wxID_ANY, _("Save"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
  wxButton* const pdelete_btn =
      new wxButton(this, wxID_ANY, _("Delete"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);

  pload_btn->Bind(wxEVT_BUTTON, &GamepadPage::LoadProfile, this);
  psave_btn->Bind(wxEVT_BUTTON, &GamepadPage::SaveProfile, this);
  pdelete_btn->Bind(wxEVT_BUTTON, &GamepadPage::DeleteProfile, this);

  profile_sbox->Add(profile_cbox, 1, wxLEFT, 3);
  profile_sbox->Add(pload_btn, 0, wxLEFT, 3);
  profile_sbox->Add(psave_btn, 0, 0, 3);
  profile_sbox->Add(pdelete_btn, 0, wxRIGHT | wxBOTTOM, 3);

  wxBoxSizer* const dio = new wxBoxSizer(wxHORIZONTAL);
  dio->Add(device_sbox, 1, wxEXPAND | wxRIGHT, 5);
  dio->Add(clear_sbox, 0, wxEXPAND | wxRIGHT, 5);
  dio->Add(profile_sbox, 1, wxEXPAND | wxRIGHT, 5);

  wxBoxSizer* const mapping = new wxBoxSizer(wxVERTICAL);

  mapping->Add(dio, 1, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, 5);
  mapping->Add(control_group_sizer, 0, wxLEFT | wxEXPAND, 5);

  UpdateGUI();

  SetSizerAndFit(mapping);  // needed
  Layout();
};
Пример #8
0
ControllerEmu::ControlGroup* GetTurntableGroup(int number, WiimoteEmu::TurntableGroup group)
{
  return static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
      ->GetTurntableGroup(group);
}
Пример #9
0
// Save/Load state
void DoState(PointerWrap& p)
{
  for (int i = 0; i < MAX_BBMOTES; ++i)
    static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(i))->DoState(p);
}
Пример #10
0
void ResetAllWiimotes()
{
  for (int i = WIIMOTE_CHAN_0; i < MAX_BBMOTES; ++i)
    static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(i))->Reset();
}