-
Couldn't load subscription status.
- Fork 7
Migrate to FMOD 2.03.09 with test harnesses #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
BREAKING CHANGE: System::getVersion returns (version, buildnumber) BREAKING CHANGE: FMOD_ADVANCEDSETTINGS.commandQueueSize removed - Add examples: verify_203, play_sound, run_fmod.sh - Add field filtering for 2.03 API changes - Audio playback confirmed working #1
- Bank loading and management (files/memory) - Event playback with sound variations - Real-time parameter control (RPM, surfaces, volume/pitch) - Uses FMOD 2.03.09 SDK example banks - All Studio features confirmed working #1
| for file in "$PROCESSED_PATH"/api/core/inc/*.h "$PROCESSED_PATH"/api/studio/inc/*.h; do | ||
| if [ -f "$file" ]; then | ||
| # Comment out lines containing ##__VA_ARGS__ (these are just logging macros) | ||
| sed -i 's/^\(.*##__VA_ARGS__.*\)$/\/\/ FMOD_2_03_VARIADIC_MACRO: \1/' "$file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is key change I see to support FMOD API 2.03
It can't be merged because it's difficult to maintain bash scripts with regexp. By design it should be implemented at the parser level in libfmod-gen/src/grammars.
| use libfmod::{Studio, StudioInit, Init, LoadBank, StopMode, Vector, Attributes3d}; | ||
| use std::{thread, time::Duration}; | ||
|
|
||
| fn main() -> Result<(), Box<dyn std::error::Error>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks cool. But I can't accept and maintain 1,000+ lines of code that isn't directly related to the library or unit tests. I'd prefer it to be a separate project like libfmod-harness-demo, which we can link to in the library's README.
| @@ -0,0 +1,84 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not ready to accept any of the proposed bash scripts for security reasons (I have no way to validate that they don't do anything extra =)
| } | ||
| }; | ||
| } | ||
| macro_rules! move_string_to_c { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| F: FnMut(T) -> O, | ||
| { | ||
| let mut values = values.into_iter().map(map).collect::<Vec<O>>(); | ||
| let pointer = values.as_mut_ptr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
|
|
||
| impl Api { | ||
| // FMOD 2.03.09: Filter out removed/renamed fields | ||
| pub fn should_skip_field(&self, structure: &str, field: &str) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an incorrect implementation. If fields are removed from the API, they simply won't be generated.
|
|
||
| assert_eq!(FMOD_VERSION, "2.03.09"); | ||
| assert_eq!(EXPECTED_VERSION, 0x00020309); | ||
| println!("✓ Version constants updated to 2.03.09"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a lot of useless code generated by AI, I can’t accept it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP, thanks for the review! I'll take care of it.
- Replace Unicode with ASCII characters for terminal compatibility - Fix line endings with \r\n - Add RPM parameter to vehicles - Handle one-shot events properly (footsteps, explosions) - Set surface parameter for footsteps
libfmod/src/lib.rs
Outdated
| std::mem::forget(values); | ||
| pointer | ||
| let values = values.into_iter().map(map).collect::<Vec<O>>(); | ||
| Box::into_raw(values.into_boxed_slice()) as *mut _ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of these are "wrong"
should be Box::leak(values.into_boxed_slice()) as *mut _
- vec_as_mut_ptr, ASIO lists, CString fields, DSP paramdesc - Regenerate lib.rs with fixes Per PR lebedec#23 feedback
Summary
Migrates libfmod from FMOD 2.02.22 to 2.03.09 and adds comprehensive test harnesses for validating the migration and
demonstrating FMOD Studio features.
Changes
Migration (09dc708)
Test Infrastructure (e5b1983, 3f4acc6, 33e31d2)
harness_demo- Automated demos of 3D spatial audio, event parameters, footstepsinteractive_harness- Interactive keyboard-controlled 3D audio testingrun_fmod.sh- Helper script for running examples with correct library pathsTesting
All examples tested on Linux x86_64 with FMOD 2.03.09. Run with:
cd libfmod ./run_fmod.sh harness_demo ./run_fmod.sh interactive_harness Breaking Changes - Requires FMOD SDK 2.03.09 - Not ABI compatible with FMOD 2.02.x