chore: Add Lua sample scripts and sync fixes with Python variants#141
Open
hanatyan128 wants to merge 10 commits intodevfrom
Open
chore: Add Lua sample scripts and sync fixes with Python variants#141hanatyan128 wants to merge 10 commits intodevfrom
hanatyan128 wants to merge 10 commits intodevfrom
Conversation
Open
|
I have tested the script and it seems to work very well.
My works flow is I have modified the script for 4 simultaneous streams to be easier for volunteers. |
f9a2238 to
90cd399
Compare
90cd399 to
288b272
Compare
Add Lua variants of recording-filename-from-text and replay-buffer-filename-from-text sample scripts. Both include: - Robust filename sanitization (control chars, trailing dots/spaces, Windows reserved names) - UTF-8 BOM stripping and UTF-16 detection - 4 KB read size limit for safety - Filter id verification before proc calls - Proper cleanup on filter selection change and script reload Enhance API.md and API_ja.md with: - Threading and call context requirements - Filter source acquisition guide - osi_branch_output_get_filter_list notes (post_load timing, private source exclusion) - Sample scripts section covering both Python and Lua variants Update README TIPS sections to mention both Python and Lua variants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align recording/replay-buffer filename-from-text sample scripts so the Lua and Python variants share the same robustness fixes: version note corrected to v1.0.9+, override_cleared flag to suppress redundant proc calls, enhanced sanitize_filename (control chars, trailing dots/spaces, Windows reserved names), BOM handling with 4KB read limit, old-filter override clearing on selection change, filter ID validation with proc return-value logging, and defensive timer_remove in script_load. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- onGetFilterList: dispatch to UI thread via QMetaObject::invokeMethod, with same-thread direct-call fallback to avoid BlockingQueuedConnection self-deadlock; null-out statusDock on module unload - Sample scripts: reset last_text (and throttle state) on clear_override, warn on empty file path, extend Windows reserved-name check to cover base names with extensions (e.g. CON.txt) - API docs: revise threading notes and add call-context guidance for osi_branch_output_get_filter_list Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…etime Round 1-3 review findings across sample scripts and related native code: - Lua sanitize_filename now normalizes NBSP/U+3000/ZWSP/U+2028/U+2029/BOM - Document Windows ANSI code page limitation of Lua io.open - statusDock promoted to std::atomic and unpublished before dock teardown - Clarify callback safety and hotkey context in API docs - Document lock ordering and proc_handler lifetime in native code Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the per-byte-sequence gsub chain in sanitize_filename() with a utf8.codes() walk driven by a strip/space lookup. Also folds the en/em space family (U+2000–200A) for parity with the Python variant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Lua: replace Lua 5.3 utf8 library with LuaJIT-compatible manual
UTF-8 decoder/encoder (utf8_codepoints, cp_to_utf8), removing
dead code and misleading pcall warning
- C++: change JSON fallback from empty string to '{}' for safer
downstream parsing
- Python: wrap calldata_create/calldata_free in try/finally to
prevent leaks on exception
- Python: add MAX_SANITIZED_LENGTH=128 to sanitize_filename to
avoid exceeding Windows MAX_PATH
Lua/Python scripts: - Truncate sanitized filenames to 200 bytes with UTF-8 boundary respect - Call clear_override() when text source is deselected in script_update() - Validate empty base_format to prevent ambiguous empty overrides (Lua) - Add group source limitation note to script_description() C++: - Use statusDock.store() instead of implicit operator= for consistency - Fix comment: 'acquire/release semantics' -> 'sequential consistency' - Clarify Q_DECLARE_METATYPE comment as qRegisterMetaType safety net
Trim review-round artifacts where long justification comments were added to defend design choices. Replace prose with concise FIXMEs where the root-cause fix is deferred. Drop internal-implementation details from API.md / API_ja.md that callers do not need. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Defer last_text update to proc call success to prevent failed calls from being silently swallowed on subsequent ticks - Fix 4-branch new_format logic in Python to match Lua (trailing space, unintended clear when base_format is empty) - Add UTF-8 validation for non-UTF-8 file content (CP932 etc.) - Add cp_to_utf8 surrogate-half guard - Detect and warn on file truncation at MAX_READ_SIZE - Unify sanitize_filename step order with Python variant - Move MAX_FILENAME_BYTES to module-level constants - Log warning on JSON parse failure - Remove redundant state resets after clear_override()
288b272 to
40ec4c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
recording-filename-from-textandreplay-buffer-filename-from-text, mirroring the existing Python variants.API.md/API_ja.mdwith a "Threading and Call Context" section, an "Obtaining the Filter Source" walkthrough, and notes onosi_branch_output_get_filter_list(private source exclusion,obs_module_post_load()timing, snapshot semantics).override_clearedflag, enhancedsanitize_filename(control chars / trailing dots/spaces / Windows reserved names), UTF-8/UTF-16 BOM handling with 4KB read limit, old-filter override clearing on selection change, filter ID validation with proc return-value logging, and a defensivetimer_removeinscript_load.Test plan
timer_remove+timer_add🤖 Generated with Claude Code