Skip to content

v0.3.0 — First Proper Refactor

Choose a tag to compare

@Hornfisk Hornfisk released this 05 Apr 19:50
· 38 commits to master since this release

What's Changed

This is a pure structural refactor — no new features, no UI changes, no behavioral differences. The plugin should look and work exactly the same, but the codebase is now significantly cleaner and safer.

Audio-Thread Safety & Engine Cleanup

  • Eliminated Vec allocations on audio thread — replaced with fixed-size [0usize; 16] arrays in both sequencer process methods
  • Consolidated 10 individual atomics into SequencerSync struct — cleaner API between audio and GUI threads
  • Moved JSON persistence off audio thread — audio thread now sets a dirty flag; GUI thread handles serialization
  • Extracted advance_pattern_if_queued() helper — was duplicated 4× across sequencer methods
  • Removed dead sequencer methods and unused constants (DECAY_FADE_SECS, active_pattern_index(), etc.)
  • Fixed potential NaN panics in analysis (partial_cmp().unwrap() → total_cmp())
  • Fixed unwrap panic in logging — graceful /dev/null fallback on try_clone() failure
  • Replaced thread spawn expect() with error logging

Editor Decomposition

  • Extracted dialog rendering to new src/ui/dialogs.rs (~250 lines out of editor.rs, which dropped from 1478 → 1228 lines)
  • Consolidated 4 SetPad* action variants into single SetPadParam(pad, param, value)

Layout & UI Cleanup

  • Centralized layout constants in theme.rs (CELL_SPACING, GRID_VERT_RESERVED, STRIP_WIDTH, TAG_WIDTH, CONTROLS_WIDTH)
  • Added brighten() color helper — replaces inline interpolation in pad_row and sequencer_ui
  • Replaced scattered magic numbers with theme constants

Kit & Analysis Cleanup

  • DRY'd kit dice methods via assign_sample() helper (dice_all/dice_pad/dice_category shared identical logic)
  • Pre-allocated FFT buffer outside windowing loop in feature extraction
  • Trimmed unused adpcm symphonia feature from Cargo.toml

Stats

  • 17 files changed, 555 insertions, 492 deletions (net −60% in editor.rs)
  • 77/77 tests pass
  • Zero new clippy warnings

Full Changelog: v0.2.2...v0.3.0