Skip to content

Commit

Permalink
organize gui
Browse files Browse the repository at this point in the history
  • Loading branch information
Plutoberth committed May 21, 2022
1 parent 190faf3 commit aa46a27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Client/CrossPlatformGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ bool CrossPlatformGUI::performGUIPass()
{
ImGui::Spacing();
this->_drawASMControls();
this->_drawSurroundControls();
this->_setHeadphoneSettings();
}
}

Expand Down Expand Up @@ -156,11 +158,6 @@ void CrossPlatformGUI::_drawASMControls()
static bool ambientSoundControl = true;
static bool focusOnVoice = false;
static int asmLevel = 0;
static int soundPosition = 0;
static int vptType = 0;

//Don't show if the command only takes a few frames to send
static int commandLinger = 0;

if (ImGui::CollapsingHeader("Ambient Sound Mode ", ImGuiTreeNodeFlags_DefaultOpen))
{
Expand All @@ -186,6 +183,12 @@ void CrossPlatformGUI::_drawASMControls()
this->_headphones.setAsmLevel(asmLevel);
this->_headphones.setFocusOnVoice(focusOnVoice);
}
}

void CrossPlatformGUI::_drawSurroundControls()
{
static int soundPosition = 0;
static int vptType = 0;

if (ImGui::CollapsingHeader("Virtual Sound", ImGuiTreeNodeFlags_DefaultOpen))
{
Expand All @@ -196,7 +199,7 @@ void CrossPlatformGUI::_drawASMControls()
{
vptType = 0;
}

if (ImGui::Combo("Surround (VPT)", &vptType, "Off\0Outdoor Festival\0Arena\0"
"Concert Hall\0Club\0\0"))
{
Expand All @@ -206,6 +209,11 @@ void CrossPlatformGUI::_drawASMControls()
this->_headphones.setSurroundPosition(SOUND_POSITION_PRESET_ARRAY[soundPosition]);
this->_headphones.setVptType(vptType);
}
}

void CrossPlatformGUI::_setHeadphoneSettings() {
//Don't show if the command only takes a few frames to send
static int commandLinger = 0;

if (this->_sendCommandFuture.ready())
{
Expand Down
2 changes: 2 additions & 0 deletions Client/CrossPlatformGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class CrossPlatformGUI
void _drawErrors();
void _drawDeviceDiscovery();
void _drawASMControls();
void _drawSurroundControls();
void _setHeadphoneSettings();

BluetoothDevice _connectedDevice;
BluetoothWrapper _bt;
Expand Down

0 comments on commit aa46a27

Please sign in to comment.