← Back to Pull requests

Make the Capture and Send buttons toggles so a capture or send can be stopped #15

Closed
unknown closed this pull request without merging on Jul 18, 2026 07:30 UTC
View on GitHub
unknown unknown commented on Jul 14, 2026 09:44 UTC
Author

Rebased onto current master and rewritten from scratch. The previous mess was my fork being 28 commits behind without me realising. Sorry for the wasted time; this should be a much easier read.

Answering your three points:

1. What problem is this solving?

Three concrete things, all of which I've hit in real use:

  • There's no way to stop a capture or send. Once you press Capture, it runs for the lifetime of the plug-in instance. You can't deselect an entry in a drop-down list, so there's no path back to "not capturing" short of removing or bypassing the plug-in.

  • Nothing tells you whether it's running. A push button has no state. Reopen the FX window, or open a saved project, and the UI looks identical whether or not audio is being captured. This is worse with a screen reader: a push button exposes no state at all, whereas a checkbox-style toggle is announced as pressed or not pressed, so you can tell at a glance (or a keypress) what's actually happening.

  • The settings look live while a capture is running, but aren't. You can pick a different process mid-capture and nothing happens until you press Capture again, which is misleading.
  • So: the buttons become toggles (BS_AUTOCHECKBOX | BS_PUSHLIKE), pressing again stops the capture or send, and the settings that can't take effect mid-run are disabled.

    2. In2Clap

    Included this time. All three plug-ins get the same treatment.

    3. Refactoring vs functional change

    Split into separate commits:

    1. dev: Move the code which starts a capture or send out of activate() and into a separate function so that the caller can handle failure. — pure refactor, no functional change. The moved bodies are character-identical to the originals; git show --color-moved=zebra on that commit shows this clearly. The reason it's needed: activate() now has to not fail when the user simply hasn't pressed the button, and has to un-press the button if starting fails. Since the setup code has a dozen early return false paths, the caller needs to be able to see that failure and act on it, which means it can't be activate() itself.
    2. The toggles.
    3. Disabling the settings which can't change while running.

    Note on state

    Nothing is added to the saved state, so STATE_VERSION is unchanged in all three plug-ins and stateSave isn't touched. As you suggested, _capturing / _sending defaults to false and stateLoad derives it from what's already saved, which is exact rather than a guess: we only ever save a target once the user has pressed the button. In App2Clap that means "capture everything" or "capture first matching process when reloaded"; in Clap2App and In2Clap it means a saved device. Everything else (a specific process id) was never resumable anyway, since we don't save the pid.

    Tested in REAPER: App2Clap and In2Clap, including stopping and restarting a capture, changing process mid-session, and resuming a saved capture from a project template.

    Diff: 371 lines (+278 / -93) across 4 files Reviewer: jcsteh Review duration: 5625m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 371 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.354
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #15"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.8% (MEDIUM) · Higher = larger blast radius
    42.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%