JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE)
== JOptionPane.YES_OPTION)
fs = false;
}
final GameOptions go = Config.getGameOptions();
go.setAutoplay(autoplay);
go.setAutosound(autosound);
go.setChannelModifier(channelModifier);
go.setVisibilityModifier(visibilityModifier);
go.setMasterVolume(mainVol);
go.setKeyVolume(keyVol);
go.setBGMVolume(bgmVol);
go.setSpeedMultiplier(hispeed);
go.setSpeedType(speed_type);
go.setDisplayFullscreen(fs);
go.setDisplayVsync(vsync);
go.setJudgmentType(jc_timed_judgment.isSelected() ? GameOptions.JudgmentType.TimeJudgment : GameOptions.JudgmentType.BeatJudgment);
System.out.println(go.isAutoplay());
try{
go.setDisplayLag(Double.parseDouble(txt_displayLag.getText()));
}catch(Exception e){
JOptionPane.showMessageDialog(this, "Invalid display lag value", "Error", JOptionPane.WARNING_MESSAGE);
return;
}
try{
go.setAudioLatency(Double.parseDouble(txt_audioLatency.getText()));
}catch(Exception e){
JOptionPane.showMessageDialog(this, "Invalid audio latency value", "Error", JOptionPane.WARNING_MESSAGE);
return;
}
NativeLibrary.addSearchPath("vlc", go.getVLCLibraryPath());
final Render r;
r = new Render(selected_header, go, dm);
if (cb_startPaused.isSelected()) {
r.setStartPaused();
}
if (cb_autoSyncDisplay.isSelected()) {
r.setAutosyncDisplay();
r.setAutosyncCallback(new Render.AutosyncCallback() {
@Override
public void autosyncFinished(double displayLag) {
if (JOptionPane.showConfirmDialog(MusicSelection.this, "This display latency has changed from\n"
+ go.getDisplayLag() + "\nto\n" + displayLag + "\n\nSave this change?",
"Save Display Latency", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
go.setDisplayLag(displayLag);
txt_displayLag.setText(displayLag + "");
cb_autoSyncDisplay.setSelected(false);
}
}
});
}
else if (cb_autoSyncAudio.isSelected()) {
r.setAutosyncAudio();
r.setAutosyncCallback(new Render.AutosyncCallback() {
@Override
public void autosyncFinished(double audioLatency) {
if (JOptionPane.showConfirmDialog(MusicSelection.this, "This audio latency has changed from\n"
+ go.getAudioLatency() + "\nto\n" + audioLatency + "\n\nSave this change?",
"Save Audio Latency", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
go.setAudioLatency(audioLatency);
txt_audioLatency.setText(audioLatency + "");
cb_autoSyncAudio.setSelected(false);
}
}
});