public Label getLabel() { return Label.getByVal(channelLabel); } }
public static Label getByVal(int val) { Label[] values = Label.values(); for (int i = 0; i < values.length; i++) { Label label = values[i]; if (label.labelVal == val) return label; } return Label.Mono; }
public static void setLabels(Label[] labels, ChannelBox channel) { channel.setChannelLayout(kCAFChannelLayoutTag_UseChannelDescriptions.getCode()); ChannelDescription[] list = new ChannelDescription[labels.length]; for (int i = 0; i < labels.length; i++) list[i] = new ChannelBox.ChannelDescription(labels[i].getVal(), 0, new float[] { 0, 0, 0 }); channel.setDescriptions(list); }
public static Label[] getLabelsFromChan(ChannelBox box) { long tag = box.getChannelLayout(); if ((tag >> 16) == 147) { int n = (int) tag & 0xffff; Label[] res = new Label[n]; for (int i = 0; i < n; i++) res[i] = Label.getByVal((1 << 16) | i); return res; } ChannelLayout[] values = ChannelLayout.values(); for (int i = 0; i < values.length; i++) { ChannelLayout layout = values[i]; if (layout.getCode() == tag) { if (layout == kCAFChannelLayoutTag_UseChannelDescriptions) { return extractLabels(box.getDescriptions()); } else if (layout == kCAFChannelLayoutTag_UseChannelBitmap) { return getLabelsByBitmap(box.getChannelBitmap()); } else { return layout.getLabels(); } } } return AudioSampleEntry.EMPTY; }
Label[] values = Label.values(); for (int i = 0; i < values.length; i++) { Label label = values[i];