-
-
Notifications
You must be signed in to change notification settings - Fork 51
Add element preview (images/videos/audio), video speed/loop props, and preview toggle #1436
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
Conversation
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.
💡 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".
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.
Pull request overview
This PR implements a comprehensive element preview system for the Beutl application, adding visual feedback for video (thumbnails) and audio (waveforms) elements in the timeline. The implementation includes new custom controls for rendering previews,ViewModel integration for managing preview data, serialization support for preview preferences, and operator implementations that provide preview data through a new interface. Additionally, video sources now support speed and loop properties.
Key Changes
- Added
IElementPreviewProviderinterface with implementations inSourceVideoOperatorandSourceSoundOperatorto generate thumbnails and waveform data respectively - Introduced
WaveformControlandThumbnailStripControlcustom Avalonia controls to render audio waveforms and video thumbnails in the timeline - Extended
ElementViewModelwith preview management logic including cancellation, throttling, and invalidation handling
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
src/Beutl/Views/WaveformControl.cs |
New control for rendering audio waveform visualization with thread-safe chunk updates |
src/Beutl/Views/ThumbnailStripControl.cs |
New control for rendering video thumbnail strips with proper bitmap disposal |
src/Beutl/Views/ElementView.axaml.cs |
Wires up preview controls to ElementViewModel events for thumbnail and waveform updates |
src/Beutl/Views/ElementView.axaml |
Adds preview controls to the UI and toggle menu item for disabling previews |
src/Beutl/ViewModels/TimelineViewModel.cs |
Adds persistence of preview-disabled elements state to/from JSON |
src/Beutl/ViewModels/ElementViewModel.cs |
Core preview management logic with async loading, cancellation, and event handling |
src/Beutl.ProjectSystem/SceneComposer.cs |
Adds explicit ClearSounds() call to prevent audio accumulation |
src/Beutl.ProjectSystem/Operation/IElementPreviewProvider.cs |
New interface defining preview generation contract for operators |
src/Beutl.Operators/Source/SourceVideoOperator.cs |
Implements video thumbnail generation and preview invalidation tracking |
src/Beutl.Operators/Source/SourceSoundOperator.cs |
Implements audio waveform chunk generation with proper audio composing |
src/Beutl.Operators/Source/SourceImageOperator.cs |
Minor UTF-8 BOM fix (no functional changes) |
src/Beutl.Language/Strings*.resx |
Adds localized strings for the "Disable Preview" toggle option |
src/Beutl.Language/Strings.Designer.cs |
Generated code for new localization strings |
src/Beutl.Engine/Properties/AssemblyInfo.cs |
Grants InternalsVisibleTo access to Beutl.Operators assembly |
src/Beutl.Engine/Graphics/SourceVideo.cs |
Adds Speed and IsLoop properties, exposes internal DrawInternal method for thumbnail rendering |
src/Beutl.Engine/Engine/EngineObject.cs |
Changes reflection cache to use concurrent collections for thread safety |
src/Beutl.Engine/Audio/Composing/Composer.cs |
Makes AddSound and ClearSounds public, removes automatic clearing |
src/Beutl.Engine.SourceGenerators/EngineObjectResourceGenerator.cs |
Wraps disposal logic in if (disposing) block and fixes indentation |
Files not reviewed (1)
- src/Beutl.Language/Strings.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)
src/Beutl/ViewModels/ElementViewModel.cs:662
- Poor error handling: empty catch block.
catch (OperationCanceledException)
{
}
src/Beutl/ViewModels/ElementViewModel.cs:665
- Poor error handling: empty catch block.
catch
{
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/Beutl.Engine.SourceGenerators/EngineObjectResourceGenerator.cs
Outdated
Show resolved
Hide resolved
a35ecd4 to
0d6d6f1
Compare
…ing waveform generation
… method signatures
…roved thread management
…for empty samples
Co-authored-by: Copilot <[email protected]>
80c77ee to
8748769
Compare
|
No TODO comments were found. |
Minimum allowed line rate is |
Description
Implement element preview functionality with support for images, videos, and audio waveforms. Enhance video rendering and introduce a mechanism for preview invalidation. Add properties for speed and loop configuration in video sources, and provide a toggle to disable previews.
Breaking changes
None.
Fixed issues
None.