CUERipper rewritten with Avalonia UI - #372
Conversation
Zips the files into 'CUETools.CTDB.EACPlugin' and 'CUETools' and generates SHA256 hashes for the zip-containers. Added CHANGELOG.md to the root of the project
Added basic Linux support by porting libraries to .NET Standard 2.0. BwgBurn's SCSI commands, originally relying on DeviceIoControl in WinDev.cs, are handled by LinDev.cs using IOCTL when running on Linux. Windows structures are translated at runtime to their Linux counterparts, limited to what's actually used by BwgBurn.
Reimplemented most features of the original CUERipper in an Avalonia-based application, keeping the logic as close as possible to the original without introducing breaking changes. Added new functionalities: * Cover selector * Output path management * Multi-encoding * Automatic ripping * Repair functionality (same as in CUETools) * Minimal native Linux support * Track progress * In-app updater
Enabled the Linux-specific drive detection in CUERipper.Avalonia. Added a new release artifact, postfixed with 'Lite', which excludes CUERipper.Avalonia and the Avalonia runtime.
|
@UnknownException This looks impressive at first glance ...
EAC contains # Windows PowerShell
$path = "C:\Program Files (x86)\Exact Audio Copy\Interop.HelperFunctionsLib.dll"
>> [Reflection.Assembly]::ReflectionOnlyLoadFrom($path).ImageRuntimeVersion
v2.0.50727 |
Set 'AutomationProperties.Name' for various components. Added a warning sound when a message box opens (.NET 4.7 only). Fixed a bug that allowed tabbing to components outside of the visible area. Added a warning before closing the application while ripping.
|
User perspective. |
|
@ha-korth thanks for testing and your feedback. Calling the file size huge might be an overstatement. Yes, it's larger than the original, but it's comparable to a single FLAC track. Unlike WinForms, Avalonia isn't built into the OS, so the UI framework needs to be bundled. That said, I've also modified the GitHub workflow to create a build that excludes the Avalonia application, it's postfixed with 'Lite' for those who prefer a smaller package.
The cover art starts loading as soon as the disc is inserted.
The embedded covert art is reduced to 500px because some media players (Windows Media Player) can't handle larger artwork, which'll result in the track being unplayable. Using 'MaxAlbumArtSize' instead of hardcoding makes sense, so I'll be implementing that soon. Additionally the selected cover will be downloaded as high(er) resolution image (cover_hi-res.jpg) when the ripping process starts.
Fair enough, poor choice of words on my part. Other than the new buttons and the previewer it's practically the same. |
Fetch album covers concurrently on the cover art tab. Resizing of embedded art now uses the 'maxAlbumArtSize' setting to stay within bounds.
If the user is going for the 'Lite' package, CUERipper.exe and CUERipper.Avalonia.exe should have the same features available (when possible). Several of the new features of Avalonia are on the CUERipper feature WishList.
Okay I can reproduce. I have more than one optical drive. The CD was already in the drive but a different drive was active when CUERipper.Avalonia was executed. Switching drives doesn't load art without refresh. If any art was already retrieved for a CD in the first drive, it remains in the cache after selecting the second drive (until refresh). I haven't had a chance to further explore the Windows side of CUERipper.Avalonia. |
Retrieve the primary cover art before fetching additional images. By separating the retrieval process, primary artwork will always appear first.
Add a step to build an Inno Setup-based CUETools installer in the Windows workflow.
Fixed various bugs related to switching between drives. The in-app updater now uses the installer instead of zip file. The updater now also caches the release author.
3fed27d to
d1896e9
Compare
Modified regex patterns to allow a single letter (a-z, A-Z) after the last digit in the version string.
Users can now disable the automatic update check. Fixed a minor bug in the Inno Setup script.
Write the cover art cache and update content to the user directory when user profiles are enabled.
@ha-korth would you be able to try the latest release (v2.2.6b)? |
|
I only did a quick check but appears to be working okay. I didn't expect both sets of art in the .AlbumCache folder but only relevant art appears in the Album cover selector window for each drive. |
|
Had to give this CueRipper Avalonia UI Edition (v2.2.6b) a try....... THe only thing i noticed was that the yellow text in the Options/Proxy 'tab' isn't readable against the white backround |
Thanks! The .AlbumCache folder only gets wiped when the application shuts down @ App.axaml.cs. I did that to prevent downloading the same assets over and over again from the remote host. The files are relatively small, so I don't think it'll cause an issue.
I'm afraid that this might be caused by this issue: gchudov/db.cue.tools#22
Thanks! I will change it |
|
@UnknownException |
c95e72e to
44db3ae
Compare
Logs will now be written to the user directory if user profiles are enabled. Renamed user agent from 'Mozilla/5.0' to the following pattern: 'ApplicationShortName/CUEToolsVersion ( github uri )'. Changed the proxy settings warning color from yellow to orange.
89aa75a to
a1ecded
Compare
|
Very nice what you have done. Especially the new features:
Only one thing is missing. It's editing and cut/copy from/to multiple cells in multiple rows in the tracklist grid. I have implemented something with the datagridview. This makes it possible to copy from/to multiple cells and/or a spreadsheet program. |
The call to _thread.Start() was accidentally removed during development, causing the drive list to stop updating. The DrivesAvailable function could fail when reinserting USB CD drives, as the identifying drive number can change.
The ReadSubchannel gap detection method fails on subsequent ReadSubChannel42 calls, as the position 'sPos' appears to drift. The current workaround is to include QChannel in the read calls prior to ReadSubChannel42.
Incorrect usage of CUEStyle.SingleFileWithCUE causes the disc repair to fail. Check if 'allowEmbed' is set for the selected encoding, fallback to CUEStyle.SingleFile if not. Apply minor stability and logging improvements.
I like your rewrite of the source code. I think your code is much more cleaner and should be the base of CUERipper. Even when Avalonia is not used as main UI it is better to port the current UI to your code. And it is or course less Windows bound. Did you already found out why you have to use WindowsDriveNotificationService.cs in Windows and not the general version? |
|
You add an ability to add album artwork from the computer |
|
I just downloaded the current release (2.2.6g) for Linux and had no problems running CUERipper on my primary OS (LMDE 7). This is impressive and very much appreciated, especially as I have only recently discovered CUETools and found that I could not rip CDs using CUERipper on WINE (it errors out with "NO ADDITIONAL SENSE INFORMATION"), but works perfectly if I boot to my old Windows installation. |
|
Further comment: I have noticed that the CUE files produced between the original Windows-only CUE Ripper and the Avalonia rewrite are not identical. I am wondering if differences in the metadata handling is causing this? Example attached. Same CD, same drive, different results between 1) Windows with CUERipper 2.2.6 and 2) LMDE7 with CUERipper.Avalonia 2.2.6g. Both times the same CD (the 1993 Australian release) is selected from the metadata dropdown, but in the Avalonia version the album cover gets stuck on the first detected match (ABBA: The Complete Gold Collection - Disc 2 -- the 2000 Australian release). More ABBA Gold CUE (Avalonia version on LMDE).txt Note the different IRSC numbers for two of the tracks as well as different timings (by 1-2 seconds) for several tracks. |
Locally, Windows gap detection uses the BEh path, on Linux it always fell back to 42h, producing incorrect pregaps. ReadCDAndSubChannel in Device.cs always sized the read buffer for a main channel, even when none was requested. Dropping it under Linux results in identical read command selection on both platforms. Also fixes incorrect struct packing (SG_IO_HDR) and closes a file descriptor leak.
The installers have moved to GitHub, version and hash are unchanged.
|
@Australis86 Thanks for the detailed report! The metadata doesn't seem to be the issue. The gap detection wasn't working correctly under Linux, which results in different CUE files. Would you be able to verify if the latest version (v2.2.6h) fixes your issue? The album cover is a separate issue. Currently it isn't following the metadata selection. As a quick workaround you can select one manually in the cover selector. I'll look into it, the current behaviour is a bit lame. |
React to the metadata changed event in the cover viewer Fix CoverViewAlbumViewModel equality check Extract various CUETools functionality behind interfaces for future testing Fix recovery record check, release asset regex and InterruptibleJob cancel/dispose handling Save metadata when closing the application
Encoding tab logic has moved from MainWindow to EncodingTabContainer, the component behaviour has changed to accommodate the refactor. EncodingSection has also been refactored as part of the MVVM refactoring.
Thanks @UnknownException -- I'll test it out as soon as I can (likely late next week as I've got a lot on my plate right now). |
Allow ripping to be cancelled while album art is still downloading, before the actual disc reading starts Fix discs being ejected after cancelling at the directory conflict dialog Fix album art retrieval in GetCurrentCoverAsync which incorrectly relied on SelectCover Fix GetHashCode precedence issue in CoverViewAlbumViewModel
Fix empty formats being stored
Thanks, I've finally gotten around to checking this and 2.2.6h does indeed fix the CUE file. It now produces an identical rip to the Windows version. |
Rename CUEDialogService to DialogService Rename CUERipperService to DiscRippingService Rename CUEImageService to DiscImageService Rename CUEMetaService to AlbumMetadataService
Glad to hear, thanks for reporting the issue and testing the fix!
As of v2.2.6i the album cover selector will match the selected metadata. |
Album covers written with Avalonia's Bitmap.Save are encoded as PNG regardless of what the file extension is. The workaround is to encode it as JPG with SkiaSharp before writing to disk. Avalonia Bitmaps have been put behind IBitmap as the last remaining part of decoupling the ViewModels from the UI framework.

I’ve been experimenting with Avalonia and decided to use CUERipper as a test subject. The challenge of porting a .NET Framework application to Linux with Avalonia is what motivated me. What started as a curiosity-driven experiment quickly grew into a fully functional implementation rather than just a proof of concept, unintended scope creep! 🙂
The goal is to create a new UI without causing breaking changes in the existing codebase. It's targeted at .NET 8 but remains compatible with .NET 4.7, as some plugins still seem to rely on it.
I've submitted this as a
draftpull request so you can decide if this is the direction you want the application to take, given the impact of the chosen UI tooling (for example, how this might affect the CUETools app.). If you're open to merging it into the main repository, I can provide it as a single PR or split it into smaller, more manageable ones (Linux support, Avalonia UI, GitHub packaging) for review.This also comes with several new features:
Feel free to try out the test build, you can find it under 'Releases' in my fork. For now I'll focus on improving the Linux build. Unit tests will be added if this PR has a chance of being merged, as they're a lot of work to write. For more information about Avalonia, see https://avaloniaui.net/
Screenshots:



PS Purely out of curiosity, why is the EAC plugin built with .NET Framework 2.0?