OpenUtau
OpenUtau copied to clipboard
[Help wanted] Support asynchronous batch edits
Some batch edits like DiffSinger autopitch may execute really slowly and block the UI. This PR supports running batch edits asynchronously, with a dialog showing progress of the running batch edit.
Major changes:
- Add a property
IsAsync
toOpenUtau.Core.Editing.BatchEdit
to declare if the batch edit should be run asynchronously. - Add a method
RunAsync()
toOpenUtau.Core.Editing.BatchEdit
to run the batch edit asynchronously, with a callback to set the progress and a cancellation token to check if the process is cancelled by user. This method has the same behaviour likeRun()
if not overridden by its implementation classes. - Adds a static method
ShowProcessing()
toOpenUtau.App.Views.MessageBox
for running a task in the background and show a modal dialog for manipulating the progress. - Make
OpenUtau.Core.Editing.NoteBatchEdit
to run asynchronously.
Problem
I did not figure out how to visit the instance of the pianoroll window. But I need that because the progress dialog should have it as the parent window, so I temporarily changed OpenUtau.App.Views.MainWindow.pianoRollWindow
to public. I know this is not the proper way, but how can I do this without violating the rule of member visibility?