Skip to content

Commit

Permalink
Merge pull request #981 from oxygen-dioxide/worldline-external-wavtool
Browse files Browse the repository at this point in the history
Support using worldline resampler together with external wavtool
  • Loading branch information
stakira authored Dec 13, 2023
2 parents f23b171 + 95c3d61 commit 5445ace
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 9 additions & 0 deletions OpenUtau.Core/Classic/ExeWavtool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ public float[] Concatenate(List<ResamplerItem> resamplerItems, string tempPath,
if (cancellation.IsCancellationRequested) {
return null;
}
//The builtin worldline resampler can't be called from bat script,
//so we need to call it directly from C#
foreach(var item in resamplerItems){
if(!(item.resampler is ExeResampler) && !cancellation.IsCancellationRequested && !File.Exists(item.outputFile)){
lock (Renderers.GetCacheLock(item.outputFile)) {
item.resampler.DoResamplerReturnsFile(item, Log.Logger);
}
}
}
PrepareHelper();
string batPath = Path.Combine(PathManager.Inst.CachePath, "temp.bat");
lock (tempBatLock) {
Expand Down
8 changes: 1 addition & 7 deletions OpenUtau.Core/Render/Renderers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,7 @@ public static IReadOnlyList<IResampler> GetSupportedResamplers(IWavtool? wavtool
}

public static IReadOnlyList<IWavtool> GetSupportedWavtools(IResampler? resampler) {
if (resampler is WorldlineResampler) {
return ToolsManager.Inst.Wavtools
.Where(r => r is SharpWavtool)
.ToArray();
} else {
return ToolsManager.Inst.Wavtools;
}
return ToolsManager.Inst.Wavtools;
}
}
}

0 comments on commit 5445ace

Please sign in to comment.