helpButton.addMouseListener(this);
segmenterEnablePanel.add(helpButton);
add(segmenterEnablePanel);
Box segmenterControlsPanel = Box.createVerticalBox();
segmenterControlsPanel.setBackground(c);
TitledBorder title = BorderFactory.createTitledBorder(
BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
"Segmenter Controls");
title.setTitleJustification(TitledBorder.CENTER);
segmenterControlsPanel.setBorder(title);
JPanel inputFileNamePanel = new JPanel();
inputFileNamePanel.setBackground(c);
JLabel inputFileNameBoxLabel = new JLabel("input sound file:");
inputFileNamePanel.add(inputFileNameBoxLabel);
inputSoundFileField = new JTextField("chris_mann.wav");
inputSoundFileField.setColumns(20);
inputSoundFileField.addActionListener(this);
inputSoundFileField.setActionCommand("setInputFile");
inputFileNamePanel.add(inputSoundFileField);
JButton inputBrowseButton = new JButton("browse");
inputBrowseButton.setBackground(c);
inputBrowseButton.addActionListener(this);
inputBrowseButton.setActionCommand("browseInputFile");
inputFileNamePanel.add(inputBrowseButton);
listenButton = new JButton("listen");
listenButton.setBackground(c);
listenButton.addActionListener(this);
listenButton.setActionCommand("listen");
inputFileNamePanel.add(listenButton);
segmenterControlsPanel.add(inputFileNamePanel);
JPanel detectorTypePanel = new JPanel();
detectorTypePanel.setBackground(c);
ButtonGroup onsetDetectorTypeGroup = new ButtonGroup();
eventStyleButton = new JRadioButton("detect events");
eventStyleButton.setBackground(c);
eventStyleButton.addActionListener(this);
eventStyleButton.setActionCommand("event_detector");
beatStyleButton = new JRadioButton("detect beats");
beatStyleButton.setBackground(c);
beatStyleButton.addActionListener(this);
beatStyleButton.setActionCommand("beat_detector");
onsetDetectorTypeGroup.add(eventStyleButton);
onsetDetectorTypeGroup.add(beatStyleButton);
detectorTypePanel.add(eventStyleButton);
detectorTypePanel.add(beatStyleButton);
eventStyleButton.setSelected(true);
segmenterControlsPanel.add(detectorTypePanel);
eventPanel = new JPanel();
eventPanel.setLayout(new BoxLayout(eventPanel, BoxLayout.Y_AXIS));
eventPanel.setBackground(c);
JPanel thresholdPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
thresholdPanel.setBackground(c);
JLabel thresholdLabel = new JLabel("segment sensitivity: ");
thresholdPanel.add(thresholdLabel);
thresholdSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 1);
thresholdSlider.setBackground(c);
thresholdSlider.setValue(75);
Hashtable labelTable = new Hashtable();
labelTable.put( new Integer(0), new JLabel("low") );
labelTable.put( new Integer(100), new JLabel("high") );
thresholdSlider.setLabelTable( labelTable );
thresholdSlider.setPaintLabels(true);
thresholdSlider.setMajorTickSpacing(10);
thresholdSlider.setPaintTicks(true);
thresholdPanel.add(thresholdSlider);
eventPanel.add(thresholdPanel);
JPanel densityPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
densityPanel.setBackground(c);
JLabel densityLabel = new JLabel("segment density: ");
densityPanel.add(densityLabel);
densitySlider = new JSlider(JSlider.HORIZONTAL, 0, 20, 1);
densitySlider.setBackground(c);
densitySlider.setValue(15);
densitySlider.setMajorTickSpacing(2);
densitySlider.setPaintTicks(true);
densitySlider.setLabelTable(labelTable);
densitySlider.setPaintLabels(true);
densityPanel.add(densitySlider);
eventPanel.add(densityPanel);
beatPanel = new JPanel();
beatPanel.setBackground(c);
halfTempoBox = new JCheckBox("cut tempo in half");
halfTempoBox.setBackground(c);
halfTempoBox.setSelected(false);
beatPanel.add(halfTempoBox);
// controlPanel is a wrapper around the event/beat detector knobs
controlPanel = new JPanel();
controlPanel.setBackground(c);
controlPanel.add(eventPanel);
segmenterControlsPanel.add(controlPanel);
firstFrameBox = new JCheckBox("1st event = track start");
firstFrameBox.setBackground(c);
firstFrameBox.setSelected(true);
firstFrameBox.setAlignmentX(Component.CENTER_ALIGNMENT);
segmenterControlsPanel.add(firstFrameBox);
add(segmenterControlsPanel);
JPanel outputSegFileNamePanel = new JPanel();
outputSegFileNamePanel.setBackground(c);