Skip to content

Repository files navigation

Replay Buffer Sleep

Introduction

Windows OBS plugin that stops replay buffer before system sleep and starts it again after resume if it had been running.

Behavior

  • Uses a hidden Win32 window to receive WM_POWERBROADCAST.
  • Stops replay buffer on PBT_APMSUSPEND.
  • Restarts replay buffer on PBT_APMRESUMEAUTOMATIC after a short timer-based delay.
  • Only restarts if replay buffer was active before suspend.

Resume Delay

The wake delay defaults to 2000 ms.

You can change it from OBS via:

Tools -> Replay Buffer Sleep Settings

Or edit the plugin config file directly:

[ReplayBufferSleep]
ResumeDelayMs=10000

On Windows, the file should be here:

%APPDATA%\obs-studio\plugin_config\replay-buffer-sleep\settings.ini

The plugin logs the active delay on load.

Design

  • C++ for the small Qt settings dialog.
  • Uses OBS frontend APIs for replay buffer control and the Tools menu dialog.
  • Clears OBS's Windows sleep inhibition shortly after replay buffer starts.

Supported Build Environments

Platform Tool
Windows Visual Studio 17 2022
Windows CMake 3.30.5

Quick Start

An absolute bare-bones Quick Start Guide is available in the wiki.

GitHub Actions & CI

GitHub Actions workflows are configured for Windows builds.

  • push: Run for commits or tags pushed to master or main branches.
  • pr-pull: Run when a Pull Request has been pushed or synchronized.
  • dispatch: Run when triggered by the workflow dispatch in GitHub's user interface.
  • build-project: Builds the actual project and is triggered by other workflows.
  • check-format: Checks CMake and plugin source code formatting and is triggered by other workflows.

The workflows make use of GitHub repository actions (contained in .github/actions) and build scripts (contained in .github/scripts) which are not needed for local development, but might need to be adjusted if additional/different steps are required to build the plugin.

Retrieving build artifacts

Successful builds on GitHub Actions will produce build artifacts that can be downloaded for testing. These artifacts are commonly simple archives and will not contain package installers or installation programs.

Building a Release

To create a release, push a semantic-version tag such as 0.1.0 to the default branch.

About

Plugin for OBS that stops/starts replay buffer when the Windows system goes to sleep/wakes up.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages