use of blue.soundObject.SoundObjectException in project blue by kunstmusik.
the class RealtimeRenderManager method renderProject.
protected void renderProject(BlueData data, boolean auditioning) {
if (isRendering()) {
stopRendering();
}
if (data == null) {
this.auditioning = false;
return;
}
this.auditioning = auditioning;
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
RealtimeRenderServiceFactory factory = RealtimeRenderSettings.getInstance().renderServiceFactory;
if (currentRenderServiceFactory != factory || currentRenderService == null || currentRenderService.getClass() != factory.getRenderServiceClass()) {
if (currentRenderService != null) {
currentRenderService.removePlayModeListener(realtimeListener);
}
currentRenderServiceFactory = factory;
currentRenderService = factory.createInstance();
currentRenderService.addPlayModeListener(realtimeListener);
}
currentRenderService.setData(data);
try {
currentRenderService.render();
} catch (SoundObjectException soe) {
ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), soe);
}
}
use of blue.soundObject.SoundObjectException in project blue by kunstmusik.
the class RealtimeRenderManager method renderForBlueLive.
public void renderForBlueLive(BlueData data) {
if (currentBlueLiveRenderService != null && currentBlueLiveRenderService.isRunning()) {
currentBlueLiveRenderService.stop();
}
if (data == null) {
return;
}
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
RealtimeRenderServiceFactory factory = RealtimeRenderSettings.getInstance().renderServiceFactory;
if (currentRenderServiceFactory != factory || currentBlueLiveRenderService == null || currentBlueLiveRenderService.getClass() != factory.getRenderServiceClass()) {
if (currentBlueLiveRenderService != null) {
currentBlueLiveRenderService.removePlayModeListener(blueLiveListener);
}
currentRenderServiceFactory = factory;
currentBlueLiveRenderService = factory.createInstance();
currentBlueLiveRenderService.addPlayModeListener(blueLiveListener);
}
currentBlueLiveRenderService.addBinding(new BlueLiveBinding(data));
currentBlueLiveRenderService.setData(data);
try {
currentBlueLiveRenderService.renderForBlueLive();
} catch (SoundObjectException soe) {
ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), soe);
}
}
use of blue.soundObject.SoundObjectException in project blue by kunstmusik.
the class CS6RealtimeRenderService method render.
@Override
public void render() throws SoundObjectException {
if (this.data == null) {
return;
}
// csnd6.csoundInitialize(csnd6.CSOUNDINIT_NO_SIGNAL_HANDLER);
shouldStop = false;
String command;
try {
command = ProjectPropertiesUtil.getRealtimeCommandLine(data.getProjectProperties());
String globalSco = data.getGlobalOrcSco().getGlobalSco();
globalSco = TextUtilities.stripMultiLineComments(globalSco);
globalSco = TextUtilities.stripSingleLineComments(globalSco);
double startTime = data.getRenderStartTime();
double endTime = data.getRenderEndTime();
CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, true, true);
RenderTimeManager timeManager = Lookup.getDefault().lookup(RenderTimeManager.class);
timeManager.setTempoMapper(result.getTempoMapper());
String csd = result.getCsdText();
File temp = FileUtilities.createTempTextFile("tempCsd", ".csd", BlueSystem.getCurrentProjectDirectory(), csd);
String[] args = command.split("\\s+");
String[] args2 = new String[args.length + 1];
System.arraycopy(args, 0, args2, 0, args.length);
args2[args.length] = temp.getAbsolutePath();
play(null, result, args2, BlueSystem.getCurrentProjectDirectory(), startTime);
} catch (SoundObjectException soe) {
throw soe;
} catch (Exception ex) {
StatusDisplayer.getDefault().setStatusText("[" + BlueSystem.getString("message.error") + "] " + BlueSystem.getString("message.generateScore.error"));
ex.printStackTrace();
}
}
Aggregations