Add setting to cycle between ratios
Some checks failed
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux32 flags:32 name:Linux GCC 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linux64 flags:64 name:Linux GCC x64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm32 flags:arm32 name:Linux GCC ARM 32 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:linuxarm64 flags:arm64 name:Linux GCC ARM 64 os:ubuntu-latest]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:macos name:macOS Apple Silicon os:macos-14]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win32 flags:-A Win32 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 Win32 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:win64 flags:-A x64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 x64 os:windows-2022]) (push) Has been cancelled
CD / ${{ matrix.platform.name }} ${{ matrix.config.name }} (map[flags:-DBUILD_SHARED_LIBS=FALSE name:Static], map[artifact_name:winarm64 flags:-A ARM64 -DCMAKE_PARALLEL_MSVC=TRUE name:Windows VS2022 ARM os:windows-2022]) (push) Has been cancelled
CD / Create Pi Mono Setup (push) Has been cancelled
CD / Publishing (push) Has been cancelled

This commit is contained in:
Lorenzooone 2026-04-02 00:26:19 +02:00
parent a9d5902f95
commit 4583c9f5bb
7 changed files with 31 additions and 4 deletions

View File

@ -18,13 +18,14 @@ enum ScalingRatioMenuOutAction{
SCALING_RATIO_MENU_ALGO_INC,
SCALING_RATIO_MENU_ALGO_DEC,
SCALING_RATIO_MENU_FORCE_SAME_SCALING,
SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING,
};
class ScalingRatioMenu : public OptionSelectionMenu {
public:
ScalingRatioMenu(TextRectanglePool* text_pool);
~ScalingRatioMenu();
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info);
void prepare(float scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, bool do_ratio_cycling);
void insert_data();
ScalingRatioMenuOutAction selected_index = ScalingRatioMenuOutAction::SCALING_RATIO_MENU_NO_ACTION;
void reset_output_option();

View File

@ -91,6 +91,7 @@ struct DisplayData {
bool last_connected_ds;
bool interleaved_3d;
bool force_disable_mouse;
bool do_ratio_cycling;
};
struct ExtraButtonShortcuts {

View File

@ -339,6 +339,7 @@ private:
void second_screen_3d_match_bottom_pos_change();
void devices_allowed_change(PossibleCaptureDevices device);
void input_video_data_format_request_change(bool positive);
void change_ratio_cycle();
bool add_new_cc_key(std::string key, CaptureConnectionType conn_type, bool discriminator);
bool query_reset_request();
void reset_held_times(bool force = true);

View File

@ -38,11 +38,17 @@ static const ScalingRatioMenuOptionInfo force_same_scaling_option = {
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = SCALING_RATIO_MENU_NO_ACTION,
.out_action = SCALING_RATIO_MENU_FORCE_SAME_SCALING};
static const ScalingRatioMenuOptionInfo ratio_cycle_option = {
.base_name = "Disable Ratios Cycle", .false_name = "Enable Ratios Cycle",
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = SCALING_RATIO_MENU_NO_ACTION,
.out_action = SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING};
static const ScalingRatioMenuOptionInfo* pollable_options[] = {
&ratio_option,
&top_fill_option,
&bot_fill_option,
&ratio_algo_option,
&ratio_cycle_option,
&force_same_scaling_option,
};
@ -126,7 +132,7 @@ std::string ScalingRatioMenu::setTextOptionDualPercentage(int index, float value
return this->get_string_option(index, DEFAULT_ACTION) + ": " + get_float_str_decimals(value_1, 1) + " - " + get_float_str_decimals(value_2, 1);
}
void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info) {
void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, ScreenInfo *info, bool do_ratio_cycling) {
int num_pages = this->get_num_pages();
if(this->future_data.page >= num_pages)
this->future_data.page = num_pages - 1;
@ -153,6 +159,9 @@ void ScalingRatioMenu::prepare(float menu_scaling_factor, int view_size_x, int v
case SCALING_RATIO_MENU_FORCE_SAME_SCALING:
this->labels[index]->setText(this->setTextOptionBool(real_index, info->force_same_scaling));
break;
case SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING:
this->labels[index]->setText(this->setTextOptionBool(real_index, do_ratio_cycling));
break;
default:
break;
}

View File

@ -466,8 +466,13 @@ void WindowScreen::force_same_scaling_change() {
this->future_operations.call_screen_settings_update = true;
}
void WindowScreen::change_ratio_cycle() {
this->display_data->do_ratio_cycling = !this->display_data->do_ratio_cycling;
this->print_notification_on_off("Ratio Cycling", this->display_data->do_ratio_cycling);
}
void WindowScreen::ratio_change(bool top_priority, bool cycle) {
this->prepare_size_ratios(top_priority, !top_priority, cycle);
this->prepare_size_ratios(top_priority, !top_priority, cycle || this->display_data->do_ratio_cycling);
this->future_operations.call_screen_settings_update = true;
}
@ -2152,6 +2157,9 @@ void WindowScreen::poll(bool do_everything) {
case SCALING_RATIO_MENU_FORCE_SAME_SCALING:
this->force_same_scaling_change();
break;
case SCALING_RATIO_MENU_CHANGE_RATIO_CYCLING:
this->change_ratio_cycle();
break;
default:
break;
}
@ -2773,7 +2781,7 @@ void WindowScreen::prepare_menu_draws(int view_size_x, int view_size_y) {
this->license_menu->prepare(menu_scaling_factor, view_size_x, view_size_y);
break;
case SCALING_RATIO_MENU_TYPE:
this->scaling_ratio_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info);
this->scaling_ratio_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info, this->display_data->do_ratio_cycling);
break;
case ISN_MENU_TYPE:
this->is_nitro_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, this->capture_status);

View File

@ -185,6 +185,11 @@ static bool load(const std::string path, const std::string name, ScreenInfo &top
continue;
}
if(key == "do_ratio_cycling") {
display_data.do_ratio_cycling = std::stoi(value);
continue;
}
if(key == "request_low_bw_format") {
capture_status->request_low_bw_format = std::stoi(value);
continue;
@ -361,6 +366,7 @@ static bool save(const std::string path, const std::string name, const std::stri
file << save_screen_info("top_", top_info);
file << "requested_3d=" << capture_status->requested_3d << std::endl;
file << "interleaved_3d=" << display_data.interleaved_3d << std::endl;
file << "do_ratio_cycling=" << display_data.do_ratio_cycling << std::endl;
file << "request_low_bw_format=" << capture_status->request_low_bw_format << std::endl;
file << "last_connected_ds=" << display_data.last_connected_ds << std::endl;
file << "is_screen_capture_type=" << capture_status->capture_type << std::endl;

View File

@ -526,6 +526,7 @@ void insert_basic_color_profiles(std::vector<const ShaderColorEmulationData*> &c
void reset_display_data(DisplayData* display_data) {
display_data->last_connected_ds = false;
display_data->interleaved_3d = false;
display_data->do_ratio_cycling = false;
}
void reset_input_data(InputData* input_data) {