Skip to content

IMFFile | IMFDriver | IMF example - #298

Merged
Raffaello merged 14 commits into
masterfrom
imf
Jun 5, 2026
Merged

IMFFile | IMFDriver | IMF example#298
Raffaello merged 14 commits into
masterfrom
imf

Conversation

@Raffaello

@Raffaello Raffaello commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • IMF audio file support and playback via a new OPL-backed driver
    • New example demonstrating IMF playback across OPL emulator/configurations
  • Bug Fixes

    • Improved audio mixer error handling and logging for stream operations
    • Ensured OPL drivers stop cleanly during shutdown
  • Tests

    • Added unit tests covering IMF file loading and validation
  • Chores

    • Project version bumped to 0.19.2
    • Spell checker allowlist updated

@Raffaello Raffaello self-assigned this Jun 4, 2026
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds IMF file parsing and an OPL-backed IMF playback driver, integrates an example and tests, and hardens audio mixer and ADL driver lifecycle handling; also bumps project version and updates cspell allowlist.

Changes

IMF Format and Playback System

Layer / File(s) Summary
IMF file parser
src/HyperSonicDrivers/files/IMFFile.hpp, src/HyperSonicDrivers/files/IMFFile.cpp, test/HyperSonicDrivers/files/TestIMFFile.cpp, test/HyperSonicDrivers/CMakeLists.txt
Adds IMFFile parsing for Type-0 IMF payloads and optional metadata tags; includes unit tests and test fixture wiring.
IMF playback driver
src/HyperSonicDrivers/drivers/opl/IMFDriver.hpp, src/HyperSonicDrivers/drivers/opl/IMFDriver.cpp, hyper-sonic-drivers/CMakeLists.txt
Implements IMFDriver driving OPL via timer callbacks (set/play/stop/isPlaying) and wires source files into the static library.
Example program and build integration
examples/imf-example.cpp, hyper-sonic-drivers/examples/CMakeLists.txt
New example iterates OPL emulator/type combinations, plays 02.imf via IMFDriver, and registers example target with fixture.
RtAudio Mixer lifecycle and logging
src/HyperSonicDrivers/audio/rtaudio/Mixer.cpp
Logs selected output device info and checks openStream/startStream/stopStream return codes against RTAUDIO_NO_ERROR, logging errors on failure.
ADL driver lifecycle and cleanup
src/HyperSonicDrivers/drivers/westwood/ADLDriver.cpp
Renames timer constant to CALLBACKS_PER_SECOND and ensures m_opl->stop() is called in destructor.
Version bump and spell-check allowlist
CMakeLists.txt, cspell.json
Project version bumped to 0.19.2; cspell.json adds cstor, SBFM, TANDY, and WONDERIN to allowlist.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

enhancement, example

"I'm a rabbit with a tiny drum,
parsing packets, one by one,
OPL ticks and register hum,
examples play till playback's done,
tests and CMake—hop!—we've won." 🐇🎶

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding IMFFile support, IMFDriver implementation, and an example program demonstrating IMF playback.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch imf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production

codacy-production Bot commented Jun 4, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high · 3 medium

Alerts:
⚠ 4 issues (≤ 0 issues of at least minor severity)

Results:
4 new issues

Category Results
BestPractice 3 medium
ErrorProne 1 high

View in Codacy

🟢 Metrics 39 complexity

Metric Results
Complexity 39

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@Raffaello
Raffaello marked this pull request as ready for review June 5, 2026 13:14
coderabbitai[bot]

This comment was marked as outdated.

@Raffaello

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]

This comment was marked as resolved.

@Raffaello Raffaello changed the title [wip] IMFFile IMFFile | IMFDriver | IMF example Jun 5, 2026
@Raffaello Raffaello added enhancement New feature or request example related to how to use the library driver driver related file I/O file related labels Jun 5, 2026
@github-project-automation github-project-automation Bot moved this to In progress in Audio Files Jun 5, 2026
@Raffaello Raffaello added this to OPL Jun 5, 2026
@github-project-automation github-project-automation Bot moved this to In progress in OPL Jun 5, 2026
@Raffaello Raffaello linked an issue Jun 5, 2026 that may be closed by this pull request
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
8.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@Raffaello
Raffaello merged commit 69535db into master Jun 5, 2026
16 of 18 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in OPL Jun 5, 2026
@github-project-automation github-project-automation Bot moved this from In progress to Done in Audio Files Jun 5, 2026
@Raffaello
Raffaello deleted the imf branch June 5, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

driver driver related enhancement New feature or request example related to how to use the library file I/O file related

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

IMF file music format

1 participant