--- jsampler/trunk/src/org/jsampler/CC.java 2008/12/24 17:29:47 1818 +++ jsampler/trunk/src/org/jsampler/CC.java 2009/03/16 22:12:32 1867 @@ -1,7 +1,7 @@ /* * JSampler - a java front-end for LinuxSampler * - * Copyright (C) 2005-2008 Grigor Iliev + * Copyright (C) 2005-2009 Grigor Iliev * * This file is part of JSampler. * @@ -772,7 +772,7 @@ } }); - final GetEngines ge = new GetEngines(); + final Global.GetEngines ge = new Global.GetEngines(); ge.addTaskListener(new TaskListener() { public void taskPerformed(TaskEvent e) { @@ -830,7 +830,7 @@ }); - final Connect cnt = new Connect(); + final Global.Connect cnt = new Global.Connect(); boolean b = preferences().getBoolProperty(JSPrefs.LAUNCH_BACKEND_LOCALLY); if(b && srv.isLocal() && backendProcess == null) cnt.setSilent(true); cnt.addTaskListener(new TaskListener() { @@ -1223,6 +1223,7 @@ for(int i = 0; i < fxSends.length; i++) { FxSend f = fxSends[i]; lscpClient.createFxSend(chnId, f.getMidiController(), f.getName()); + lscpClient.setFxSendLevel(chnId, i, f.getLevel()); Integer[] r = f.getAudioOutputRouting(); for(int j = 0; j < r.length; j++) { @@ -1256,6 +1257,11 @@ return true; } + + public static boolean + isMacOS() { + return System.getProperty("os.name").toLowerCase().startsWith("mac os x"); + } private final static EventHandler eventHandler = new EventHandler(); @@ -1396,7 +1402,7 @@ @Override public void totalVoiceCountChanged(TotalVoiceCountEvent e) { - scheduleTask(new UpdateTotalVoiceCount()); + scheduleTask(new Global.UpdateTotalVoiceCount()); } /** Invoked when the number of MIDI instruments in a MIDI instrument map is changed. */ @@ -1447,8 +1453,12 @@ break; case TASK_DONE: EnhancedTask t = (EnhancedTask)e.getSource(); - if(t.doneWithErrors() && !t.isStopped() && !t.isSilent()) { - showError(t); + if(t.doneWithErrors() && !t.isSilent()) { + if(t.getErrorCode() == t.SOCKET_ERROR) { + getMainFrame().handleConnectionFailure(); + } else if(!t.isStopped()) { + showError(t); + } } break; case NOT_IDLE: