Skip to content

[Option B] Consolidate SyncPullStrategy implementation #27

@danieljsinclair

Description

@danieljsinclair

Issue

Consolidate SyncPullAudioMode + SyncPullRenderer into unified SyncPullStrategy.

Background

Current architecture has coupled pair that cannot be swapped independently:

  • SyncPullAudioMode: Handles lifecycle and simulation updates
  • SyncPullRenderer: Handles on-demand rendering

This creates unnecessary complexity and violates OCP.

Goal

Create SyncPullStrategy that unifies lifecycle and rendering:

  • Single class implementing IAudioStrategy
  • Uses IAudioHardwareProvider for platform-specific audio
  • Handles on-demand rendering internally
  • No buffering (direct callback to bridge API)

Implementation Plan

  1. Create SyncPullStrategy.h/cpp implementing IAudioStrategy
  2. Merge SyncPullAudioMode lifecycle methods into SyncPullStrategy
  3. Merge SyncPullRenderer rendering methods into SyncPullStrategy
  4. Inject IAudioHardwareProvider instead of using AudioUnit directly
  5. Implement on-demand rendering (call bridge RenderOnDemand in callback)
  6. Maintain sync-pull diagnostics (timing, budget tracking)

Acceptance Criteria

  1. SyncPullStrategy.h/cpp created implementing IAudioStrategy
  2. Combines SyncPullAudioMode + SyncPullRenderer functionality
  3. Uses IAudioHardwareProvider for audio hardware access
  4. Maintains all sync-pull behavior (on-demand rendering, diagnostics)
  5. All tests pass (existing SyncPullRenderer tests)
  6. Clean build with no warnings

Testing

  • All existing SyncPullRenderer unit tests pass
  • All existing SyncPullAudioMode unit tests pass
  • Simulator-level audio tests produce identical output
  • No behavioral changes (audio sounds identical)

Dependencies

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions