mirror of
https://github.com/Lorenzooone/cc3dsfs.git
synced 2026-04-25 15:45:42 -05:00
Implement cli options for scripts
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 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 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 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
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 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 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 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:
parent
0bcc9f986a
commit
5f152f4913
|
|
@ -26,6 +26,7 @@ public:
|
|||
int get_real_volume();
|
||||
bool load_audio_data(std::string key, std::string value);
|
||||
std::string save_audio_data();
|
||||
void set_audio_volume(int new_volume);
|
||||
|
||||
private:
|
||||
int volume;
|
||||
|
|
@ -37,7 +38,6 @@ private:
|
|||
std::string text;
|
||||
void set_max_audio_latency(int new_value);
|
||||
void set_audio_output_type(int new_value);
|
||||
void set_audio_volume(int new_volume);
|
||||
void set_audio_mute(bool new_mute);
|
||||
void update_text(std::string text);
|
||||
const std::string max_audio_latency_str = "max_audio_latency";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct no_access_recap_data {
|
|||
void capture_init();
|
||||
void capture_close();
|
||||
|
||||
bool connect(bool print_failed, CaptureData* capture_data, FrontendData* frontend_data);
|
||||
bool connect(bool print_failed, CaptureData* capture_data, FrontendData* frontend_data, bool auto_connect_to_first = false);
|
||||
void captureCall(CaptureData* capture_data);
|
||||
void capture_error_print(bool print_failed, CaptureData* capture_data, std::string error_string);
|
||||
void capture_error_print(bool print_failed, CaptureData* capture_data, std::string graphical_string, std::string detailed_string);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@
|
|||
#include "shaders_list.hpp"
|
||||
#include "WindowCommands.hpp"
|
||||
|
||||
#define DEFAULT_NO_POS_WINDOW_VALUE -1
|
||||
#define DEFAULT_NO_VOLUME_VALUE -1
|
||||
#define DEFAULT_NO_ENABLED_VALUE -1
|
||||
#define DEFAULT_NO_SCALING_VALUE -1
|
||||
|
||||
enum ScreenType { TOP, BOTTOM, JOINT };
|
||||
enum BottomRelativePosition { UNDER_TOP, LEFT_TOP, ABOVE_TOP, RIGHT_TOP, BOT_REL_POS_END };
|
||||
enum NonIntegerScalingModes { SMALLER_PRIORITY, INVERSE_PROPORTIONAL_PRIORITY, EQUAL_PRIORITY, PROPORTIONAL_PRIORITY, BIGGER_PRIORITY, END_NONINT_SCALE_MODES };
|
||||
|
|
@ -13,6 +18,13 @@ enum CurrMenuType { DEFAULT_MENU_TYPE, CONNECT_MENU_TYPE, MAIN_MENU_TYPE, VIDEO_
|
|||
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 };
|
||||
|
||||
struct override_win_data {
|
||||
int pos_x = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
int pos_y = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
int enabled = DEFAULT_NO_ENABLED_VALUE;
|
||||
int scaling = DEFAULT_NO_SCALING_VALUE;
|
||||
};
|
||||
|
||||
struct ScreenInfo {
|
||||
bool is_blurred;
|
||||
int crop_kind;
|
||||
|
|
@ -47,12 +59,15 @@ struct ScreenInfo {
|
|||
InputColorspaceMode in_colorspace_bot;
|
||||
FrameBlendingMode frame_blending_top;
|
||||
FrameBlendingMode frame_blending_bot;
|
||||
bool window_enabled;
|
||||
int initial_pos_x;
|
||||
int initial_pos_y;
|
||||
};
|
||||
|
||||
struct DisplayData {
|
||||
bool split;
|
||||
bool mono_app_mode;
|
||||
bool last_connected_ds;
|
||||
bool force_disable_mouse;
|
||||
};
|
||||
|
||||
struct ExtraButtonShortcuts {
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ public:
|
|||
int save_data();
|
||||
bool open_capture();
|
||||
bool close_capture();
|
||||
bool scheduled_split();
|
||||
int get_ret_val();
|
||||
|
||||
private:
|
||||
|
|
@ -106,6 +107,7 @@ private:
|
|||
bool last_connected_status;
|
||||
bool m_prepare_open;
|
||||
bool m_prepare_quit;
|
||||
bool m_scheduled_split;
|
||||
int ret_val;
|
||||
bool font_load_success;
|
||||
double frame_time;
|
||||
|
|
@ -328,6 +330,8 @@ void reset_display_data(DisplayData *display_data);
|
|||
void reset_input_data(InputData* input_data);
|
||||
void reset_shared_data(SharedData* shared_data);
|
||||
void reset_fullscreen_info(ScreenInfo &info);
|
||||
void sanitize_enabled_info(ScreenInfo &top_bot_info, ScreenInfo &top_info, ScreenInfo &bot_info);
|
||||
void override_set_data_to_screen_info(override_win_data &override_win, ScreenInfo &info);
|
||||
void reset_screen_info(ScreenInfo &info);
|
||||
bool load_screen_info(std::string key, std::string value, std::string base, ScreenInfo &info);
|
||||
std::string save_screen_info(std::string base, const ScreenInfo &info);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ void list_devices_ftd3(std::vector<CaptureDevice> &devices_list, std::vector<no_
|
|||
std::string valid_descriptions[] = {"N3DSXL", "N3DSXL.2"};
|
||||
ftStatus = FT_CreateDeviceInfoList(&numDevs);
|
||||
size_t num_inserted = 0;
|
||||
if (!FT_FAILED(ftStatus) && numDevs > 0)
|
||||
if(!FT_FAILED(ftStatus) && numDevs > 0)
|
||||
{
|
||||
const int debug_multiplier = 1;
|
||||
FT_HANDLE ftHandle = NULL;
|
||||
|
|
@ -109,14 +109,18 @@ void list_devices_ftd3(std::vector<CaptureDevice> &devices_list, std::vector<no_
|
|||
{
|
||||
ftStatus = FT_GetDeviceInfoDetail(i, &Flags, &Type, &ID, NULL,
|
||||
SerialNumber, Description, &ftHandle);
|
||||
if (!FT_FAILED(ftStatus))
|
||||
if(!FT_FAILED(ftStatus))
|
||||
{
|
||||
for(int j = 0; j < sizeof(valid_descriptions) / sizeof(*valid_descriptions); j++) {
|
||||
if(Description == valid_descriptions[j]) {
|
||||
for(int u = 0; u < debug_multiplier; u++)
|
||||
devices_list.emplace_back(std::string(SerialNumber), "N3DSXL", CAPTURE_CONN_FTD3, (void*)NULL, true, true, true, HEIGHT_3DS, TOP_WIDTH_3DS + BOT_WIDTH_3DS, N3DSXL_SAMPLES_IN, 90, 0, 0, TOP_WIDTH_3DS, 0, VIDEO_DATA_RGB);
|
||||
break;
|
||||
ftStatus = FT_Create(SerialNumber, FT_OPEN_BY_SERIAL_NUMBER, &ftHandle);
|
||||
if(!FT_FAILED(ftStatus)) {
|
||||
for(int j = 0; j < sizeof(valid_descriptions) / sizeof(*valid_descriptions); j++) {
|
||||
if(Description == valid_descriptions[j]) {
|
||||
for(int u = 0; u < debug_multiplier; u++)
|
||||
devices_list.emplace_back(std::string(SerialNumber), "N3DSXL", CAPTURE_CONN_FTD3, (void*)NULL, true, true, true, HEIGHT_3DS, TOP_WIDTH_3DS + BOT_WIDTH_3DS, N3DSXL_SAMPLES_IN, 90, 0, 0, TOP_WIDTH_3DS, 0, VIDEO_DATA_RGB);
|
||||
break;
|
||||
}
|
||||
}
|
||||
FT_Close(ftHandle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -151,7 +155,7 @@ bool connect_ftd3(bool print_failed, CaptureData* capture_data, CaptureDevice* d
|
|||
char SerialNumber[SERIAL_NUMBER_SIZE] = { 0 };
|
||||
strncpy(SerialNumber, device->serial_number.c_str(), REAL_SERIAL_NUMBER_SIZE);
|
||||
SerialNumber[REAL_SERIAL_NUMBER_SIZE] = 0;
|
||||
if (FT_Create(SerialNumber, FT_OPEN_BY_SERIAL_NUMBER, &capture_data->handle)) {
|
||||
if(FT_Create(SerialNumber, FT_OPEN_BY_SERIAL_NUMBER, &capture_data->handle)) {
|
||||
capture_error_print(print_failed, capture_data, "Create failed");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -159,7 +163,7 @@ bool connect_ftd3(bool print_failed, CaptureData* capture_data, CaptureDevice* d
|
|||
UCHAR buf[4] = {0x40, 0x80, 0x00, 0x00};
|
||||
ULONG written = 0;
|
||||
|
||||
if (FT_WritePipe(capture_data->handle, BULK_OUT, buf, 4, &written, 0)) {
|
||||
if(FT_WritePipe(capture_data->handle, BULK_OUT, buf, 4, &written, 0)) {
|
||||
capture_error_print(print_failed, capture_data, "Write failed");
|
||||
preemptive_close_connection(capture_data);
|
||||
return false;
|
||||
|
|
@ -167,13 +171,13 @@ bool connect_ftd3(bool print_failed, CaptureData* capture_data, CaptureDevice* d
|
|||
|
||||
buf[1] = 0x00;
|
||||
|
||||
if (FT_WritePipe(capture_data->handle, BULK_OUT, buf, 4, &written, 0)) {
|
||||
if(FT_WritePipe(capture_data->handle, BULK_OUT, buf, 4, &written, 0)) {
|
||||
capture_error_print(print_failed, capture_data, "Write failed");
|
||||
preemptive_close_connection(capture_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (FT_SetStreamPipe(capture_data->handle, false, false, BULK_IN, get_capture_size(capture_data))) {
|
||||
if(FT_SetStreamPipe(capture_data->handle, false, false, BULK_IN, get_capture_size(capture_data))) {
|
||||
capture_error_print(print_failed, capture_data, "Stream failed");
|
||||
preemptive_close_connection(capture_data);
|
||||
return false;
|
||||
|
|
@ -186,7 +190,7 @@ bool connect_ftd3(bool print_failed, CaptureData* capture_data, CaptureDevice* d
|
|||
return false;
|
||||
}
|
||||
|
||||
if (FT_SetStreamPipe(capture_data->handle, false, false, BULK_IN, get_capture_size(capture_data))) {
|
||||
if(FT_SetStreamPipe(capture_data->handle, false, false, BULK_IN, get_capture_size(capture_data))) {
|
||||
capture_error_print(print_failed, capture_data, "Stream failed");
|
||||
preemptive_close_connection(capture_data);
|
||||
return false;
|
||||
|
|
@ -214,7 +218,7 @@ static void fast_capture_call(FTD3XXReceivedDataBuffer* received_buffer, Capture
|
|||
FT_STATUS ftStatus;
|
||||
for (inner_curr_in = 0; inner_curr_in < FTD3XX_CONCURRENT_BUFFERS; ++inner_curr_in) {
|
||||
ftStatus = FT_InitializeOverlapped(capture_data->handle, &received_buffer[inner_curr_in].overlap);
|
||||
if (ftStatus) {
|
||||
if(ftStatus) {
|
||||
capture_error_print(true, capture_data, "Disconnected: Initialize failed");
|
||||
return;
|
||||
}
|
||||
|
|
@ -222,7 +226,7 @@ static void fast_capture_call(FTD3XXReceivedDataBuffer* received_buffer, Capture
|
|||
|
||||
for (inner_curr_in = 0; inner_curr_in < FTD3XX_CONCURRENT_BUFFERS - 1; ++inner_curr_in) {
|
||||
ftStatus = FT_ASYNC_CALL(capture_data->handle, FIFO_CHANNEL, (UCHAR*)&received_buffer[inner_curr_in].capture_buf, get_capture_size(capture_data), &received_buffer[inner_curr_in].read_buffer, &received_buffer[inner_curr_in].overlap);
|
||||
if (ftStatus != FT_IO_PENDING) {
|
||||
if(ftStatus != FT_IO_PENDING) {
|
||||
capture_error_print(true, capture_data, "Disconnected: Read failed");
|
||||
return;
|
||||
}
|
||||
|
|
@ -235,7 +239,7 @@ static void fast_capture_call(FTD3XXReceivedDataBuffer* received_buffer, Capture
|
|||
while (capture_data->status.connected && capture_data->status.running) {
|
||||
|
||||
ftStatus = FT_ASYNC_CALL(capture_data->handle, FIFO_CHANNEL, (UCHAR*)&received_buffer[inner_curr_in].capture_buf, get_capture_size(capture_data), &received_buffer[inner_curr_in].read_buffer, &received_buffer[inner_curr_in].overlap);
|
||||
if (ftStatus != FT_IO_PENDING) {
|
||||
if(ftStatus != FT_IO_PENDING) {
|
||||
capture_error_print(true, capture_data, "Disconnected: Read failed");
|
||||
return;
|
||||
}
|
||||
|
|
@ -309,7 +313,7 @@ void ftd3_capture_cleanup(CaptureData* capture_data) {
|
|||
capture_error_print(true, capture_data, "Disconnected: Abort failed");
|
||||
}
|
||||
|
||||
if (FT_Close(capture_data->handle)) {
|
||||
if(FT_Close(capture_data->handle)) {
|
||||
capture_error_print(true, capture_data, "Disconnected: Close failed");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ WindowScreen::WindowScreen(ScreenType stype, CaptureStatus* capture_status, Disp
|
|||
this->m_prepare_load = 0;
|
||||
this->m_prepare_open = false;
|
||||
this->m_prepare_quit = false;
|
||||
this->m_scheduled_split = false;
|
||||
this->ret_val = 0;
|
||||
reset_screen_info(this->m_info);
|
||||
this->font_load_success = this->text_font.openFromMemory(font_ttf, font_ttf_len);
|
||||
|
|
@ -208,9 +209,7 @@ void WindowScreen::draw(double frame_time, VideoOutputData* out_buf) {
|
|||
if(!this->done_display)
|
||||
return;
|
||||
|
||||
bool should_be_open = this->display_data->split;
|
||||
if(this->m_stype == ScreenType::JOINT)
|
||||
should_be_open = !should_be_open;
|
||||
bool should_be_open = this->m_info.window_enabled;
|
||||
if(this->m_win.isOpen() ^ should_be_open) {
|
||||
if(this->m_win.isOpen())
|
||||
this->close();
|
||||
|
|
@ -239,6 +238,8 @@ void WindowScreen::draw(double frame_time, VideoOutputData* out_buf) {
|
|||
this->was_last_frame_null = true;
|
||||
}
|
||||
loaded_info = m_info;
|
||||
m_info.initial_pos_x = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
m_info.initial_pos_y = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
this->notification->setTextFactor(this->loaded_info.menu_scaling_factor);
|
||||
this->notification->prepareRenderText();
|
||||
this->frame_time = frame_time;
|
||||
|
|
@ -413,6 +414,8 @@ void WindowScreen::window_factory(bool is_main_thread) {
|
|||
sf::Vector2i prev_pos = sf::Vector2i(0, 0);
|
||||
if(previously_open)
|
||||
prev_pos = this->m_win.getPosition();
|
||||
if((this->loaded_info.initial_pos_x != DEFAULT_NO_POS_WINDOW_VALUE) && (this->loaded_info.initial_pos_y != DEFAULT_NO_POS_WINDOW_VALUE))
|
||||
prev_pos = sf::Vector2i(this->loaded_info.initial_pos_x, this->loaded_info.initial_pos_y);
|
||||
if(!this->loaded_info.is_fullscreen) {
|
||||
this->update_screen_settings();
|
||||
if(this->loaded_info.have_titlebar)
|
||||
|
|
@ -431,6 +434,8 @@ void WindowScreen::window_factory(bool is_main_thread) {
|
|||
}
|
||||
if(previously_open && this->loaded_operations.call_titlebar)
|
||||
this->m_win.setPosition(prev_pos);
|
||||
if((this->loaded_info.initial_pos_x != DEFAULT_NO_POS_WINDOW_VALUE) && (this->loaded_info.initial_pos_y != DEFAULT_NO_POS_WINDOW_VALUE))
|
||||
this->m_win.setPosition(prev_pos);
|
||||
this->last_window_creation_time = std::chrono::high_resolution_clock::now();
|
||||
this->update_screen_settings();
|
||||
this->draw_lock->unlock();
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ void WindowScreen::split_change() {
|
|||
if(this->curr_menu != CONNECT_MENU_TYPE)
|
||||
this->setup_no_menu();
|
||||
this->m_info.is_fullscreen = false;
|
||||
this->display_data->split = !this->display_data->split;
|
||||
this->m_scheduled_split = true;
|
||||
}
|
||||
|
||||
void WindowScreen::fullscreen_change() {
|
||||
|
|
@ -1222,7 +1222,7 @@ bool WindowScreen::main_poll(SFEvent &event_data) {
|
|||
void WindowScreen::poll(bool do_everything) {
|
||||
if(this->close_capture())
|
||||
return;
|
||||
if((this->m_info.is_fullscreen || this->display_data->mono_app_mode) && this->m_info.show_mouse) {
|
||||
if((this->m_info.is_fullscreen || this->display_data->mono_app_mode || this->display_data->force_disable_mouse) && this->m_info.show_mouse) {
|
||||
auto curr_time = std::chrono::high_resolution_clock::now();
|
||||
const std::chrono::duration<double> diff = curr_time - this->last_mouse_action_time;
|
||||
if(diff.count() > this->mouse_timeout)
|
||||
|
|
@ -2022,6 +2022,12 @@ bool WindowScreen::close_capture() {
|
|||
return this->m_prepare_quit;
|
||||
}
|
||||
|
||||
bool WindowScreen::scheduled_split() {
|
||||
bool ret_val = this->m_scheduled_split;
|
||||
this->m_scheduled_split = false;
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
int WindowScreen::get_ret_val() {
|
||||
if(!this->m_prepare_quit)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,19 @@ struct OutTextData {
|
|||
TextKind kind;
|
||||
};
|
||||
|
||||
struct override_all_data {
|
||||
override_win_data override_top_bot_data;
|
||||
override_win_data override_top_data;
|
||||
override_win_data override_bot_data;
|
||||
bool no_audio = false;
|
||||
int volume = DEFAULT_NO_VOLUME_VALUE;
|
||||
bool always_prevent_mouse_showing = false;
|
||||
bool auto_connect_to_first = false;
|
||||
int loaded_profile = STARTUP_FILE_INDEX;
|
||||
bool mono_app = false;
|
||||
bool recovery_mode = false;
|
||||
};
|
||||
|
||||
static void ConsoleOutText(std::string full_text) {
|
||||
if(full_text != "")
|
||||
std::cout << "[" << NAME << "] " << full_text << std::endl;
|
||||
|
|
@ -156,7 +169,10 @@ static bool load(const std::string path, const std::string name, ScreenInfo &top
|
|||
continue;
|
||||
|
||||
if(key == "split") {
|
||||
display_data.split = std::stoi(value);
|
||||
bool split = std::stoi(value);
|
||||
joint_info.window_enabled = !split;
|
||||
top_info.window_enabled = split;
|
||||
bottom_info.window_enabled = split;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -197,6 +213,7 @@ static void defaults_reload(FrontendData *frontend_data, AudioData* audio_data,
|
|||
reset_screen_info(frontend_data->top_screen->m_info);
|
||||
reset_screen_info(frontend_data->bot_screen->m_info);
|
||||
reset_screen_info(frontend_data->joint_screen->m_info);
|
||||
sanitize_enabled_info(frontend_data->joint_screen->m_info, frontend_data->top_screen->m_info, frontend_data->bot_screen->m_info);
|
||||
audio_data->reset();
|
||||
reset_display_data(&frontend_data->display_data);
|
||||
if(frontend_data->display_data.mono_app_mode)
|
||||
|
|
@ -228,6 +245,7 @@ static void load_layout_file(int load_index, FrontendData *frontend_data, AudioD
|
|||
}
|
||||
else if(!op_success)
|
||||
defaults_reload(frontend_data, audio_data, capture_status);
|
||||
sanitize_enabled_info(frontend_data->joint_screen->m_info, frontend_data->top_screen->m_info, frontend_data->bot_screen->m_info);
|
||||
if(!is_first_load)
|
||||
return;
|
||||
bool shared_op_success = load_shared(shared_layout_path, shared_layout_name, &frontend_data->shared_data, out_text_data, op_success);
|
||||
|
|
@ -269,7 +287,6 @@ static bool save(const std::string path, const std::string name, const std::stri
|
|||
file << save_screen_info("bot_", bottom_info);
|
||||
file << save_screen_info("joint_", joint_info);
|
||||
file << save_screen_info("top_", top_info);
|
||||
file << "split=" << display_data.split << std::endl;
|
||||
file << "last_connected_ds=" << display_data.last_connected_ds << std::endl;
|
||||
file << "is_screen_capture_type=" << capture_status->capture_type << std::endl;
|
||||
file << "is_speed_capture=" << capture_status->capture_speed << std::endl;
|
||||
|
|
@ -400,7 +417,7 @@ static float get_time_multiplier(CaptureData* capture_data, bool should_ignore_d
|
|||
}
|
||||
}
|
||||
|
||||
static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data, bool mono_app, bool created_proper_folder, bool recovery_mode) {
|
||||
static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data, bool created_proper_folder, override_all_data &override_data) {
|
||||
VideoOutputData *out_buf;
|
||||
double last_frame_time = 0.0;
|
||||
int num_elements_fps_array = 0;
|
||||
|
|
@ -408,7 +425,8 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
ConsumerMutex draw_lock;
|
||||
reset_display_data(&frontend_data.display_data);
|
||||
reset_shared_data(&frontend_data.shared_data);
|
||||
frontend_data.display_data.mono_app_mode = mono_app;
|
||||
frontend_data.display_data.mono_app_mode = override_data.mono_app;
|
||||
frontend_data.display_data.force_disable_mouse = override_data.always_prevent_mouse_showing;
|
||||
frontend_data.reload = true;
|
||||
bool skip_io = false;
|
||||
int num_allowed_blanks = MAX_ALLOWED_BLANKS;
|
||||
|
|
@ -429,8 +447,14 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
frontend_data.bot_screen = bot_screen;
|
||||
frontend_data.joint_screen = joint_screen;
|
||||
|
||||
if(!recovery_mode)
|
||||
load_layout_file(STARTUP_FILE_INDEX, &frontend_data, audio_data, out_text_data, &capture_data->status, skip_io, false, created_proper_folder, true);
|
||||
if(!override_data.recovery_mode)
|
||||
load_layout_file(override_data.loaded_profile, &frontend_data, audio_data, out_text_data, &capture_data->status, skip_io, false, created_proper_folder, true);
|
||||
if(override_data.volume != DEFAULT_NO_VOLUME_VALUE)
|
||||
audio_data->set_audio_volume(override_data.volume);
|
||||
override_set_data_to_screen_info(override_data.override_top_bot_data, frontend_data.joint_screen->m_info);
|
||||
override_set_data_to_screen_info(override_data.override_top_data, frontend_data.top_screen->m_info);
|
||||
override_set_data_to_screen_info(override_data.override_bot_data, frontend_data.bot_screen->m_info);
|
||||
sanitize_enabled_info(frontend_data.joint_screen->m_info, frontend_data.top_screen->m_info, frontend_data.bot_screen->m_info);
|
||||
// Due to the risk for seizures, at the start of the program, set BFI to false!
|
||||
top_screen->m_info.bfi = false;
|
||||
bot_screen->m_info.bfi = false;
|
||||
|
|
@ -444,7 +468,7 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
std::thread bot_thread(screen_display_thread, bot_screen);
|
||||
std::thread joint_thread(screen_display_thread, joint_screen);
|
||||
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data);
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data, override_data.auto_connect_to_first);
|
||||
bool last_connected = capture_data->status.connected;
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
int no_data_consecutive = 0;
|
||||
|
|
@ -521,6 +545,17 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
int load_index = 0;
|
||||
int save_index = 0;
|
||||
|
||||
if(top_screen->scheduled_split() || bot_screen->scheduled_split()) {
|
||||
top_screen->m_info.window_enabled = false;
|
||||
bot_screen->m_info.window_enabled = false;
|
||||
joint_screen->m_info.window_enabled = true;
|
||||
}
|
||||
if(joint_screen->scheduled_split()) {
|
||||
top_screen->m_info.window_enabled = true;
|
||||
bot_screen->m_info.window_enabled = true;
|
||||
joint_screen->m_info.window_enabled = false;
|
||||
}
|
||||
|
||||
if(top_screen->open_capture() || bot_screen->open_capture() || joint_screen->open_capture()) {
|
||||
capture_data->status.connected = connect(true, capture_data, &frontend_data);
|
||||
SuccessConnectionOutTextGenerator(out_text_data, capture_data);
|
||||
|
|
@ -574,7 +609,7 @@ static int mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data,
|
|||
bot_screen->after_thread_join();
|
||||
joint_screen->after_thread_join();
|
||||
|
||||
save_layout_file(STARTUP_FILE_INDEX, &frontend_data, audio_data, out_text_data, &capture_data->status, skip_io, false, created_proper_folder);
|
||||
save_layout_file(override_data.loaded_profile, &frontend_data, audio_data, out_text_data, &capture_data->status, skip_io, false, created_proper_folder);
|
||||
|
||||
if(!out_text_data.consumed) {
|
||||
ConsoleOutText(out_text_data.full_text);
|
||||
|
|
@ -631,18 +666,51 @@ static bool parse_int_arg(int &index, int argc, char **argv, int &target, std::s
|
|||
|
||||
int main(int argc, char **argv) {
|
||||
init_threads();
|
||||
bool mono_app = false;
|
||||
bool recovery_mode = false;
|
||||
int page_up_id = -1;
|
||||
int page_down_id = -1;
|
||||
int enter_id = -1;
|
||||
int power_id = -1;
|
||||
bool use_pud_up = true;
|
||||
bool created_proper_folder = create_out_folder();
|
||||
override_all_data override_data;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if(parse_existence_arg(i, argv, mono_app, true, "--mono_app"))
|
||||
if(parse_existence_arg(i, argv, override_data.mono_app, true, "--mono_app"))
|
||||
continue;
|
||||
if(parse_existence_arg(i, argv, recovery_mode, true, "--recovery_mode"))
|
||||
if(parse_existence_arg(i, argv, override_data.recovery_mode, true, "--recovery_mode"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_bot_data.pos_x, "--pos_x_both"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_bot_data.pos_y, "--pos_y_both"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_bot_data.scaling, "--scaling_both"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_bot_data.enabled, "--enabled_both"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_data.pos_x, "--pos_x_top"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_data.pos_y, "--pos_y_top"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_data.scaling, "--scaling_top"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_top_data.enabled, "--enabled_top"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_bot_data.pos_x, "--pos_x_bot"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_bot_data.pos_y, "--pos_y_bot"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_bot_data.scaling, "--scaling_bot"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.override_bot_data.enabled, "--enabled_bot"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.volume, "--volume"))
|
||||
continue;
|
||||
if(parse_existence_arg(i, argv, override_data.no_audio, true, "--no_audio"))
|
||||
continue;
|
||||
if(parse_existence_arg(i, argv, override_data.always_prevent_mouse_showing, true, "--no_cursor"))
|
||||
continue;
|
||||
if(parse_existence_arg(i, argv, override_data.auto_connect_to_first, true, "--auto_connect"))
|
||||
continue;
|
||||
if(parse_int_arg(i, argc, argv, override_data.loaded_profile, "--profile"))
|
||||
continue;
|
||||
#ifdef RASPI
|
||||
if(parse_int_arg(i, argc, argv, page_up_id, "--pi_select"))
|
||||
|
|
@ -660,6 +728,29 @@ int main(int argc, char **argv) {
|
|||
std::cout << " --mono_app Enables special mode for when only this application" << std::endl;
|
||||
std::cout << " should run on the system. Disabled by default." << std::endl;
|
||||
std::cout << " --recovery_mode Resets to the defaults." << std::endl;
|
||||
std::cout << " --pos_x_both Set default x position for the window with both screens." << std::endl;
|
||||
std::cout << " --pos_y_both Set default y position for the window with both screens." << std::endl;
|
||||
std::cout << " --scaling_both Overrides the scale factor for the window with both screens." << std::endl;
|
||||
std::cout << " --enabled_both Overrides the presence of the window with both screens." << std::endl;
|
||||
std::cout << " 1 On, 0 Off." << std::endl;
|
||||
std::cout << " --pos_x_top Set default x position for the top screen's window." << std::endl;
|
||||
std::cout << " --pos_y_top Set default y position for the top screen's window." << std::endl;
|
||||
std::cout << " --scaling_top Overrides the top screen window's scale factor." << std::endl;
|
||||
std::cout << " --enabled_top Overrides the presence of the top screen's window." << std::endl;
|
||||
std::cout << " 1 On, 0 Off." << std::endl;
|
||||
std::cout << " --pos_x_bot Set default x position for the bottom screen's window." << std::endl;
|
||||
std::cout << " --pos_y_bot Set default y position for the bottom screen's window." << std::endl;
|
||||
std::cout << " --scaling_bot Overrides the bottom screen window's scale factor." << std::endl;
|
||||
std::cout << " --enabled_bot Overrides the presence of the bottom screen's window." << std::endl;
|
||||
std::cout << " 1 On, 0 Off." << std::endl;
|
||||
std::cout << " --volume Overrides the saved volume for the audio. 0 - 200" << std::endl;
|
||||
std::cout << " --no_audio Disables audio output and processing completely." << std::endl;
|
||||
std::cout << " --no_cursor Prevents the mouse cursor from showing, unless moved." << std::endl;
|
||||
std::cout << " --auto_connect Automatically connects to the first available device," << std::endl;
|
||||
std::cout << " even if multiple are present." << std::endl;
|
||||
std::cout << " --profile Loads the profile with the specified ID at startup" << std::endl;
|
||||
std::cout << " instead of the default one. When the program closes," << std::endl;
|
||||
std::cout << " the data is also saved to the specified profile." << std::endl;
|
||||
#ifdef RASPI
|
||||
std::cout << " --pi_select ID Specifies ID for the select GPIO button." << std::endl;
|
||||
std::cout << " --pi_menu ID Specifies ID for the menu GPIO button." << std::endl;
|
||||
|
|
@ -676,10 +767,13 @@ int main(int argc, char **argv) {
|
|||
capture_init();
|
||||
|
||||
std::thread capture_thread(captureCall, capture_data);
|
||||
std::thread audio_thread(soundCall, &audio_data, capture_data);
|
||||
std::thread audio_thread;
|
||||
if(!override_data.no_audio)
|
||||
audio_thread = std::thread(soundCall, &audio_data, capture_data);
|
||||
|
||||
int ret_val = mainVideoOutputCall(&audio_data, capture_data, mono_app, created_proper_folder, recovery_mode);
|
||||
audio_thread.join();
|
||||
int ret_val = mainVideoOutputCall(&audio_data, capture_data, created_proper_folder, override_data);
|
||||
if(!override_data.no_audio)
|
||||
audio_thread.join();
|
||||
capture_thread.join();
|
||||
delete capture_data;
|
||||
end_extra_buttons_poll();
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ static bool poll_connection_window_screen(WindowScreen *screen, int &chosen_inde
|
|||
return false;
|
||||
}
|
||||
|
||||
static int choose_device(std::vector<CaptureDevice> *devices_list, FrontendData* frontend_data) {
|
||||
static int choose_device(std::vector<CaptureDevice> *devices_list, FrontendData* frontend_data, bool auto_connect_to_first) {
|
||||
if(devices_list->size() == 1)
|
||||
return 0;
|
||||
if(auto_connect_to_first)
|
||||
return 0;
|
||||
int chosen_index = CONNECTION_NO_DEVICE_SELECTED;
|
||||
frontend_data->top_screen->setup_connection_menu(devices_list);
|
||||
frontend_data->bot_screen->setup_connection_menu(devices_list);
|
||||
|
|
@ -61,7 +63,7 @@ void capture_error_print(bool print_failed, CaptureData* capture_data, std::stri
|
|||
}
|
||||
}
|
||||
|
||||
bool connect(bool print_failed, CaptureData* capture_data, FrontendData* frontend_data) {
|
||||
bool connect(bool print_failed, CaptureData* capture_data, FrontendData* frontend_data, bool auto_connect_to_first) {
|
||||
capture_data->status.new_error_text = false;
|
||||
if (capture_data->status.connected) {
|
||||
capture_data->status.close_success = false;
|
||||
|
|
@ -106,7 +108,7 @@ bool connect(bool print_failed, CaptureData* capture_data, FrontendData* fronten
|
|||
return false;
|
||||
}
|
||||
|
||||
int chosen_device = choose_device(&devices_list, frontend_data);
|
||||
int chosen_device = choose_device(&devices_list, frontend_data, auto_connect_to_first);
|
||||
if(chosen_device == CONNECTION_NO_DEVICE_SELECTED) {
|
||||
capture_error_print(print_failed, capture_data, "No device was selected");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -392,7 +392,6 @@ void insert_basic_pars(std::vector<const PARData*> &par_vector) {
|
|||
}
|
||||
|
||||
void reset_display_data(DisplayData* display_data) {
|
||||
display_data->split = false;
|
||||
display_data->last_connected_ds = false;
|
||||
}
|
||||
|
||||
|
|
@ -416,6 +415,12 @@ void reset_fullscreen_info(ScreenInfo &info) {
|
|||
info.fullscreen_mode_bpp = 0;
|
||||
}
|
||||
|
||||
void sanitize_enabled_info(ScreenInfo &top_bot_info, ScreenInfo &top_info, ScreenInfo &bot_info) {
|
||||
if((top_bot_info.window_enabled) || (top_info.window_enabled) || (bot_info.window_enabled))
|
||||
return;
|
||||
top_bot_info.window_enabled = true;
|
||||
}
|
||||
|
||||
void reset_screen_info(ScreenInfo &info) {
|
||||
info.is_blurred = false;
|
||||
info.crop_kind = 0;
|
||||
|
|
@ -454,6 +459,18 @@ void reset_screen_info(ScreenInfo &info) {
|
|||
info.in_colorspace_bot = FULL_COLORSPACE;
|
||||
info.frame_blending_top = NO_FRAME_BLENDING;
|
||||
info.frame_blending_bot = NO_FRAME_BLENDING;
|
||||
info.window_enabled = false;
|
||||
info.initial_pos_x = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
info.initial_pos_y = DEFAULT_NO_POS_WINDOW_VALUE;
|
||||
}
|
||||
|
||||
void override_set_data_to_screen_info(override_win_data &override_win, ScreenInfo &info) {
|
||||
info.initial_pos_x = override_win.pos_x;
|
||||
info.initial_pos_y = override_win.pos_y;
|
||||
if(override_win.enabled != DEFAULT_NO_ENABLED_VALUE)
|
||||
info.window_enabled = override_win.enabled;
|
||||
if((override_win.scaling != DEFAULT_NO_SCALING_VALUE) && (override_win.scaling > 0))
|
||||
info.scaling = override_win.scaling;
|
||||
}
|
||||
|
||||
static InputColorspaceMode input_colorspace_sanitization(int value) {
|
||||
|
|
@ -644,6 +661,10 @@ bool load_screen_info(std::string key, std::string value, std::string base, Scre
|
|||
info.frame_blending_bot = frame_blending_sanitization(std::stoi(value));
|
||||
return true;
|
||||
}
|
||||
if(key == (base + "window_enabled")) {
|
||||
info.window_enabled = frame_blending_sanitization(std::stoi(value));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -684,6 +705,7 @@ std::string save_screen_info(std::string base, const ScreenInfo &info) {
|
|||
out += base + "in_colorspace_bot=" + std::to_string(info.in_colorspace_bot) + "\n";
|
||||
out += base + "frame_blending_top=" + std::to_string(info.frame_blending_top) + "\n";
|
||||
out += base + "frame_blending_bot=" + std::to_string(info.frame_blending_bot) + "\n";
|
||||
out += base + "window_enabled=" + std::to_string(info.window_enabled) + "\n";
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
@ -798,12 +820,18 @@ void update_output(FrontendData* frontend_data, double frame_time, VideoOutputDa
|
|||
frontend_data->reload = false;
|
||||
}
|
||||
// Make sure the window is closed before showing split/non-split
|
||||
if(frontend_data->display_data.split)
|
||||
if(!frontend_data->joint_screen->m_info.window_enabled)
|
||||
frontend_data->joint_screen->draw(frame_time, out_buf);
|
||||
frontend_data->top_screen->draw(frame_time, out_buf);
|
||||
frontend_data->bot_screen->draw(frame_time, out_buf);
|
||||
if(!frontend_data->display_data.split)
|
||||
if(!frontend_data->top_screen->m_info.window_enabled)
|
||||
frontend_data->top_screen->draw(frame_time, out_buf);
|
||||
if(!frontend_data->bot_screen->m_info.window_enabled)
|
||||
frontend_data->bot_screen->draw(frame_time, out_buf);
|
||||
if(frontend_data->joint_screen->m_info.window_enabled)
|
||||
frontend_data->joint_screen->draw(frame_time, out_buf);
|
||||
if(frontend_data->top_screen->m_info.window_enabled)
|
||||
frontend_data->top_screen->draw(frame_time, out_buf);
|
||||
if(frontend_data->bot_screen->m_info.window_enabled)
|
||||
frontend_data->bot_screen->draw(frame_time, out_buf);
|
||||
}
|
||||
|
||||
static bool are_cc_device_screens_same(const CaptureDevice &old_cc_device, const CaptureDevice &new_cc_device) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user