mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2025-06-18 08:35:33 -04:00
Add video data type Menu and USB Conflict Resolution Menu
This commit is contained in:
parent
4189884ded
commit
4787215de3
@ -561,7 +561,7 @@ else()
|
||||
set_source_files_properties(source/conversions.cpp PROPERTIES COMPILE_OPTIONS "$<$<CONFIG:Release>:-O3;-funroll-loops>")
|
||||
endif()
|
||||
|
||||
set(EXECUTABLE_SOURCE_FILES source/cc3dsfs.cpp source/utils.cpp source/audio_data.cpp source/audio.cpp source/frontend.cpp source/TextRectangle.cpp source/TextRectanglePool.cpp source/WindowScreen.cpp source/WindowScreen_Menu.cpp source/devicecapture.cpp source/conversions.cpp source/ExtraButtons.cpp source/Menus/ConnectionMenu.cpp source/Menus/OptionSelectionMenu.cpp source/Menus/MainMenu.cpp source/Menus/VideoMenu.cpp source/Menus/CropMenu.cpp source/Menus/PARMenu.cpp source/Menus/RotationMenu.cpp source/Menus/OffsetMenu.cpp source/Menus/AudioMenu.cpp source/Menus/BFIMenu.cpp source/Menus/RelativePositionMenu.cpp source/Menus/ResolutionMenu.cpp source/Menus/FileConfigMenu.cpp source/Menus/ExtraSettingsMenu.cpp source/Menus/StatusMenu.cpp source/Menus/LicenseMenu.cpp source/WindowCommands.cpp source/Menus/ShortcutMenu.cpp source/Menus/ActionSelectionMenu.cpp source/Menus/ScalingRatioMenu.cpp source/Menus/ISNitroMenu.cpp source/Menus/VideoEffectsMenu.cpp source/CaptureDataBuffers.cpp source/Menus/InputMenu.cpp source/Menus/AudioDeviceMenu.cpp source/Menus/SeparatorMenu.cpp source/Menus/ColorCorrectionMenu.cpp source/Menus/Main3DMenu.cpp source/Menus/SecondScreen3DRelativePositionMenu.cpp ${TOOLS_DATA_DIR}/font_ttf.cpp ${TOOLS_DATA_DIR}/shaders_list.cpp ${SOURCE_CPP_EXTRA_FILES})
|
||||
set(EXECUTABLE_SOURCE_FILES source/cc3dsfs.cpp source/utils.cpp source/audio_data.cpp source/audio.cpp source/frontend.cpp source/TextRectangle.cpp source/TextRectanglePool.cpp source/WindowScreen.cpp source/WindowScreen_Menu.cpp source/devicecapture.cpp source/conversions.cpp source/ExtraButtons.cpp source/Menus/ConnectionMenu.cpp source/Menus/OptionSelectionMenu.cpp source/Menus/MainMenu.cpp source/Menus/VideoMenu.cpp source/Menus/CropMenu.cpp source/Menus/PARMenu.cpp source/Menus/RotationMenu.cpp source/Menus/OffsetMenu.cpp source/Menus/AudioMenu.cpp source/Menus/BFIMenu.cpp source/Menus/RelativePositionMenu.cpp source/Menus/ResolutionMenu.cpp source/Menus/FileConfigMenu.cpp source/Menus/ExtraSettingsMenu.cpp source/Menus/StatusMenu.cpp source/Menus/LicenseMenu.cpp source/WindowCommands.cpp source/Menus/ShortcutMenu.cpp source/Menus/ActionSelectionMenu.cpp source/Menus/ScalingRatioMenu.cpp source/Menus/ISNitroMenu.cpp source/Menus/VideoEffectsMenu.cpp source/CaptureDataBuffers.cpp source/Menus/InputMenu.cpp source/Menus/AudioDeviceMenu.cpp source/Menus/SeparatorMenu.cpp source/Menus/ColorCorrectionMenu.cpp source/Menus/Main3DMenu.cpp source/Menus/SecondScreen3DRelativePositionMenu.cpp source/Menus/USBConflictResolutionMenu.cpp source/Menus/Optimize3DSMenu.cpp ${TOOLS_DATA_DIR}/font_ttf.cpp ${TOOLS_DATA_DIR}/shaders_list.cpp ${SOURCE_CPP_EXTRA_FILES})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
|
||||
if(MSVC)
|
||||
|
@ -150,3 +150,4 @@ On Windows, the profiles can be found in the ".config/cc3dsfs" folder inside the
|
||||
- Certain TVs/Monitors may add some audio delay for the purpose of video/lip syncing. If you're experiencing too much audio delay when using this software, try checking in the TV/Monitor settings whether you can reduce that added delay. One of the names used for that setting is "Lip Sync", or something along that line.
|
||||
- When using IS Nitro Emulator, IS Nitro Capture or IS TWL Capture devices on Windows, cc3dsfs is compatible with both the official driver and WinUSB, with the latter being useful if you don't have access to the official driver. To install and use WinUSB, plug in your device, download a software to install drivers like [Zadig](https://zadig.akeo.ie/), select the device in question and select WinUSB. Then install the driver and wait for it to finish. The devices should now work properly with this application.
|
||||
- When using the new 2024 Loopy DS Capture Card on Windows, the default driver (FTD2XX) adds one extra frame of latency. To remove that, consider switching to WinUSB as the driver. To change driver, download a software to install drivers like [Zadig](https://zadig.akeo.ie/), select the device in question and select WinUSB. Then install the driver and wait for it to finish. The application will now use WinUSB, with better latency (the serial shown in the Status menu will have an l where there previously was a d).
|
||||
- There are multiple capture cards which use the same EZ-USB FX2LP board, creating a conflict. This means that when the user connects a device which uses the EZ-USB FX2LP board, they need to select one capture card among the possible ones. To avoid this extra step, the user can disable scanning for the conflicting capture cards they do not intend to use. The settings to do this are available under Extra Settings -> USB Conflict Resolution.
|
||||
|
@ -14,6 +14,9 @@ uint64_t cyop_device_get_video_in_size(CaptureStatus* status, bool is_3d, InputV
|
||||
uint64_t cyop_device_get_video_in_size(CaptureData* capture_data, bool is_3d, InputVideoDataType video_data_type);
|
||||
void cyop_device_acquisition_main_loop(CaptureData* capture_data);
|
||||
void usb_cyop_device_acquisition_cleanup(CaptureData* capture_data);
|
||||
bool is_device_optimize_3ds(CaptureDevice* device);
|
||||
bool is_device_optimize_o3ds(CaptureDevice* device);
|
||||
bool is_device_optimize_n3ds(CaptureDevice* device);
|
||||
void usb_cyop_device_init();
|
||||
void usb_cyop_device_close();
|
||||
|
||||
|
@ -14,6 +14,7 @@ enum ExtraSettingsMenuOutAction{
|
||||
EXTRA_SETTINGS_MENU_QUIT_APPLICATION,
|
||||
EXTRA_SETTINGS_MENU_FULLSCREEN,
|
||||
EXTRA_SETTINGS_MENU_SPLIT,
|
||||
EXTRA_SETTINGS_MENU_USB_CONFLICT_RESOLUTION,
|
||||
};
|
||||
|
||||
class ExtraSettingsMenu : public OptionSelectionMenu {
|
||||
@ -21,7 +22,8 @@ public:
|
||||
ExtraSettingsMenu(TextRectanglePool* text_pool);
|
||||
~ExtraSettingsMenu();
|
||||
void prepare(float scaling_factor, int view_size_x, int view_size_y);
|
||||
void insert_data(ScreenType s_type, bool is_fullscreen);
|
||||
static int get_total_possible_selectable_inserted(ScreenType s_type, bool is_fullscreen, bool is_mono_app);
|
||||
void insert_data(ScreenType s_type, bool is_fullscreen, bool is_mono_app);
|
||||
ExtraSettingsMenuOutAction selected_index = ExtraSettingsMenuOutAction::EXTRA_SETTINGS_MENU_NO_ACTION;
|
||||
void reset_output_option();
|
||||
protected:
|
||||
|
@ -27,6 +27,7 @@ enum MainMenuOutAction{
|
||||
//MAIN_MENU_SHORTCUT_SETTINGS,
|
||||
MAIN_MENU_ISN_SETTINGS,
|
||||
MAIN_MENU_IST_SETTINGS,
|
||||
MAIN_MENU_OPTIMIZE_3DS_SETTINGS,
|
||||
MAIN_MENU_INPUT_SETTINGS,
|
||||
};
|
||||
|
||||
|
38
include/Menus/Optimize3DSMenu.hpp
Normal file
38
include/Menus/Optimize3DSMenu.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef __OPTIMIZE3DSMENU_HPP
|
||||
#define __OPTIMIZE3DSMENU_HPP
|
||||
|
||||
#include "OptionSelectionMenu.hpp"
|
||||
#include <chrono>
|
||||
|
||||
#include "TextRectangle.hpp"
|
||||
#include "sfml_gfx_structs.hpp"
|
||||
#include "display_structs.hpp"
|
||||
#include "capture_structs.hpp"
|
||||
|
||||
enum Optimize3DSMenuOutAction{
|
||||
OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
OPTIMIZE3DS_MENU_BACK,
|
||||
OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_INC,
|
||||
OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_DEC,
|
||||
};
|
||||
|
||||
class Optimize3DSMenu : public OptionSelectionMenu {
|
||||
public:
|
||||
Optimize3DSMenu(TextRectanglePool* text_pool);
|
||||
~Optimize3DSMenu();
|
||||
void prepare(float scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status);
|
||||
void insert_data(CaptureDevice* device);
|
||||
Optimize3DSMenuOutAction selected_index = Optimize3DSMenuOutAction::OPTIMIZE3DS_MENU_NO_ACTION;
|
||||
void reset_output_option();
|
||||
protected:
|
||||
bool is_option_selectable(int index, int action);
|
||||
bool is_option_inc_dec(int index);
|
||||
void set_output_option(int index, int action);
|
||||
size_t get_num_options();
|
||||
std::string get_string_option(int index, int action);
|
||||
void class_setup();
|
||||
private:
|
||||
int *options_indexes;
|
||||
size_t num_enabled_options;
|
||||
};
|
||||
#endif
|
39
include/Menus/USBConflictResolutionMenu.hpp
Normal file
39
include/Menus/USBConflictResolutionMenu.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef __USBCONRESOMENU_HPP
|
||||
#define __USBCONRESOMENU_HPP
|
||||
|
||||
#include "OptionSelectionMenu.hpp"
|
||||
#include <chrono>
|
||||
|
||||
#include "TextRectangle.hpp"
|
||||
#include "sfml_gfx_structs.hpp"
|
||||
#include "display_structs.hpp"
|
||||
#include "capture_structs.hpp"
|
||||
|
||||
enum USBConflictResolutionMenuOutAction{
|
||||
USBCONRESO_MENU_NO_ACTION,
|
||||
USBCONRESO_MENU_BACK,
|
||||
USBCONRESO_MENU_NISE_DS,
|
||||
USBCONRESO_MENU_OPTI_O3DS,
|
||||
};
|
||||
|
||||
class USBConflictResolutionMenu : public OptionSelectionMenu {
|
||||
public:
|
||||
USBConflictResolutionMenu(TextRectanglePool* text_pool);
|
||||
~USBConflictResolutionMenu();
|
||||
void prepare(float scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status);
|
||||
static int get_total_possible_selectable_inserted();
|
||||
void insert_data();
|
||||
USBConflictResolutionMenuOutAction selected_index = USBConflictResolutionMenuOutAction::USBCONRESO_MENU_NO_ACTION;
|
||||
void reset_output_option();
|
||||
protected:
|
||||
bool is_option_selectable(int index, int action);
|
||||
bool is_option_inc_dec(int index);
|
||||
void set_output_option(int index, int action);
|
||||
size_t get_num_options();
|
||||
std::string get_string_option(int index, int action);
|
||||
void class_setup();
|
||||
private:
|
||||
int *options_indexes;
|
||||
size_t num_enabled_options;
|
||||
};
|
||||
#endif
|
@ -331,7 +331,7 @@ struct CaptureStatus {
|
||||
CaptureSpeedsType capture_speed;
|
||||
int battery_percentage;
|
||||
bool ac_adapter_connected;
|
||||
// Needed for Nisetro DS(i) and Old Optimize 3DS
|
||||
// Needed for possible compatibility issues
|
||||
bool devices_allowed_scan[CC_POSSIBLE_DEVICES_END];
|
||||
ConsumerMutex video_wait;
|
||||
ConsumerMutex audio_wait;
|
||||
|
@ -26,7 +26,7 @@ enum ScreenType { TOP, BOTTOM, JOINT };
|
||||
enum BottomRelativePosition { UNDER_TOP, LEFT_TOP, ABOVE_TOP, RIGHT_TOP, BOT_REL_POS_END };
|
||||
enum SecondScreen3DRelativePosition { UNDER_FIRST, LEFT_FIRST, ABOVE_FIRST, RIGHT_FIRST, SECOND_SCREEN_3D_REL_POS_END };
|
||||
enum NonIntegerScalingModes { SMALLER_PRIORITY, INVERSE_PROPORTIONAL_PRIORITY, EQUAL_PRIORITY, PROPORTIONAL_PRIORITY, BIGGER_PRIORITY, END_NONINT_SCALE_MODES };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE, COLOR_CORRECTION_MENU_TYPE, MAIN_3D_MENU_TYPE, SECOND_SCREEN_RELATIVE_POS_MENU_TYPE };
|
||||
enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_MENU_TYPE, AUDIO_MENU_TYPE, CROP_MENU_TYPE, TOP_PAR_MENU_TYPE, BOTTOM_PAR_MENU_TYPE, ROTATION_MENU_TYPE, OFFSET_MENU_TYPE, BFI_MENU_TYPE, LOAD_MENU_TYPE, SAVE_MENU_TYPE, RESOLUTION_MENU_TYPE, EXTRA_MENU_TYPE, STATUS_MENU_TYPE, LICENSES_MENU_TYPE, RELATIVE_POS_MENU_TYPE, SHORTCUTS_MENU_TYPE, ACTION_SELECTION_MENU_TYPE, SCALING_RATIO_MENU_TYPE, ISN_MENU_TYPE, VIDEO_EFFECTS_MENU_TYPE, INPUT_MENU_TYPE, AUDIO_DEVICE_MENU_TYPE, SEPARATOR_MENU_TYPE, COLOR_CORRECTION_MENU_TYPE, MAIN_3D_MENU_TYPE, SECOND_SCREEN_RELATIVE_POS_MENU_TYPE, USB_CONFLICT_RESOLUTION_MENU_TYPE, OPTIMIZE_3DS_MENU_TYPE };
|
||||
enum InputColorspaceMode { FULL_COLORSPACE, DS_COLORSPACE, GBA_COLORSPACE, INPUT_COLORSPACE_END };
|
||||
enum FrameBlendingMode { NO_FRAME_BLENDING, FULL_FRAME_BLENDING, DS_3D_BOTH_SCREENS_FRAME_BLENDING, FRAME_BLENDING_END };
|
||||
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include "ColorCorrectionMenu.hpp"
|
||||
#include "Main3DMenu.hpp"
|
||||
#include "SecondScreen3DRelativePositionMenu.hpp"
|
||||
#include "USBConflictResolutionMenu.hpp"
|
||||
#include "Optimize3DSMenu.hpp"
|
||||
#include "display_structs.hpp"
|
||||
#include "event_structs.hpp"
|
||||
#include "shaders_list.hpp"
|
||||
@ -156,10 +158,12 @@ private:
|
||||
const float v_sync_timeout = 5.0f;
|
||||
const float bad_resolution_timeout = 30.0f;
|
||||
const float menu_change_timeout = 0.3f;
|
||||
|
||||
CurrMenuType curr_menu = DEFAULT_MENU_TYPE;
|
||||
GenericMenu* curr_menu_ptr = NULL;
|
||||
CurrMenuType loaded_menu;
|
||||
GenericMenu* loaded_menu_ptr;
|
||||
|
||||
ConnectionMenu *connection_menu;
|
||||
MainMenu *main_menu;
|
||||
VideoMenu *video_menu;
|
||||
@ -186,6 +190,9 @@ private:
|
||||
ColorCorrectionMenu *color_correction_menu;
|
||||
Main3DMenu *main_3d_menu;
|
||||
SecondScreen3DRelativePositionMenu *second_screen_3d_relpos_menu;
|
||||
USBConflictResolutionMenu *usb_conflict_resolution_menu;
|
||||
Optimize3DSMenu* optimize_3ds_menu;
|
||||
|
||||
std::vector<const CropData*> possible_crops;
|
||||
std::vector<const CropData*> possible_crops_ds;
|
||||
std::vector<const CropData*> possible_crops_with_games;
|
||||
@ -305,6 +312,8 @@ private:
|
||||
void color_correction_value_change(int new_color_correction_value);
|
||||
void second_screen_3d_pos_change(int new_second_screen_3d_pos);
|
||||
void second_screen_3d_match_bottom_pos_change();
|
||||
void devices_allowed_change(PossibleCaptureDevices device);
|
||||
void input_video_data_format_request_change(bool positive);
|
||||
bool query_reset_request();
|
||||
void reset_held_times(bool force = true);
|
||||
void poll_window(bool do_everything);
|
||||
@ -392,6 +401,8 @@ private:
|
||||
void setup_color_correction_menu(bool reset_data = true);
|
||||
void setup_main_3d_menu(bool reset_data = true);
|
||||
void setup_second_screen_3d_relpos_menu(bool reset_data = true);
|
||||
void setup_usb_conflict_resolution_menu(bool reset_data = true);
|
||||
void setup_optimize_3ds_menu(bool reset_data = true);
|
||||
void update_connection();
|
||||
};
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#define NISETRO_DS_WANTED_VALUE_BASE 0xFF00
|
||||
|
||||
static const cyni_device_usb_device cypress_fx2_generic_device = {
|
||||
.name = "NiseTro DS(i)", .long_name = "NiseTro DS(i)",
|
||||
.name = "FX2LP -> NiseTro DS", .long_name = "EZ-USB FX2LP ->NiseTro DS(i)",
|
||||
.device_type = CYPRESS_NISETRO_BLANK_DEVICE,
|
||||
.video_data_type = VIDEO_DATA_RGB,
|
||||
.firmware_to_load = nisetro_ds_fw, .firmware_size = nisetro_ds_fw_len,
|
||||
|
@ -225,6 +225,31 @@ uint64_t cyop_device_get_video_in_size(CaptureData* capture_data, bool is_3d, In
|
||||
return cyop_device_get_video_in_size(&capture_data->status, is_3d, video_data_type);
|
||||
}
|
||||
|
||||
bool is_device_optimize_3ds(CaptureDevice* device) {
|
||||
if(device == NULL)
|
||||
return false;
|
||||
if(device->cc_type != CAPTURE_CONN_CYPRESS_OPTIMIZE)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool does_device_match_type(CaptureDevice* device, cypress_optimize_device_type type_searched_for) {
|
||||
if(!is_device_optimize_3ds(device))
|
||||
return false;
|
||||
const cyop_device_usb_device* usb_device_info = (const cyop_device_usb_device*)device->descriptor;
|
||||
if(usb_device_info == NULL)
|
||||
return false;
|
||||
return usb_device_info->device_type == type_searched_for;
|
||||
}
|
||||
|
||||
bool is_device_optimize_o3ds(CaptureDevice* device) {
|
||||
return does_device_match_type(device, CYPRESS_OPTIMIZE_OLD_3DS_INSTANTIATED_DEVICE);
|
||||
}
|
||||
|
||||
bool is_device_optimize_n3ds(CaptureDevice* device) {
|
||||
return does_device_match_type(device, CYPRESS_OPTIMIZE_NEW_3DS_INSTANTIATED_DEVICE);
|
||||
}
|
||||
|
||||
static InputVideoDataType extract_wanted_input_video_data_type(CaptureStatus* capture_status) {
|
||||
return capture_status->request_low_bw_format ? VIDEO_DATA_RGB16 : VIDEO_DATA_RGB;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ const uint8_t start_capture_third_buffer_565_old[] = { 0x61, 0x07, 0x00, 0x26, 0
|
||||
const uint8_t start_capture_third_buffer_888_old[] = { 0x61, 0x07, 0x00, 0xA6, 0x00, 0x20, 0x00, 0x98, 0x00, 0x08, 0x00, 0xDE, 0x00, 0xF9, 0x18, 0x0F };
|
||||
|
||||
static const cyop_device_usb_device cypress_optimize_new_3ds_generic_device = {
|
||||
.name = "Optimize New 3DS", .long_name = "Optimize New 3DS",
|
||||
.name = "FX2LP-O -> Opt. N3DS", .long_name = "EZ-USB FX2LP-O -> Optimize New 3DS",
|
||||
.device_type = CYPRESS_OPTIMIZE_NEW_3DS_BLANK_DEVICE,
|
||||
.firmware_to_load = optimize_new_3ds_fw, .firmware_size = optimize_new_3ds_fw_len,
|
||||
.fpga_pl_565 = NULL, .fpga_pl_565_size = 0,
|
||||
@ -92,7 +92,7 @@ static const cyop_device_usb_device cypress_optimize_new_3ds_instantiated_device
|
||||
};
|
||||
|
||||
static const cyop_device_usb_device cypress_optimize_old_3ds_generic_device = {
|
||||
.name = "Optimize Old 3DS", .long_name = "Optimize Old 3DS",
|
||||
.name = "FX2LP -> Opt. O3DS", .long_name = "EZ-USB FX2LP -> Optimize Old 3DS",
|
||||
.device_type = CYPRESS_OPTIMIZE_OLD_3DS_BLANK_DEVICE,
|
||||
.firmware_to_load = optimize_old_3ds_fw, .firmware_size = optimize_old_3ds_fw_len,
|
||||
.fpga_pl_565 = NULL, .fpga_pl_565_size = 0,
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "ExtraSettingsMenu.hpp"
|
||||
#include "USBConflictResolutionMenu.hpp"
|
||||
|
||||
#define NUM_TOTAL_MENU_OPTIONS (sizeof(pollable_options)/sizeof(pollable_options[0]))
|
||||
|
||||
@ -10,6 +11,8 @@ struct ExtraSettingsMenuOptionInfo {
|
||||
const bool active_joint_screen;
|
||||
const bool active_top_screen;
|
||||
const bool active_bottom_screen;
|
||||
const bool active_regular;
|
||||
const bool active_mono_app;
|
||||
const ExtraSettingsMenuOutAction out_action;
|
||||
};
|
||||
|
||||
@ -17,44 +20,58 @@ static const ExtraSettingsMenuOptionInfo warning_option = {
|
||||
.base_name = "Advanced users only!", .is_selectable = false,
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = true, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_NO_ACTION};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo windowed_option = {
|
||||
.base_name = "Windowed Mode", .is_selectable = true,
|
||||
.active_fullscreen = true, .active_windowed_screen = false,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = false, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_FULLSCREEN};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo fullscreen_option = {
|
||||
.base_name = "Fullscreen Mode", .is_selectable = true,
|
||||
.active_fullscreen = false, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = false, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_FULLSCREEN};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo join_screens_option = {
|
||||
.base_name = "Join Screens", .is_selectable = true,
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = false, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = false, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_SPLIT};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo split_screens_option = {
|
||||
.base_name = "Split Screens", .is_selectable = true,
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = false, .active_bottom_screen = false,
|
||||
.active_regular = false, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_SPLIT};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo quit_option = {
|
||||
.base_name = "Quit Application", .is_selectable = true,
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = false, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_QUIT_APPLICATION};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo usb_conflict_resolution_menu_option = {
|
||||
.base_name = "USB Conflict Resolution", .is_selectable = true,
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.active_regular = true, .active_mono_app = true,
|
||||
.out_action = EXTRA_SETTINGS_MENU_USB_CONFLICT_RESOLUTION};
|
||||
|
||||
static const ExtraSettingsMenuOptionInfo* pollable_options[] = {
|
||||
&warning_option,
|
||||
&windowed_option,
|
||||
&fullscreen_option,
|
||||
&join_screens_option,
|
||||
&split_screens_option,
|
||||
&usb_conflict_resolution_menu_option,
|
||||
&quit_option,
|
||||
};
|
||||
|
||||
@ -84,21 +101,40 @@ void ExtraSettingsMenu::class_setup() {
|
||||
this->show_title = true;
|
||||
}
|
||||
|
||||
void ExtraSettingsMenu::insert_data(ScreenType s_type, bool is_fullscreen) {
|
||||
static bool is_option_valid(const ExtraSettingsMenuOptionInfo* option, ScreenType s_type, bool is_fullscreen, bool is_mono_app) {
|
||||
bool valid = true;
|
||||
if(is_fullscreen)
|
||||
valid = valid && option->active_fullscreen;
|
||||
else
|
||||
valid = valid && option->active_windowed_screen;
|
||||
if(s_type == ScreenType::TOP)
|
||||
valid = valid && option->active_top_screen;
|
||||
else if(s_type == ScreenType::BOTTOM)
|
||||
valid = valid && option->active_bottom_screen;
|
||||
else
|
||||
valid = valid && option->active_joint_screen;
|
||||
if(is_mono_app)
|
||||
valid = valid && option->active_mono_app;
|
||||
else
|
||||
valid = valid && option->active_regular;
|
||||
if(option->out_action == EXTRA_SETTINGS_MENU_USB_CONFLICT_RESOLUTION)
|
||||
valid = valid && (USBConflictResolutionMenu::get_total_possible_selectable_inserted() > 0);
|
||||
return valid;
|
||||
}
|
||||
|
||||
int ExtraSettingsMenu::get_total_possible_selectable_inserted(ScreenType s_type, bool is_fullscreen, bool is_mono_app) {
|
||||
int num_insertable = 0;
|
||||
for(size_t i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
if(is_option_valid(pollable_options[i], s_type, is_fullscreen, is_mono_app) && pollable_options[i]->is_selectable)
|
||||
num_insertable++;
|
||||
}
|
||||
return num_insertable;
|
||||
}
|
||||
|
||||
void ExtraSettingsMenu::insert_data(ScreenType s_type, bool is_fullscreen, bool is_mono_app) {
|
||||
this->num_enabled_options = 0;
|
||||
for(size_t i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
bool valid = true;
|
||||
if(is_fullscreen)
|
||||
valid = valid && pollable_options[i]->active_fullscreen;
|
||||
else
|
||||
valid = valid && pollable_options[i]->active_windowed_screen;
|
||||
if(s_type == ScreenType::TOP)
|
||||
valid = valid && pollable_options[i]->active_top_screen;
|
||||
else if(s_type == ScreenType::BOTTOM)
|
||||
valid = valid && pollable_options[i]->active_bottom_screen;
|
||||
else
|
||||
valid = valid && pollable_options[i]->active_joint_screen;
|
||||
if(valid) {
|
||||
if(is_option_valid(pollable_options[i], s_type, is_fullscreen, is_mono_app)) {
|
||||
this->options_indexes[this->num_enabled_options] = (int)i;
|
||||
this->num_enabled_options++;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "MainMenu.hpp"
|
||||
#include "usb_is_device_acquisition.hpp"
|
||||
#include "cypress_optimize_3ds_acquisition.hpp"
|
||||
|
||||
#define NUM_TOTAL_MENU_OPTIONS (sizeof(pollable_options)/sizeof(pollable_options[0]))
|
||||
|
||||
@ -112,7 +113,7 @@ static const MainMenuOptionInfo extra_settings_option = {
|
||||
.base_name = "Extra Settings", .false_name = "",
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.enabled_normal_mode = false, .enabled_mono_mode = true, .is_cc_specific = false,
|
||||
.enabled_normal_mode = true, .enabled_mono_mode = true, .is_cc_specific = false,
|
||||
.out_action = MAIN_MENU_EXTRA_SETTINGS};
|
||||
|
||||
/*
|
||||
@ -145,6 +146,13 @@ static const MainMenuOptionInfo ist_settings_option = {
|
||||
.enabled_normal_mode = true, .enabled_mono_mode = true, .is_cc_specific = true,
|
||||
.out_action = MAIN_MENU_IST_SETTINGS};
|
||||
|
||||
static const MainMenuOptionInfo opti_3ds_settings_option = {
|
||||
.base_name = "Optimize 3DS Settings", .false_name = "",
|
||||
.active_fullscreen = true, .active_windowed_screen = true,
|
||||
.active_joint_screen = true, .active_top_screen = true, .active_bottom_screen = true,
|
||||
.enabled_normal_mode = true, .enabled_mono_mode = true, .is_cc_specific = true,
|
||||
.out_action = MAIN_MENU_OPTIMIZE_3DS_SETTINGS};
|
||||
|
||||
static const MainMenuOptionInfo* pollable_options[] = {
|
||||
&connect_option,
|
||||
&windowed_option,
|
||||
@ -160,6 +168,7 @@ static const MainMenuOptionInfo* pollable_options[] = {
|
||||
&status_option,
|
||||
&isn_settings_option,
|
||||
&ist_settings_option,
|
||||
&opti_3ds_settings_option,
|
||||
&licenses_option,
|
||||
&extra_settings_option,
|
||||
&quit_option,
|
||||
@ -199,6 +208,10 @@ static bool check_cc_specific_option(const MainMenuOptionInfo* option, CaptureDe
|
||||
if((option->out_action == MAIN_MENU_IST_SETTINGS) && is_device_is_twl(device))
|
||||
return true;
|
||||
#endif
|
||||
#ifdef USE_CYPRESS_OPTIMIZE
|
||||
if((option->out_action == MAIN_MENU_OPTIMIZE_3DS_SETTINGS) && is_device_optimize_3ds(device))
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -222,6 +235,8 @@ void MainMenu::insert_data(ScreenType s_type, bool is_fullscreen, bool mono_app_
|
||||
valid = valid && pollable_options[i]->enabled_normal_mode;
|
||||
if(pollable_options[i]->is_cc_specific)
|
||||
valid = valid && connected && check_cc_specific_option(pollable_options[i], device);
|
||||
if(pollable_options[i]->out_action == MAIN_MENU_EXTRA_SETTINGS)
|
||||
valid = valid && (ExtraSettingsMenu::get_total_possible_selectable_inserted(s_type, is_fullscreen, mono_app_mode) > 0);
|
||||
//if((pollable_options[i]->out_action == MAIN_MENU_SHORTCUT_SETTINGS) && (!enable_shortcut))
|
||||
// valid = false;
|
||||
if(valid) {
|
||||
|
186
source/Menus/Optimize3DSMenu.cpp
Normal file
186
source/Menus/Optimize3DSMenu.cpp
Normal file
@ -0,0 +1,186 @@
|
||||
#include "Optimize3DSMenu.hpp"
|
||||
#include "cypress_optimize_3ds_acquisition.hpp"
|
||||
|
||||
#define NUM_TOTAL_MENU_OPTIONS (sizeof(pollable_options)/sizeof(pollable_options[0]))
|
||||
|
||||
struct Optimize3DSMenuOptionInfo {
|
||||
const std::string base_name;
|
||||
const std::string false_name;
|
||||
const bool is_selectable;
|
||||
const bool optimize_o3ds_valid;
|
||||
const bool optimize_n3ds_valid;
|
||||
const bool is_inc;
|
||||
const std::string dec_str;
|
||||
const std::string inc_str;
|
||||
const Optimize3DSMenuOutAction inc_out_action;
|
||||
const Optimize3DSMenuOutAction out_action;
|
||||
};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_o3ds_hw_option = {
|
||||
.base_name = "Hardware: Old 3DS", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_n3ds_hw_option = {
|
||||
.base_name = "Hardware: New 3DS", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = false, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_format_explanation_0 = {
|
||||
.base_name = "Possible Data Types:", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_format_explanation_1 = {
|
||||
.base_name = "RGB888 - Full color Format", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_format_explanation_2 = {
|
||||
.base_name = "more demanding on USB host.", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_format_explanation_3 = {
|
||||
.base_name = "RGB565 - Reduced color Format", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_format_explanation_4 = {
|
||||
.base_name = "less demanding on USB host.", .false_name = "", .is_selectable = false,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = false, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_NO_ACTION,
|
||||
.out_action = OPTIMIZE3DS_MENU_NO_ACTION};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo optimize_3ds_change_format = {
|
||||
.base_name = "Data Type", .false_name = "", .is_selectable = true,
|
||||
.optimize_o3ds_valid = true, .optimize_n3ds_valid = true,
|
||||
.is_inc = true, .dec_str = "<", .inc_str = ">", .inc_out_action = OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_INC,
|
||||
.out_action = OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_DEC};
|
||||
|
||||
static const Optimize3DSMenuOptionInfo* pollable_options[] = {
|
||||
//&optimize_o3ds_hw_option,
|
||||
//&optimize_n3ds_hw_option,
|
||||
&optimize_3ds_format_explanation_0,
|
||||
&optimize_3ds_format_explanation_1,
|
||||
//&optimize_3ds_format_explanation_2,
|
||||
&optimize_3ds_format_explanation_3,
|
||||
//&optimize_3ds_format_explanation_4,
|
||||
&optimize_3ds_change_format,
|
||||
};
|
||||
|
||||
Optimize3DSMenu::Optimize3DSMenu(TextRectanglePool* text_rectangle_pool) : OptionSelectionMenu(){
|
||||
this->options_indexes = new int[NUM_TOTAL_MENU_OPTIONS];
|
||||
this->initialize(text_rectangle_pool);
|
||||
this->num_enabled_options = 0;
|
||||
}
|
||||
|
||||
Optimize3DSMenu::~Optimize3DSMenu() {
|
||||
delete []this->options_indexes;
|
||||
}
|
||||
|
||||
void Optimize3DSMenu::class_setup() {
|
||||
this->num_options_per_screen = 5;
|
||||
this->min_elements_text_scaling_factor = num_options_per_screen + 2;
|
||||
this->width_factor_menu = 16;
|
||||
this->width_divisor_menu = 9;
|
||||
this->base_height_factor_menu = 12;
|
||||
this->base_height_divisor_menu = 6;
|
||||
this->min_text_size = 0.3f;
|
||||
this->max_width_slack = 1.1f;
|
||||
this->menu_color = sf::Color(30, 30, 60, 192);
|
||||
this->title = " Optimize 3DS Settings";
|
||||
this->show_back_x = true;
|
||||
this->show_x = false;
|
||||
this->show_title = true;
|
||||
}
|
||||
|
||||
void Optimize3DSMenu::insert_data(CaptureDevice* device) {
|
||||
bool is_o3ds = false;
|
||||
bool is_n3ds = false;
|
||||
#ifdef USE_CYPRESS_OPTIMIZE
|
||||
is_o3ds = is_device_optimize_o3ds(device);
|
||||
is_n3ds = is_device_optimize_n3ds(device);
|
||||
#endif
|
||||
this->num_enabled_options = 0;
|
||||
for(size_t i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
bool valid = true;
|
||||
if(is_o3ds)
|
||||
valid = valid && pollable_options[i]->optimize_o3ds_valid;
|
||||
if(is_n3ds)
|
||||
valid = valid && pollable_options[i]->optimize_n3ds_valid;
|
||||
if(valid) {
|
||||
this->options_indexes[this->num_enabled_options] = (int)i;
|
||||
this->num_enabled_options++;
|
||||
}
|
||||
}
|
||||
this->prepare_options();
|
||||
}
|
||||
|
||||
void Optimize3DSMenu::reset_output_option() {
|
||||
this->selected_index = Optimize3DSMenuOutAction::OPTIMIZE3DS_MENU_NO_ACTION;
|
||||
}
|
||||
|
||||
void Optimize3DSMenu::set_output_option(int index, int action) {
|
||||
if(index == BACK_X_OUTPUT_OPTION)
|
||||
this->selected_index = OPTIMIZE3DS_MENU_BACK;
|
||||
else if((action == INC_ACTION) && this->is_option_inc_dec(index))
|
||||
this->selected_index = pollable_options[this->options_indexes[index]]->inc_out_action;
|
||||
else
|
||||
this->selected_index = pollable_options[this->options_indexes[index]]->out_action;
|
||||
}
|
||||
|
||||
size_t Optimize3DSMenu::get_num_options() {
|
||||
return this->num_enabled_options;
|
||||
}
|
||||
|
||||
std::string Optimize3DSMenu::get_string_option(int index, int action) {
|
||||
if((action == INC_ACTION) && this->is_option_inc_dec(index))
|
||||
return pollable_options[this->options_indexes[index]]->inc_str;
|
||||
if((action == DEC_ACTION) && this->is_option_inc_dec(index))
|
||||
return pollable_options[this->options_indexes[index]]->dec_str;
|
||||
if(action == FALSE_ACTION)
|
||||
return pollable_options[this->options_indexes[index]]->false_name;
|
||||
return pollable_options[this->options_indexes[index]]->base_name;
|
||||
}
|
||||
|
||||
bool Optimize3DSMenu::is_option_selectable(int index, int action) {
|
||||
return pollable_options[this->options_indexes[index]]->is_selectable;
|
||||
}
|
||||
|
||||
bool Optimize3DSMenu::is_option_inc_dec(int index) {
|
||||
return pollable_options[this->options_indexes[index]]->is_inc;
|
||||
}
|
||||
|
||||
static std::string get_data_format_name(bool request_low_bw_format) {
|
||||
return request_low_bw_format ? "RGB565" : "RGB888";
|
||||
}
|
||||
|
||||
void Optimize3DSMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status) {
|
||||
int num_pages = this->get_num_pages();
|
||||
if(this->future_data.page >= num_pages)
|
||||
this->future_data.page = num_pages - 1;
|
||||
int start = this->future_data.page * this->num_options_per_screen;
|
||||
for(int i = 0; i < this->num_options_per_screen + 1; i++) {
|
||||
int index = (i * this->single_option_multiplier) + this->elements_start_id;
|
||||
if(!this->future_enabled_labels[index])
|
||||
continue;
|
||||
int real_index = start + i;
|
||||
int option_index = this->options_indexes[real_index];
|
||||
switch(pollable_options[option_index]->out_action) {
|
||||
case OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_DEC:
|
||||
this->labels[index]->setText(this->setTextOptionString(real_index, get_data_format_name(capture_status->request_low_bw_format)));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->base_prepare(menu_scaling_factor, view_size_x, view_size_y);
|
||||
}
|
183
source/Menus/USBConflictResolutionMenu.cpp
Normal file
183
source/Menus/USBConflictResolutionMenu.cpp
Normal file
@ -0,0 +1,183 @@
|
||||
#include "USBConflictResolutionMenu.hpp"
|
||||
|
||||
#define NUM_TOTAL_MENU_OPTIONS (sizeof(pollable_options)/sizeof(pollable_options[0]))
|
||||
|
||||
#ifdef EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS
|
||||
#undef EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS
|
||||
#endif
|
||||
|
||||
#if (defined(USE_CYNI_USB) && defined(USE_CYPRESS_OPTIMIZE))
|
||||
#define EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS true
|
||||
#else
|
||||
#define EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS false
|
||||
#endif
|
||||
|
||||
struct USBConflictResolutionMenuOptionInfo {
|
||||
const std::string base_name;
|
||||
const std::string false_name;
|
||||
const bool exists;
|
||||
const bool is_selectable;
|
||||
const bool is_inc;
|
||||
const std::string dec_str;
|
||||
const std::string inc_str;
|
||||
const USBConflictResolutionMenuOutAction inc_out_action;
|
||||
const USBConflictResolutionMenuOutAction out_action;
|
||||
};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo warning_nise_opti_conflict_0 = {
|
||||
.base_name = "There are two capture cards",
|
||||
.false_name = "", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_NO_ACTION};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo warning_nise_opti_conflict_1 = {
|
||||
.base_name = "which use the FX2LP board.",
|
||||
.false_name = "", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_NO_ACTION};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo warning_nise_opti_conflict_2 = {
|
||||
.base_name = "You may disable one to make",
|
||||
.false_name = "", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_NO_ACTION};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo warning_nise_opti_conflict_3 = {
|
||||
.base_name = "accessing the other faster.",
|
||||
.false_name = "", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = false,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_NO_ACTION};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo nisetro_ds_disable_option = {
|
||||
.base_name = "Disable Nisetro DS(i)",
|
||||
.false_name = "Enable Nisetro DS(i)", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = true,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_NISE_DS};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo optimize_o3ds_disable_option = {
|
||||
.base_name = "Disable Optimize Old 3DS",
|
||||
.false_name = "Enable Optimize Old 3DS", .exists = EXISTENCE_VALUE_CONFLICT_NISE_OPTI_O3DS, .is_selectable = true,
|
||||
.is_inc = false, .dec_str = "", .inc_str = "", .inc_out_action = USBCONRESO_MENU_NO_ACTION,
|
||||
.out_action = USBCONRESO_MENU_OPTI_O3DS};
|
||||
|
||||
static const USBConflictResolutionMenuOptionInfo* pollable_options[] = {
|
||||
&warning_nise_opti_conflict_0,
|
||||
&warning_nise_opti_conflict_1,
|
||||
&warning_nise_opti_conflict_2,
|
||||
&warning_nise_opti_conflict_3,
|
||||
&nisetro_ds_disable_option,
|
||||
&optimize_o3ds_disable_option,
|
||||
};
|
||||
|
||||
USBConflictResolutionMenu::USBConflictResolutionMenu(TextRectanglePool* text_rectangle_pool) : OptionSelectionMenu(){
|
||||
this->options_indexes = new int[NUM_TOTAL_MENU_OPTIONS];
|
||||
this->initialize(text_rectangle_pool);
|
||||
this->num_enabled_options = 0;
|
||||
}
|
||||
|
||||
USBConflictResolutionMenu::~USBConflictResolutionMenu() {
|
||||
delete []this->options_indexes;
|
||||
}
|
||||
|
||||
void USBConflictResolutionMenu::class_setup() {
|
||||
this->num_options_per_screen = 5;
|
||||
this->min_elements_text_scaling_factor = num_options_per_screen + 2;
|
||||
this->width_factor_menu = 16;
|
||||
this->width_divisor_menu = 9;
|
||||
this->base_height_factor_menu = 12;
|
||||
this->base_height_divisor_menu = 6;
|
||||
this->min_text_size = 0.3f;
|
||||
this->max_width_slack = 1.1f;
|
||||
this->menu_color = sf::Color(30, 30, 60, 192);
|
||||
this->title = "USB Conflicts";
|
||||
this->show_back_x = true;
|
||||
this->show_x = false;
|
||||
this->show_title = true;
|
||||
}
|
||||
|
||||
static bool is_option_valid(const USBConflictResolutionMenuOptionInfo* option) {
|
||||
bool valid = true;
|
||||
valid = valid && option->exists;
|
||||
return valid;
|
||||
}
|
||||
|
||||
int USBConflictResolutionMenu::get_total_possible_selectable_inserted() {
|
||||
int num_insertable = 0;
|
||||
for(size_t i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
if(is_option_valid(pollable_options[i]) && pollable_options[i]->is_selectable)
|
||||
num_insertable++;
|
||||
}
|
||||
return num_insertable;
|
||||
}
|
||||
|
||||
void USBConflictResolutionMenu::insert_data() {
|
||||
this->num_enabled_options = 0;
|
||||
for(size_t i = 0; i < NUM_TOTAL_MENU_OPTIONS; i++) {
|
||||
if(is_option_valid(pollable_options[i])) {
|
||||
this->options_indexes[this->num_enabled_options] = (int)i;
|
||||
this->num_enabled_options++;
|
||||
}
|
||||
}
|
||||
this->prepare_options();
|
||||
}
|
||||
|
||||
void USBConflictResolutionMenu::reset_output_option() {
|
||||
this->selected_index = USBConflictResolutionMenuOutAction::USBCONRESO_MENU_NO_ACTION;
|
||||
}
|
||||
|
||||
void USBConflictResolutionMenu::set_output_option(int index, int action) {
|
||||
if(index == BACK_X_OUTPUT_OPTION)
|
||||
this->selected_index = USBCONRESO_MENU_BACK;
|
||||
else if((action == INC_ACTION) && this->is_option_inc_dec(index))
|
||||
this->selected_index = pollable_options[this->options_indexes[index]]->inc_out_action;
|
||||
else
|
||||
this->selected_index = pollable_options[this->options_indexes[index]]->out_action;
|
||||
}
|
||||
|
||||
size_t USBConflictResolutionMenu::get_num_options() {
|
||||
return this->num_enabled_options;
|
||||
}
|
||||
|
||||
std::string USBConflictResolutionMenu::get_string_option(int index, int action) {
|
||||
if((action == INC_ACTION) && this->is_option_inc_dec(index))
|
||||
return pollable_options[this->options_indexes[index]]->inc_str;
|
||||
if((action == DEC_ACTION) && this->is_option_inc_dec(index))
|
||||
return pollable_options[this->options_indexes[index]]->dec_str;
|
||||
if(action == FALSE_ACTION)
|
||||
return pollable_options[this->options_indexes[index]]->false_name;
|
||||
return pollable_options[this->options_indexes[index]]->base_name;
|
||||
}
|
||||
|
||||
bool USBConflictResolutionMenu::is_option_selectable(int index, int action) {
|
||||
return pollable_options[this->options_indexes[index]]->is_selectable;
|
||||
}
|
||||
|
||||
bool USBConflictResolutionMenu::is_option_inc_dec(int index) {
|
||||
return pollable_options[this->options_indexes[index]]->is_inc;
|
||||
}
|
||||
|
||||
void USBConflictResolutionMenu::prepare(float menu_scaling_factor, int view_size_x, int view_size_y, CaptureStatus* capture_status) {
|
||||
int num_pages = this->get_num_pages();
|
||||
if(this->future_data.page >= num_pages)
|
||||
this->future_data.page = num_pages - 1;
|
||||
int start = this->future_data.page * this->num_options_per_screen;
|
||||
for(int i = 0; i < this->num_options_per_screen + 1; i++) {
|
||||
int index = (i * this->single_option_multiplier) + this->elements_start_id;
|
||||
if(!this->future_enabled_labels[index])
|
||||
continue;
|
||||
int real_index = start + i;
|
||||
int option_index = this->options_indexes[real_index];
|
||||
switch(pollable_options[option_index]->out_action) {
|
||||
case USBCONRESO_MENU_NISE_DS:
|
||||
this->labels[index]->setText(this->setTextOptionBool(real_index, capture_status->devices_allowed_scan[CC_NISETRO_DS]));
|
||||
break;
|
||||
case USBCONRESO_MENU_OPTI_O3DS:
|
||||
this->labels[index]->setText(this->setTextOptionBool(real_index, capture_status->devices_allowed_scan[CC_OPTIMIZE_O3DS]));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->base_prepare(menu_scaling_factor, view_size_x, view_size_y);
|
||||
}
|
@ -123,6 +123,8 @@ void WindowScreen::init_menus() {
|
||||
this->color_correction_menu = new ColorCorrectionMenu(this->text_rectangle_pool);
|
||||
this->main_3d_menu = new Main3DMenu(this->text_rectangle_pool);
|
||||
this->second_screen_3d_relpos_menu = new SecondScreen3DRelativePositionMenu(this->text_rectangle_pool);
|
||||
this->usb_conflict_resolution_menu = new USBConflictResolutionMenu(this->text_rectangle_pool);
|
||||
this->optimize_3ds_menu = new Optimize3DSMenu(this->text_rectangle_pool);
|
||||
}
|
||||
|
||||
void WindowScreen::destroy_menus() {
|
||||
@ -152,6 +154,8 @@ void WindowScreen::destroy_menus() {
|
||||
delete this->color_correction_menu;
|
||||
delete this->main_3d_menu;
|
||||
delete this->second_screen_3d_relpos_menu;
|
||||
delete this->usb_conflict_resolution_menu;
|
||||
delete this->optimize_3ds_menu;
|
||||
}
|
||||
|
||||
void WindowScreen::set_close(int ret_val) {
|
||||
@ -578,6 +582,17 @@ void WindowScreen::separator_fullscreen_multiplier_change(bool positive) {
|
||||
this->separator_multiplier_change(positive, this->m_info.separator_fullscreen_multiplier, SEP_FULLSCREEN_SCALING_MIN_MULTIPLIER, MAX_WINDOW_SCALING_VALUE);
|
||||
}
|
||||
|
||||
void WindowScreen::devices_allowed_change(PossibleCaptureDevices device) {
|
||||
if((device < 0) || (device >= CC_POSSIBLE_DEVICES_END))
|
||||
return;
|
||||
this->capture_status->devices_allowed_scan[device] = !this->capture_status->devices_allowed_scan[device];
|
||||
}
|
||||
|
||||
void WindowScreen::input_video_data_format_request_change(bool positive) {
|
||||
this->capture_status->request_low_bw_format = !this->capture_status->request_low_bw_format;
|
||||
this->print_notification("Changing data format...\nPlease wait...");
|
||||
}
|
||||
|
||||
bool WindowScreen::can_execute_cmd(const WindowCommand* window_cmd, bool is_extra, bool is_always) {
|
||||
if((!window_cmd->usable_always) && is_always)
|
||||
return false;
|
||||
@ -1038,7 +1053,7 @@ void WindowScreen::setup_extra_menu(bool reset_data) {
|
||||
return;
|
||||
if(this->curr_menu != EXTRA_MENU_TYPE) {
|
||||
this->switch_to_menu(EXTRA_MENU_TYPE, this->extra_menu, reset_data);
|
||||
this->extra_menu->insert_data(this->m_stype, this->m_info.is_fullscreen);
|
||||
this->extra_menu->insert_data(this->m_stype, this->m_info.is_fullscreen, this->display_data->mono_app_mode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1167,6 +1182,24 @@ void WindowScreen::setup_second_screen_3d_relpos_menu(bool reset_data) {
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::setup_usb_conflict_resolution_menu(bool reset_data) {
|
||||
if(!this->can_setup_menu())
|
||||
return;
|
||||
if(this->curr_menu != USB_CONFLICT_RESOLUTION_MENU_TYPE) {
|
||||
this->switch_to_menu(USB_CONFLICT_RESOLUTION_MENU_TYPE, this->usb_conflict_resolution_menu, reset_data);
|
||||
this->usb_conflict_resolution_menu->insert_data();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::setup_optimize_3ds_menu(bool reset_data) {
|
||||
if(!this->can_setup_menu())
|
||||
return;
|
||||
if(this->curr_menu != OPTIMIZE_3DS_MENU_TYPE) {
|
||||
this->switch_to_menu(OPTIMIZE_3DS_MENU_TYPE, this->optimize_3ds_menu, reset_data);
|
||||
this->optimize_3ds_menu->insert_data(&this->capture_status->device);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowScreen::update_save_menu() {
|
||||
if(this->curr_menu == SAVE_MENU_TYPE) {
|
||||
this->curr_menu = DEFAULT_MENU_TYPE;
|
||||
@ -1503,6 +1536,10 @@ void WindowScreen::poll(bool do_everything) {
|
||||
this->setup_is_nitro_menu();
|
||||
done = true;
|
||||
break;
|
||||
case MAIN_MENU_OPTIMIZE_3DS_SETTINGS:
|
||||
this->setup_optimize_3ds_menu();
|
||||
done = true;
|
||||
break;
|
||||
case MAIN_MENU_SHUTDOWN:
|
||||
this->set_close(1);
|
||||
this->setup_no_menu();
|
||||
@ -1911,6 +1948,10 @@ void WindowScreen::poll(bool do_everything) {
|
||||
this->split_change();
|
||||
done = true;
|
||||
break;
|
||||
case EXTRA_SETTINGS_MENU_USB_CONFLICT_RESOLUTION:
|
||||
this->setup_usb_conflict_resolution_menu();
|
||||
done = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2225,6 +2266,45 @@ void WindowScreen::poll(bool do_everything) {
|
||||
}
|
||||
this->loaded_menu_ptr->reset_output_option();
|
||||
break;
|
||||
case USB_CONFLICT_RESOLUTION_MENU_TYPE:
|
||||
switch(this->usb_conflict_resolution_menu->selected_index) {
|
||||
case USBCONRESO_MENU_BACK:
|
||||
this->setup_extra_menu(false);
|
||||
done = true;
|
||||
break;
|
||||
case USBCONRESO_MENU_NO_ACTION:
|
||||
break;
|
||||
case USBCONRESO_MENU_NISE_DS:
|
||||
this->devices_allowed_change(CC_NISETRO_DS);
|
||||
break;
|
||||
case USBCONRESO_MENU_OPTI_O3DS:
|
||||
this->devices_allowed_change(CC_OPTIMIZE_O3DS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this->loaded_menu_ptr->reset_output_option();
|
||||
break;
|
||||
case OPTIMIZE_3DS_MENU_TYPE:
|
||||
switch(this->optimize_3ds_menu->selected_index) {
|
||||
case OPTIMIZE3DS_MENU_BACK:
|
||||
this->setup_main_menu(false);
|
||||
done = true;
|
||||
break;
|
||||
case OPTIMIZE3DS_MENU_NO_ACTION:
|
||||
break;
|
||||
case OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_INC:
|
||||
this->input_video_data_format_request_change(true);
|
||||
break;
|
||||
case OPTIMIZE3DS_MENU_INPUT_VIDEO_FORMAT_DEC:
|
||||
this->input_video_data_format_request_change(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this->loaded_menu_ptr->reset_output_option();
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2510,6 +2590,12 @@ void WindowScreen::prepare_menu_draws(int view_size_x, int view_size_y) {
|
||||
case SECOND_SCREEN_RELATIVE_POS_MENU_TYPE:
|
||||
this->second_screen_3d_relpos_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, &this->loaded_info);
|
||||
break;
|
||||
case USB_CONFLICT_RESOLUTION_MENU_TYPE:
|
||||
this->usb_conflict_resolution_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, this->capture_status);
|
||||
break;
|
||||
case OPTIMIZE_3DS_MENU_TYPE:
|
||||
this->optimize_3ds_menu->prepare(menu_scaling_factor, view_size_x, view_size_y, this->capture_status);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user