Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "Sources/AudioSource_File.h"
#include "Sources/AudioSource_Device.h"
#include "AudioOption.h"
#include "AudioPipelineOptions.h"
#include "CommonFramework/GlobalSettingsPanel.h"

//#include <iostream>
//using std::cout;
Expand Down Expand Up @@ -55,6 +57,7 @@ std::string AudioOption::audioDisplayTypeToString(AudioOption::AudioDisplayType

AudioOption::AudioOption()
: m_input_source(new AudioSourceDescriptor_Null())
, m_display_type(GlobalSettings::instance().AUDIO_PIPELINE->DEFAULT_DISPLAY)
{}

void AudioOption::set_input(std::shared_ptr<AudioSourceDescriptor> descriptor){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AudioOption{

AudioInputChoice m_input_choice;
AudioDeviceInfo m_output_device;
AudioDisplayType m_display_type = AudioDisplayType::FREQ_BARS;
AudioDisplayType m_display_type; // the global default until load_json() sets one
double m_volume = 1.0; // Volume Range: [0, 1.0]
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
#include "Common/Cpp/Options/SimpleIntegerOption.h"
#include "Common/Cpp/Options/FloatingPointOption.h"
#include "Common/Cpp/Options/EnumDropdownOption.h"
#include "CommonFramework/AudioPipeline/AudioOption.h"
#include "CommonFramework/StaticGlobals.h"

namespace PokemonAutomation{
Expand All @@ -18,7 +20,7 @@

class AudioPipelineOptions : public GroupOption{
public:
AudioPipelineOptions()

Check failure on line 23 in SerialPrograms/Source/CommonFramework/AudioPipeline/AudioPipelineOptions.h

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::AudioPipelineOptions::AudioPipelineOptions(): function_lines=60, limit=50, allowed 50
: GroupOption(
"Audio Pipeline",
LockMode::LOCK_WHILE_RUNNING,
Expand All @@ -26,6 +28,17 @@
true,
false
)
, DEFAULT_DISPLAY(
"<b>Default Audio Display:</b><br>"
"What a program's console shows for its audio until you pick a display in that console's settings.",
{
{AudioOption::AudioDisplayType::NO_DISPLAY, "none", "No Display"},
{AudioOption::AudioDisplayType::FREQ_BARS, "freq-bars", "Frequency Bars"},
{AudioOption::AudioDisplayType::SPECTROGRAM, "spectrogram", "Spectrogram"},
},
LockMode::UNLOCK_WHILE_RUNNING,
AudioOption::AudioDisplayType::FREQ_BARS
)
, FILE_VOLUME_SCALE(
"<b>Audio File Input Volume Scale:</b><br>"
"Multiply audio file playback by this factor. (This is linear scale. So each factor of 10 is 20dB.)",
Expand Down Expand Up @@ -58,6 +71,7 @@
5
)
{
PA_ADD_OPTION(DEFAULT_DISPLAY);
PA_ADD_OPTION(FILE_VOLUME_SCALE);
PA_ADD_OPTION(DEVICE_VOLUME_SCALE);
PA_ADD_OPTION(USE_KAISER_WINDOW);
Expand All @@ -68,6 +82,7 @@
}

public:
EnumDropdownOption<AudioOption::AudioDisplayType> DEFAULT_DISPLAY;
FloatingPointOption FILE_VOLUME_SCALE;
FloatingPointOption DEVICE_VOLUME_SCALE;
BooleanCheckBoxOption USE_KAISER_WINDOW;
Expand Down
7 changes: 7 additions & 0 deletions SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
ENABLE_LIFETIME_SANITIZER0.remove_listener(*this);
OPEN_BASE_FOLDER_BUTTON.remove_listener(static_cast<ButtonListener&>(*this));
}
GlobalSettings::GlobalSettings()

Check failure on line 54 in SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::GlobalSettings::GlobalSettings(): function_lines=209, limit=50, allowed 202
: BatchOption(LockMode::LOCK_WHILE_RUNNING)
, CHECK_FOR_UPDATES(CONSTRUCT_TOKEN)
, OPEN_BASE_FOLDER_BUTTON(
Expand Down Expand Up @@ -118,6 +118,12 @@
LockMode::UNLOCK_WHILE_RUNNING,
false
)
, CONSOLE_SETTINGS_COLLAPSED(
"<b>Start with console settings collapsed:</b><br>"
"Each program's \"Console N Settings\" box starts folded up. Click its title to open it.",
LockMode::UNLOCK_WHILE_RUNNING,
false
)
, KEYBOARD_CONTROLS_LAYOUT(
CONSTRUCT_TOKEN,
"<b>System Keyboard Layout:</b><br>"
Expand Down Expand Up @@ -203,6 +209,7 @@
PA_ADD_OPTION(WINDOW_SIZE);
PA_ADD_OPTION(LOG_WINDOW_SIZE);
PA_ADD_OPTION(LOG_WINDOW_STARTUP);
PA_ADD_OPTION(CONSOLE_SETTINGS_COLLAPSED);

PA_ADD_OPTION(KEYBOARD_CONTROLS_LAYOUT);
PA_ADD_OPTION(STREAM_HISTORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class GlobalSettings : public BatchOption, private ConfigOption::Listener, priva
Pimpl<ResolutionOption> WINDOW_SIZE;
Pimpl<ResolutionOption> LOG_WINDOW_SIZE;
BooleanCheckBoxOption LOG_WINDOW_STARTUP;
BooleanCheckBoxOption CONSOLE_SETTINGS_COLLAPSED;

Pimpl<KeyboardLayoutOption> KEYBOARD_CONTROLS_LAYOUT;

Expand Down
6 changes: 5 additions & 1 deletion SerialPrograms/Source/GameConsole/UI/ConsoleSystemWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <QVBoxLayout>
#include "CommandRowWidget.h"
#include "ConsoleSystemWidget.h"
#include "CommonFramework/GlobalSettingsPanel.h"

namespace PokemonAutomation{

Expand All @@ -24,7 +25,7 @@
delete m_video_display;
}

ConsoleSystemWidget::ConsoleSystemWidget(

Check failure on line 28 in SerialPrograms/Source/GameConsole/UI/ConsoleSystemWidget.cpp

View workflow job for this annotation

GitHub Actions / code-health

Code health

PokemonAutomation::GameConsole::ConsoleSystemWidget::ConsoleSystemWidget( QWidget & parent , ConsoleSystemSession & session): function_lines=62, limit=50, allowed 59
QWidget& parent,
ConsoleSystemSession& session
)
Expand All @@ -37,7 +38,10 @@
layout->setContentsMargins(0, 0, 0, 0);
layout->setAlignment(Qt::AlignTop);

m_group_box = new CollapsibleGroupBox(*this, "Console " + QString::number(m_session.console_number()) + " Settings");
m_group_box = new CollapsibleGroupBox(
*this, "Console " + QString::number(m_session.console_number()) + " Settings",
!GlobalSettings::instance().CONSOLE_SETTINGS_COLLAPSED
);
layout->addWidget(m_group_box);

{
Expand Down
Loading