Issue
Consolidate ThreadedAudioMode + ThreadedRenderer into unified ThreadedStrategy.
Background
Current architecture has coupled pair that cannot be swapped independently:
- ThreadedAudioMode: Handles lifecycle and simulation updates
- ThreadedRenderer: Handles rendering with cursor-chasing buffer
This creates unnecessary complexity and violates OCP.
Goal
Create ThreadedStrategy that unifies lifecycle and rendering:
- Single class implementing IAudioStrategy
- Uses IAudioHardwareProvider for platform-specific audio
- Handles cursor-chasing logic internally
- Manages circular buffer state
Implementation Plan
- Create ThreadedStrategy.h/cpp implementing IAudioStrategy
- Merge ThreadedAudioMode lifecycle methods into ThreadedStrategy
- Merge ThreadedRenderer rendering methods into ThreadedStrategy
- Inject IAudioHardwareProvider instead of using AudioUnit directly
- Manage CircularBuffer internally
- Maintain cursor-chasing diagnostics
Acceptance Criteria
- ThreadedStrategy.h/cpp created implementing IAudioStrategy
- Combines ThreadedAudioMode + ThreadedRenderer functionality
- Uses IAudioHardwareProvider for audio hardware access
- Maintains all cursor-chasing behavior (pre-fill, cursor tracking, underrun handling)
- All tests pass (existing ThreadedRenderer tests)
- Buffer math verified identical via deterministic tests
- Clean build with no warnings
Testing
- All existing ThreadedRenderer unit tests pass
- All existing ThreadedAudioMode unit tests pass
- Simulator-level audio tests produce identical output
- No behavioral changes (audio sounds identical)
Dependencies
Related Issues
Issue
Consolidate ThreadedAudioMode + ThreadedRenderer into unified ThreadedStrategy.
Background
Current architecture has coupled pair that cannot be swapped independently:
This creates unnecessary complexity and violates OCP.
Goal
Create ThreadedStrategy that unifies lifecycle and rendering:
Implementation Plan
Acceptance Criteria
Testing
Dependencies
Related Issues