1
2
3
4
5 package oshi.hardware.platform.unix.aix;
6
7 import java.util.ArrayList;
8 import java.util.List;
9 import java.util.function.Supplier;
10
11 import oshi.annotation.concurrent.Immutable;
12 import oshi.hardware.SoundCard;
13 import oshi.hardware.common.AbstractSoundCard;
14 import oshi.util.Constants;
15 import oshi.util.ParseUtil;
16
17
18
19
20 @Immutable
21 final class AixSoundCard extends AbstractSoundCard {
22
23
24
25
26
27
28
29
30 AixSoundCard(String kernelVersion, String name, String codec) {
31 super(kernelVersion, name, codec);
32 }
33
34
35
36
37
38
39
40
41 public static List<SoundCard> getSoundCards(Supplier<List<String>> lscfg) {
42 List<SoundCard> soundCards = new ArrayList<>();
43 for (String line : lscfg.get()) {
44 String s = line.trim();
45 if (s.startsWith("paud")) {
46 String[] split = ParseUtil.whitespaces.split(s, 3);
47 if (split.length == 3) {
48 soundCards.add(new AixSoundCard(Constants.UNKNOWN, split[2], Constants.UNKNOWN));
49 }
50 }
51 }
52 return soundCards;
53 }
54 }