use of javax.sound.sampled.CompoundControl in project Spark by igniterealtime.
the class JavaMixer method main.
public static void main(String[] args) {
final JavaMixer sm = new JavaMixer();
final JFrame jf = new JFrame("Mixer Test");
final JPanel jp = new JPanel();
jf.add(jp);
jp.add(sm.getTree());
jf.setSize(600, 500);
jf.setVisible(true);
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
sm.getTree().addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
TreePath path = e.getPath();
if (path.getLastPathComponent() instanceof JavaMixer.ControlNode) {
JavaMixer.ControlNode controlNode = (JavaMixer.ControlNode) path.getLastPathComponent();
if (!(controlNode.getControl() instanceof CompoundControl)) {
if (jp.getComponentCount() > 1)
jp.remove(1);
jp.add(controlNode.getComponent(), 1);
jp.repaint();
}
}
}
});
jp.add(sm.getPrefferedMasterVolume());
jp.add(sm.getPrefferedMasterVolume());
jp.add(sm.getPrefferedInputVolume());
jp.repaint();
sm.setMicrophoneInput();
sm.setMuteForMicrophoneOutput();
}
use of javax.sound.sampled.CompoundControl in project Spark by igniterealtime.
the class JavaMixer method createControlChildren.
private void createControlChildren(JavaMixer.ControlNode controlNode) {
if (controlNode.getControl() instanceof CompoundControl) {
CompoundControl control = (CompoundControl) controlNode.getControl();
Control[] aControls = control.getMemberControls();
for (Control con : aControls) {
JavaMixer.ControlNode conNode = new JavaMixer.ControlNode(con);
createControlChildren(conNode);
controlNode.add(conNode);
}
}
}
Aggregations