Fix audio preview (AudioBuffer redesign) and insert-to-DAW drag initiation#23
Merged
Conversation
Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com> Agent-Logs-Url: https://github.com/audiohacking/acestep-vst/sessions/ac515d13-0418-4bde-9b91-9791c5621343
Copilot
AI
changed the title
[WIP] Fix broken audio preview playback and insert to DAW
Fix audio preview (AudioBuffer redesign) and insert-to-DAW drag initiation
Mar 22, 2026
lmangani
marked this pull request as ready for review
March 22, 2026 20:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two broken features in the Library tab: audio preview produced silence, and "Insert into DAW" created file copies instead of initiating a DAW drag.
Audio Preview —
PluginPreviewredesignAudioTransportSourcewas silently failing:setSource()called from the message thread requires preciseprepareToPlay()ordering and a proper buffering/thread strategy that wasn't in place.Replaced with a straightforward
AudioBuffer<float>-backed implementation:loadFile()decodes the entire file into memory; linear-interpolation resampling applied at load time when source ≠ DAW sample rateplay()/stop()flipstd::atomic<int> playPos_— no locksrender()copies from the in-memory buffer using the atomic position;ScopedTryLockkeeps the audio thread wait-free during concurrentloadFile()callsPluginProcessor.cppuntouchedInsert to DAW — drag from
mouseDrag, notonClickperformExternalDragDropOfFiles()requires an active mouse press; calling it fromonClick(mouse-up) is a no-op on macOS, causing the fallback to reveal the file in Finder — which DAWs then import as a copy.Added
InsertDawDragListener(ajuce::MouseListenerinner struct oninsertDawButton_):A plain click (no drag) still falls back to revealing the file and copying the path to the clipboard.
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.