Skip to content

Consolidate ThreadedStrategy implementation #26

@danieljsinclair

Description

@danieljsinclair

Issue Type

Implementation - Architecture Refactoring

Severity

High - Critical path for Option B implementation

Problem Statement

ThreadedAudioMode and ThreadedRenderer are separate coupled classes. Need to consolidate into single ThreadedStrategy that combines lifecycle + rendering.

Current State

  • ThreadedAudioMode (11 methods) - mode lifecycle
  • ThreadedRenderer (4 methods) - cursor-chasing rendering
  • Tight coupling: ThreadedAudioMode creates ThreadedRenderer in createContext()
  • Cannot use ThreadedRenderer independently
  • SRP violation: Responsibility split across two classes

Target State

Single ThreadedStrategy class implementing IAudioStrategy:

  • Combines all ThreadedAudioMode + ThreadedRenderer functionality
  • Implements IAudioStrategy interface completely
  • Self-contained (no external renderer creation)
  • Maintains cursor-chasing rendering behavior
  • Preserves all existing functionality

Implementation Tasks

  1. Create ThreadedStrategy.h implementing IAudioStrategy
  2. Merge ThreadedAudioMode + ThreadedRenderer into ThreadedStrategy
  3. Remove ThreadedAudioMode + ThreadedRenderer files
  4. Update AudioPlayer to use ThreadedStrategy
  5. Ensure all existing tests pass

Acceptance Criteria

  • ThreadedStrategy.h/.cpp created implementing IAudioStrategy
  • All ThreadedAudioMode functionality migrated to ThreadedStrategy
  • All ThreadedRenderer functionality migrated to ThreadedStrategy
  • Old ThreadedAudioMode + ThreadedRenderer files removed
  • AudioPlayer updated to use ThreadedStrategy
  • All existing ThreadedRenderer tests pass
  • No functionality lost (behavior preserved)

Testing Requirements

  • ThreadedRenderer unit tests pass (9 tests)
  • Integration tests pass
  • Baseline regression tests pass (output identical)
  • No test failures introduced

Related Issues

References

  • ARCHITECTURE_FILE_CLASS_AUDIT.md - Coupling violations
  • AUDIO_MODULE_ARCHITECTURE.md - Phase 6 consolidation plan
  • test/unit/ThreadedRendererTest.cpp - Existing test coverage

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