Skip to content

feat: Add per-output enable/disable hotkeys#131

Merged
hanatyan128 merged 3 commits into
devfrom
feat-individual-output-start-stop-hotkeys
Apr 5, 2026
Merged

feat: Add per-output enable/disable hotkeys#131
hanatyan128 merged 3 commits into
devfrom
feat-individual-output-start-stop-hotkeys

Conversation

@hanatyan128

@hanatyan128 hanatyan128 commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add per-output enable/disable hotkeys for each output type (streaming/recording/replay buffer) in Branch Output filters
  • Streaming supports both all-slots-at-once and per-slot (up to 8) hotkey pairs
  • Add outputUserEnabledChanged signal for immediate status dock checkbox sync on hotkey press
  • Include code review fixes: unregisterAllHotkeys() helper extraction, obs_filter_get_parent() null check, Qt::QueuedConnection thread safety fix
  • Add 8 new hotkey locale strings to all 10 locale files

Changes

New hotkeys

Hotkey Description
Enable/Disable All Streaming Enable/disable all streaming slots at once
Enable/Disable Streaming Service N Enable/disable individual slot (1-8)
Enable/Disable Recording Enable/disable recording
Enable/Disable Replay Buffer Enable/disable replay buffer

Code quality improvements

  • Extract unregisterAllHotkeys() helper method (deduplicate registerHotkey() / removeCallback())
  • Add obs_filter_get_parent() null check in registerHotkey()
  • Document OBS hotkey persistence mechanism (name-string-based keybinding restoration) in comments
  • Explicitly specify Qt::QueuedConnection for outputUserEnabledChanged signal connection (cross-thread UI safety)
  • Add uninitialized members to constructor initializer list

Test plan

  • Add filter in OBS Studio and verify new hotkeys appear in Settings > Hotkeys
  • Verify streaming-related hotkeys are hidden when streaming is disabled
  • Assign each hotkey and verify pressing it toggles the output enable/disable state
  • Verify status dock checkboxes update immediately on hotkey press
  • Verify hotkey bindings are preserved after settings changes
  • Verify hotkey bindings are preserved after filter rename
  • Verify hotkey bindings are restored after OBS restart
  • Verify no crashes on filter removal or OBS shutdown

🤖 Generated with Claude Code

@hanatyan128 hanatyan128 mentioned this pull request Apr 5, 2026
@hanatyan128
hanatyan128 force-pushed the feat-individual-output-start-stop-hotkeys branch from a0d7883 to e40a416 Compare April 5, 2026 15:26
hanatyan128 and others added 3 commits April 6, 2026 00:50
… recording, and replay buffer control

Register OBS hotkeys to individually enable/disable each output type:
- Enable/Disable All Streaming (independent hotkeys)
- Enable/Disable Streaming Service 1-8 (paired hotkeys per slot)
- Enable/Disable Recording (paired hotkey)
- Enable/Disable Replay Buffer (paired hotkey)

Hotkey callbacks set the userEnabled intent flags and call the
corresponding *Individual() methods. Per-slot streaming callbacks
resolve the slot index by matching obs_hotkey_pair_id against the
stored ID array.

Also refactor existing hotkey callbacks to their respective files:
streaming → plugin-streaming.cpp, recording → plugin-stream-recording.cpp,
replay buffer → plugin-replay-buffer.cpp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…fixes

- Emit outputUserEnabledChanged signal from setters when value changes,
  connected to status dock for immediate checkbox sync on hotkey press
- Fix hotkey pair toggle logic: return false when already in desired state
  so OBS correctly alternates enable/disable callbacks
- Move setRecordingUserEnabled/setReplayBufferUserEnabled to cpp files
- Add serviceCount check inside isStreamingEnabled to prevent stale slots
- Register hotkeys conditionally based on enabled output types
- Translate hotkey locale strings for all supported languages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, fix thread safety

- Extract unregisterAllHotkeys() helper to eliminate duplicate hotkey
  unregistration code in registerHotkey() and removeCallback()
- Add obs_filter_get_parent() null check in registerHotkey()
- Initialize togglePauseRecordingHotkeyPairId and addChapterToRecordingHotkeyId
  in constructor initializer list to avoid undefined behavior
- Use Qt::QueuedConnection for outputUserEnabledChanged signal connection
  to ensure UI updates run on the UI thread when emitted from OBS core thread
- Remove trailing blank lines before closing braces in streaming hotkey functions
- Document OBS hotkey persistence mechanism (name-string-based keybinding
  restoration) in registerHotkey() comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hanatyan128
hanatyan128 force-pushed the feat-individual-output-start-stop-hotkeys branch from e40a416 to aefaa6e Compare April 5, 2026 15:50
@hanatyan128
hanatyan128 merged commit 54bf832 into dev Apr 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to start/stop streaming/stream recording/replay buffer individually

1 participant