Skip to content

Conversation

@yuto-trd
Copy link
Member

@yuto-trd yuto-trd commented Dec 5, 2025

Description

Add a new ComposeThread class to manage audio composition tasks on a dedicated thread, enhancing performance and responsiveness. Update existing audio processing methods to utilize the new dispatcher for thread-safe operations.

Breaking changes

No breaking changes introduced.

Fixed issues

No specific issues fixed.

Copilot AI review requested due to automatic review settings December 5, 2025 14:21
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

No TODO comments were found.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
Beutl.Operators 4% 0% 76
Beutl.Core 34% 31% 3142
Beutl.Engine 27% 24% 9792
Beutl.Threading 99% 90% 118
Beutl.Utilities 73% 67% 358
Beutl.Configuration 38% 19% 282
Beutl.Extensibility 2% 0% 105
Beutl.ProjectSystem 16% 10% 1852
Beutl.Language 0% 0% 656
Summary 27% (10547 / 39117) 25% (2804 / 11043) 16381

Minimum allowed line rate is 0%

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces a new ComposeThread class to manage audio composition tasks on a dedicated thread, following the same pattern as the existing RenderThread for graphics operations. The key changes include:

  • A new ComposeThread static class with a dedicated Dispatcher and reactive Scheduler
  • Updates to PlayerViewModel to execute audio composition on the ComposeThread
  • Updates to SampleProviderImpl to ensure thread-safe audio composition operations
  • A change in OutputViewModel from using RenderThread.Dispatcher.InvokeAsync to Task.Run

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/Beutl.Engine/Audio/Composing/ComposeThread.cs New dedicated thread class for audio composition, mirrors RenderThread pattern with Dispatcher and custom LocalScheduler
src/Beutl/ViewModels/PlayerViewModel.cs Updated FillAudioData to wrap audio composition in ComposeThread.Dispatcher.Invoke for thread safety
src/Beutl/Models/SampleProviderImpl.cs Refactored Sample method to check thread access and dispatch to ComposeThread, ensuring all composition happens on dedicated thread
src/Beutl/ViewModels/Tools/OutputViewModel.cs Changed encoding startup from RenderThread.Dispatcher.InvokeAsync to Task.Run, moving coordination to thread pool

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@yuto-trd yuto-trd merged commit 67d29c3 into main Dec 5, 2025
12 checks passed
@yuto-trd yuto-trd deleted the feat/compose-thread branch December 6, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants