use of blue.BlueData in project blue by kunstmusik.
the class GenerateRealtimeCsdToScreenAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
try {
double startTime = data.getRenderStartTime();
double endTime = data.getRenderEndTime();
/*
* try { tempStart = Double.parseDouble(playStartText.getText()); }
* catch(NumberFormatException nfe) { tempStart = 0.0f;
* playStartText.setText(Double.toString(tempStart));
* JOptionPane.showMessageDialog(null, BlueSystem
* .getString("message.generateScore.startingFromZero")); }
*/
boolean isApi = CommandlineRealtimeRenderServiceFactory.class != RealtimeRenderSettings.getInstance().renderServiceFactory.getClass();
CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, true, isApi);
String csd = result.getCsdText();
InfoDialog.showInformationDialog(WindowManager.getDefault().getMainWindow(), csd, BlueSystem.getString("message.generateScore.csdTest"));
} catch (Exception ex) {
ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), ex);
throw new RuntimeException("CSDRender Failed");
}
}
use of blue.BlueData in project blue by kunstmusik.
the class GenerateCsdToScreenAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
try {
double startTime = data.getRenderStartTime();
double endTime = data.getRenderEndTime();
/*
* try { tempStart = Double.parseDouble(playStartText.getText()); }
* catch(NumberFormatException nfe) { tempStart = 0.0f;
* playStartText.setText(Double.toString(tempStart));
* JOptionPane.showMessageDialog(null, BlueSystem
* .getString("message.generateScore.startingFromZero")); }
*/
CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, false, false);
String csd = result.getCsdText();
InfoDialog.showInformationDialog(WindowManager.getDefault().getMainWindow(), csd, BlueSystem.getString("message.generateScore.csdTest"));
} catch (Exception ex) {
ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), ex);
throw new RuntimeException("CSDRender Failed");
}
}
use of blue.BlueData in project blue by kunstmusik.
the class ProjectPropertiesTopComponent method reinitialize.
public void reinitialize() {
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
ProjectProperties projectProperties = null;
BlueData data = null;
if (project != null) {
data = project.getData();
if (data != null) {
projectProperties = data.getProjectProperties();
}
}
for (ProjectPluginEditor editor : pluginEditors.values()) {
editor.edit(data);
}
this.projectInformationPanel1.setProjectProperties(projectProperties);
this.realtimeRenderSettingsPanel1.setProjectProperties(projectProperties);
this.diskRenderSettingsPanel1.setProjectProperties(projectProperties);
}
use of blue.BlueData in project blue by kunstmusik.
the class RenderToDiskAndOpenAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
if (project != null) {
BlueData data = project.getData();
if (data != null) {
RenderToDiskUtility.getInstance().renderToDisk(data, f -> {
DiskRenderSettings settings = DiskRenderSettings.getInstance();
String command = settings.externalOpenCommand;
try {
if (System.getProperty("os.name").contains("Windows")) {
String p = f.getAbsolutePath().replace("\\", "\\\\");
command = command.replaceAll("\\$outfile", p);
Runtime.getRuntime().exec(command);
} else {
command = command.replaceAll("\\$outfile", f.getAbsolutePath());
String[] cmdArray = ProcessConsole.splitCommandString(command);
Runtime.getRuntime().exec(cmdArray);
}
System.out.println(command);
} catch (Exception ex) {
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Could not run command: " + command, "Error", JOptionPane.ERROR_MESSAGE);
System.err.println("[" + BlueSystem.getString("message.error") + "] - " + ex.getLocalizedMessage());
ex.printStackTrace();
}
});
}
}
}
use of blue.BlueData in project blue by kunstmusik.
the class SoundObjectLibraryUtilsTest method testRemoveLibrarySoundObject.
/**
* Test of removeLibrarySoundObject method, of class SoundObjectLibraryUtils.
*/
@Test
public void testRemoveLibrarySoundObject() {
BlueData data = new BlueData();
Score score = data.getScore();
PolyObject polyObj = new PolyObject(true);
score.add(polyObj);
SoundObjectLibrary library = data.getSoundObjectLibrary();
SoundLayer layer = polyObj.newLayerAt(0);
SoundObject sObj = new GenericScore();
SoundObject sObj2 = new GenericScore();
PolyObject pObjInner = new PolyObject(true);
SoundLayer layerInner = pObjInner.newLayerAt(0);
layerInner.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(new Instance(sObj));
layer.add(sObj2);
layer.add(pObjInner);
library.add(sObj);
assertEquals(5, layer.size());
assertEquals(1, library.size());
assertEquals(1, layerInner.size());
SoundObjectLibraryUtils.removeLibrarySoundObject(data, sObj);
assertEquals(2, layer.size());
assertEquals(0, library.size());
assertEquals(0, layerInner.size());
}
Aggregations