Skip to content

Commit

Permalink
Merge pull request #272 from tjk113/master
Browse files Browse the repository at this point in the history
Main/Chg: End captures when movie playback stops or loops
  • Loading branch information
Aurumaker72 authored Mar 7, 2025
2 parents f77c6b1 + 8dfd4b6 commit 2c97567
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Core/include/core_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ typedef struct {
void (*ai_len_changed)();
void (*play_movie)(void);
void (*stop_movie)(void);
void (*loop_movie)(void);
void (*save_state)(void);
void (*load_state)(void);
void (*reset)(void);
Expand Down
1 change: 1 addition & 0 deletions src/Core/r4300/vcr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ void vcr_handle_playback(int32_t index, core_buttons* input)

if (g_core->cfg->is_movie_loop_enabled)
{
g_core->callbacks.loop_movie();
core_vcr_start_playback(g_movie_path);
return;
}
Expand Down
10 changes: 9 additions & 1 deletion src/Views.Win32/gui/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,15 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
g_core.callbacks.interval = LuaService::call_interval;
g_core.callbacks.ai_len_changed = FrontendService::ai_len_changed;
g_core.callbacks.play_movie = LuaService::call_play_movie;
g_core.callbacks.stop_movie = LuaService::call_stop_movie;
g_core.callbacks.stop_movie = [] {
LuaService::call_stop_movie();
if (EncodingManager::is_capturing())
EncodingManager::stop_capture();
};
g_core.callbacks.loop_movie = [] {
if (EncodingManager::is_capturing())
EncodingManager::stop_capture();
};
g_core.callbacks.save_state = LuaService::call_save_state;
g_core.callbacks.load_state = LuaService::call_load_state;
g_core.callbacks.reset = LuaService::call_reset;
Expand Down

0 comments on commit 2c97567

Please sign in to comment.