use of blue.settings.GeneralSettings in project blue by kunstmusik.
the class CommandlineRunner method playModeChanged.
@Override
public void playModeChanged(int playMode) {
if (playMode == PlayModeListener.PLAY_MODE_STOP) {
if (console.getLastExitValue() != 0) {
final GeneralSettings generalSettings = GeneralSettings.getInstance();
if (generalSettings.isCsoundErrorWarningEnabled()) {
if (errorPanel == null) {
errorPanel = new JPanel(new BorderLayout());
errorPanel.add(new JLabel("<html>There was an error in " + "running Csound.<br>" + "Please view the Csound Output Dialog for " + "more information.<br><br></html>"), BorderLayout.CENTER);
disableMessagesBox = new JCheckBox("Disable Error Message Dialog");
errorPanel.add(disableMessagesBox, BorderLayout.SOUTH);
}
disableMessagesBox.setSelected(false);
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null, errorPanel, "Csound Error", JOptionPane.ERROR_MESSAGE);
if (disableMessagesBox.isSelected()) {
generalSettings.setCsoundErrorWarningEnabled(false);
generalSettings.save();
}
});
}
notifyPlayModeListeners(playMode);
return;
}
if (data.isLoopRendering() && !shouldStop) {
try {
render();
} catch (SoundObjectException e) {
Exceptions.printStackTrace(e);
// ExceptionDialog.showExceptionDialog(parent, e);
notifyPlayModeListeners(PlayModeListener.PLAY_MODE_STOP);
}
} else {
notifyPlayModeListeners(playMode);
}
} else {
notifyPlayModeListeners(playMode);
}
}
Aggregations