mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-01-31 01:13:04 +09:00
Save replay/streaming recording to correct location when saving to game folder. Add controller hotkey to save 1 min/10 min replay
This commit is contained in:
BIN
images/ps4_cross.png
Normal file
BIN
images/ps4_cross.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/ps4_triangle.png
Normal file
BIN
images/ps4_triangle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -21,6 +21,8 @@ namespace gsr {
|
||||
bool start();
|
||||
// Currently valid ids:
|
||||
// save_replay
|
||||
// save_1_min_replay
|
||||
// save_10_min_replay
|
||||
// take_screenshot
|
||||
// toggle_record
|
||||
// toggle_replay
|
||||
@@ -56,6 +58,8 @@ namespace gsr {
|
||||
bool right_pressed = false;
|
||||
|
||||
bool save_replay = false;
|
||||
bool save_1_min_replay = false;
|
||||
bool save_10_min_replay = false;
|
||||
bool take_screenshot = false;
|
||||
bool toggle_record = false;
|
||||
bool toggle_replay = false;
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace gsr {
|
||||
mgl::Texture ps4_dpad_down_texture;
|
||||
mgl::Texture ps4_dpad_left_texture;
|
||||
mgl::Texture ps4_dpad_right_texture;
|
||||
mgl::Texture ps4_cross_texture;
|
||||
mgl::Texture ps4_triangle_texture;
|
||||
|
||||
double double_click_timeout_seconds = 0.4;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.4.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
project('gsr-ui', ['c', 'cpp'], version : '1.5.0', default_options : ['warning_level=2', 'cpp_std=c++17'], subproject_dir : 'depends')
|
||||
|
||||
if get_option('buildtype') == 'debug'
|
||||
add_project_arguments('-g3', language : ['c', 'cpp'])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "gsr-ui"
|
||||
type = "executable"
|
||||
version = "1.4.0"
|
||||
version = "1.5.0"
|
||||
platforms = ["posix"]
|
||||
|
||||
[lang.cpp]
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
namespace gsr {
|
||||
static constexpr int button_pressed = 1;
|
||||
static constexpr int cross_button = 0;
|
||||
static constexpr int triangle_button = 2;
|
||||
static constexpr int options_button = 9;
|
||||
static constexpr int playstation_button = 10;
|
||||
static constexpr int axis_up_down = 7;
|
||||
@@ -104,6 +106,20 @@ namespace gsr {
|
||||
it->second("save_replay");
|
||||
}
|
||||
|
||||
if(save_1_min_replay) {
|
||||
save_1_min_replay = false;
|
||||
auto it = bound_actions_by_id.find("save_1_min_replay");
|
||||
if(it != bound_actions_by_id.end())
|
||||
it->second("save_1_min_replay");
|
||||
}
|
||||
|
||||
if(save_10_min_replay) {
|
||||
save_10_min_replay = false;
|
||||
auto it = bound_actions_by_id.find("save_10_min_replay");
|
||||
if(it != bound_actions_by_id.end())
|
||||
it->second("save_10_min_replay");
|
||||
}
|
||||
|
||||
if(take_screenshot) {
|
||||
take_screenshot = false;
|
||||
auto it = bound_actions_by_id.find("take_screenshot");
|
||||
@@ -186,10 +202,27 @@ namespace gsr {
|
||||
return;
|
||||
|
||||
if((event.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) {
|
||||
if(event.number == playstation_button)
|
||||
playstation_button_pressed = event.value == button_pressed;
|
||||
else if(playstation_button_pressed && event.number == options_button && event.value == button_pressed)
|
||||
toggle_show = true;
|
||||
switch(event.number) {
|
||||
case playstation_button: {
|
||||
playstation_button_pressed = event.value == button_pressed;
|
||||
break;
|
||||
}
|
||||
case options_button: {
|
||||
if(playstation_button_pressed && event.value == button_pressed)
|
||||
toggle_show = true;
|
||||
break;
|
||||
}
|
||||
case cross_button: {
|
||||
if(playstation_button_pressed && event.value == button_pressed)
|
||||
save_1_min_replay = true;
|
||||
break;
|
||||
}
|
||||
case triangle_button: {
|
||||
if(playstation_button_pressed && event.value == button_pressed)
|
||||
save_10_min_replay = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if((event.type & JS_EVENT_AXIS) == JS_EVENT_AXIS && playstation_button_pressed) {
|
||||
const int trigger_threshold = 16383;
|
||||
const bool prev_up_pressed = up_pressed;
|
||||
|
||||
@@ -385,6 +385,16 @@ namespace gsr {
|
||||
overlay->save_replay();
|
||||
});
|
||||
|
||||
global_hotkeys_js->bind_action("save_1_min_replay", [overlay](const std::string &id) {
|
||||
fprintf(stderr, "pressed %s\n", id.c_str());
|
||||
overlay->save_replay_1_min();
|
||||
});
|
||||
|
||||
global_hotkeys_js->bind_action("save_10_min_replay", [overlay](const std::string &id) {
|
||||
fprintf(stderr, "pressed %s\n", id.c_str());
|
||||
overlay->save_replay_10_min();
|
||||
});
|
||||
|
||||
global_hotkeys_js->bind_action("take_screenshot", [overlay](const std::string &id) {
|
||||
fprintf(stderr, "pressed %s\n", id.c_str());
|
||||
overlay->take_screenshot();
|
||||
@@ -1707,7 +1717,7 @@ namespace gsr {
|
||||
|
||||
const std::string video_filepath = filepath_get_filename(line);
|
||||
if(starts_with(video_filepath, "Video_")) {
|
||||
on_stop_recording(0, video_filepath);
|
||||
on_stop_recording(0, line);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,12 @@ namespace gsr {
|
||||
if(!theme->ps4_dpad_right_texture.load_from_file((resources_path + "images/ps4_dpad_right.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP}))
|
||||
goto error;
|
||||
|
||||
if(!theme->ps4_cross_texture.load_from_file((resources_path + "images/ps4_cross.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP}))
|
||||
goto error;
|
||||
|
||||
if(!theme->ps4_triangle_texture.load_from_file((resources_path + "images/ps4_triangle.png").c_str(), mgl::Texture::LoadOptions{false, false, MGL_TEXTURE_SCALE_LINEAR_MIPMAP}))
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
|
||||
@@ -420,6 +420,8 @@ namespace gsr {
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_options_texture, get_theme().body_font.get_character_size(), "to show/hide the UI"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_dpad_up_texture, get_theme().body_font.get_character_size(), "to take a screenshot"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_dpad_down_texture, get_theme().body_font.get_character_size(), "to save a replay"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_cross_texture, get_theme().body_font.get_character_size(), "to save a 1 minute replay"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_triangle_texture, get_theme().body_font.get_character_size(), "to save a 10 minute replay"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_dpad_left_texture, get_theme().body_font.get_character_size(), "to start/stop recording"));
|
||||
list_ptr->add_widget(create_joystick_hotkey_text(&get_theme().ps4_home_texture, &get_theme().ps4_dpad_right_texture, get_theme().body_font.get_character_size(), "to turn replay on/off"));
|
||||
return subsection;
|
||||
|
||||
Reference in New Issue
Block a user