// Save track info to a MIX file
//
class SaveItemListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
File trackFile = null;
JFileChooser chooser = new JFileChooser(getChooserRoot());
chooser.addChoosableFileFilter(new MixFileFilter());
chooser.addChoosableFileFilter(new HTMLFileFilter());
int rc = chooser.showSaveDialog(SimpleMixer.this);
if (rc == JFileChooser.APPROVE_OPTION) {
trackFile = chooser.getSelectedFile();
FileFilter ff = chooser.getFileFilter();
if (ff instanceof ExtensionFilter) {
ExtensionFilter xff =
(ExtensionFilter) chooser.getFileFilter();
trackModel.write(xff, trackFile);
} else { // generate default MIX file
trackModel.write(new MixFileFilter(), trackFile);
}
}