Skip to content

Implement IAudioStrategy interface consolidation #22

@danieljsinclair

Description

@danieljsinclair

Issue Type

Implementation - Architecture Refactoring

Severity

High - Critical path for Option B implementation

Problem Statement

Current architecture has IAudioMode and IAudioRenderer as separate coupled interfaces, violating SRP and creating tight coupling. Need to consolidate into single IAudioStrategy interface.

Current State

  • IAudioMode (11 methods) - audio mode behavior
  • IAudioRenderer (4 methods) - rendering strategy
  • Coupled pairs: ThreadedAudioMode + ThreadedRenderer, SyncPullAudioMode + SyncPullRenderer
  • Cannot swap renderers independently
  • SRP violations: Each mode owns renderer creation in createContext()

Target State

Single IAudioStrategy interface combining lifecycle + rendering responsibilities:

  • getModeName() / getName() - diagnostics
  • updateSimulation() - simulation updates
  • generateAudio() / render() - audio rendering
  • startAudioThread() / configure() - lifecycle
  • createContext() - factory pattern
  • AddFrames() - buffer management

Implementation Tasks

  1. Design IAudioStrategy interface with clear method contracts
  2. Create IAudioStrategy.h with proper documentation
  3. Define acceptance criteria for implementations

Acceptance Criteria

  • IAudioStrategy.h interface created with clear method documentation
  • Interface combines lifecycle + rendering responsibilities (no splitting)
  • All methods have clear contracts and documentation
  • Interface follows SOLID principles (single responsibility, open/closed)
  • No coupling to specific implementations
  • Interface location: src/audio/IAudioStrategy.h

Testing Requirements

  • Interface can be mocked for unit tests
  • Clear injection points for DI
  • No circular dependencies introduced

Related Issues

References

  • ARCHITECTURE_FILE_CLASS_AUDIT.md - SRP violations identified
  • AUDIO_MODULE_ARCHITECTURE.md - Phase 6 consolidation plan

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