Search in sources :

Example 16 with BlueData

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");
    }
}
Also used : BlueData(blue.BlueData) CsdRenderResult(blue.services.render.CsdRenderResult)

Example 17 with BlueData

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");
    }
}
Also used : BlueData(blue.BlueData) CsdRenderResult(blue.services.render.CsdRenderResult)

Example 18 with BlueData

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);
}
Also used : ProjectPluginEditor(blue.project.ProjectPluginEditor) BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject) ProjectProperties(blue.ProjectProperties)

Example 19 with BlueData

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();
                }
            });
        }
    }
}
Also used : BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject) DiskRenderSettings(blue.settings.DiskRenderSettings)

Example 20 with BlueData

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());
}
Also used : BlueData(blue.BlueData) Score(blue.score.Score) GenericScore(blue.soundObject.GenericScore) SoundObject(blue.soundObject.SoundObject) Instance(blue.soundObject.Instance) SoundLayer(blue.SoundLayer) SoundObjectLibrary(blue.SoundObjectLibrary) GenericScore(blue.soundObject.GenericScore) PolyObject(blue.soundObject.PolyObject) Test(org.junit.Test)

Aggregations

BlueData (blue.BlueData)46 BlueProject (blue.projects.BlueProject)18 PolyObject (blue.soundObject.PolyObject)9 File (java.io.File)9 SoundLayer (blue.SoundLayer)7 ScoreObject (blue.score.ScoreObject)7 Instance (blue.soundObject.Instance)6 CsdRenderResult (blue.services.render.CsdRenderResult)5 SoundObject (blue.soundObject.SoundObject)5 SoundObjectLibrary (blue.SoundObjectLibrary)4 Arrangement (blue.Arrangement)3 BlueSynthBuilder (blue.orchestra.BlueSynthBuilder)3 Layer (blue.score.layers.Layer)3 ScoreObjectLayer (blue.score.layers.ScoreObjectLayer)3 DiskRenderSettings (blue.settings.DiskRenderSettings)3 ScoreController (blue.ui.core.score.ScoreController)3 AddScoreObjectEdit (blue.ui.core.score.undo.AddScoreObjectEdit)3 Frame (java.awt.Frame)3 Point (java.awt.Point)3 IOException (java.io.IOException)3