summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Input/TurntableInputConfigDiag.cpp
blob: bc5b627d6caab322666162703995ae5391ad509f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include "DolphinWX/Input/TurntableInputConfigDiag.h"

#include "Core/HW/Wiimote.h"
#include "Core/HW/WiimoteEmu/WiimoteEmu.h"

TurntableInputConfigDialog::TurntableInputConfigDialog(wxWindow* const parent, InputConfig& config,
                                                       const wxString& name, const int port_num)
    : InputConfigDialog(parent, config, name, port_num)
{
  const int space5 = FromDIP(5);

  auto* const group_box_stick = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::Stick), this, this);
  auto* const group_box_effect_dial = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::EffectDial), this, this);

  auto* const stick_effect_sizer = new wxBoxSizer(wxVERTICAL);
  stick_effect_sizer->Add(group_box_stick, 0, wxEXPAND);
  stick_effect_sizer->AddSpacer(space5);
  stick_effect_sizer->Add(group_box_effect_dial, 0, wxEXPAND);

  auto* const group_box_left_table = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::LeftTable), this, this);
  auto* const group_box_right_table = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::RightTable), this, this);
  auto* const group_box_crossfade = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::Crossfade), this, this);

  auto* const tables_crossfade_sizer = new wxBoxSizer(wxVERTICAL);
  tables_crossfade_sizer->Add(group_box_right_table, 0, wxEXPAND);
  tables_crossfade_sizer->AddSpacer(space5);
  tables_crossfade_sizer->Add(group_box_left_table, 0, wxEXPAND);
  tables_crossfade_sizer->AddSpacer(space5);
  tables_crossfade_sizer->Add(group_box_crossfade, 0, wxEXPAND);

  auto* const group_box_buttons = new ControlGroupBox(
      Wiimote::GetTurntableGroup(port_num, WiimoteEmu::TurntableGroup::Buttons), this, this);

  auto* const controls_sizer = new wxBoxSizer(wxHORIZONTAL);
  controls_sizer->AddSpacer(space5);
  controls_sizer->Add(group_box_buttons, 0, wxEXPAND);
  controls_sizer->AddSpacer(space5);
  controls_sizer->Add(stick_effect_sizer, 0, wxEXPAND);
  controls_sizer->AddSpacer(space5);
  controls_sizer->Add(tables_crossfade_sizer, 0, wxEXPAND);
  controls_sizer->AddSpacer(space5);

  auto* const szr_main = new wxBoxSizer(wxVERTICAL);
  szr_main->AddSpacer(space5);
  szr_main->Add(controls_sizer, 1, wxEXPAND | wxLEFT | wxRIGHT, space5);
  szr_main->AddSpacer(space5);
  szr_main->Add(CreateButtonSizer(wxCLOSE | wxNO_DEFAULT), 0, wxEXPAND | wxLEFT | wxRIGHT, space5);
  szr_main->AddSpacer(space5);

  SetSizerAndFit(szr_main);
  Center();
  UpdateGUI();
}