-
Notifications
You must be signed in to change notification settings - Fork 306
/
ClassicSingerLoader.cs
28 lines (27 loc) · 1013 Bytes
/
ClassicSingerLoader.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Collections.Generic;
using System.Linq;
using OpenUtau.Core;
using OpenUtau.Core.Ustx;
namespace OpenUtau.Classic {
public static class ClassicSingerLoader {
static USinger AdjustSingerType(Voicebank v) {
switch (v.SingerType) {
case USingerType.Enunu:
return new Core.Enunu.EnunuSinger(v) as USinger;
case USingerType.DiffSinger:
return new Core.DiffSinger.DiffSingerSinger(v) as USinger;
default:
return new ClassicSinger(v) as USinger;
}
}
public static IEnumerable<USinger> FindAllSingers() {
List<USinger> singers = new List<USinger>();
foreach (var path in PathManager.Inst.SingersPaths) {
var loader = new VoicebankLoader(path);
singers.AddRange(loader.SearchAll()
.Select(AdjustSingerType));
}
return singers;
}
}
}