Search in sources :

Example 11 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class SubChannelListPanel method reconcileNameChangeInBlueArrangement.

/**
 * A hack to explicitly walk the current blue orchestra to find any
 * BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
 * the name change.
 *
 * @param oldName
 * @param newName
 */
private void reconcileNameChangeInBlueArrangement(String oldName, String newName) {
    BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
    if (data == null) {
        return;
    }
    Arrangement arr = data.getArrangement();
    for (int i = 0; i < arr.size(); i++) {
        Instrument instr = arr.getInstrument(i);
        if (instr instanceof BlueSynthBuilder) {
            BlueSynthBuilder bsb = (BlueSynthBuilder) instr;
            BSBGraphicInterface bsbInterface = bsb.getGraphicInterface();
            for (BSBObject bsbObj : bsbInterface.getAllSet()) {
                if (bsbObj instanceof BSBSubChannelDropdown) {
                    BSBSubChannelDropdown bsbSubDrop = (BSBSubChannelDropdown) bsbObj;
                    if (bsbSubDrop.getChannelOutput().equals(oldName)) {
                        bsbSubDrop.setChannelOutput(newName);
                    }
                }
            }
        }
    }
}
Also used : BlueData(blue.BlueData) BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) BSBObject(blue.orchestra.blueSynthBuilder.BSBObject) BSBSubChannelDropdown(blue.orchestra.blueSynthBuilder.BSBSubChannelDropdown) Instrument(blue.orchestra.Instrument) BlueSynthBuilder(blue.orchestra.BlueSynthBuilder) Arrangement(blue.Arrangement)

Example 12 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class BlueLiveToolBar method reinitialize.

private void reinitialize() {
    this.data = null;
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    BlueData currentData = null;
    if (project != null) {
        this.data = project.getData();
    }
}
Also used : BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject)

Example 13 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class MidiInputPanelTopComponent method reinitialize.

protected void reinitialize() {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    BlueData data = null;
    if (project != null) {
        data = project.getData();
        midiInputProcessorPanel1.setMidiInputProcessor(data.getMidiInputProcessor());
    }
}
Also used : BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject)

Example 14 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class AddMarkerAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    if (project == null) {
        return;
    }
    BlueData data = project.getData();
    if (data == null) {
        return;
    }
    RenderTimeManager timeManager = Lookup.getDefault().lookup(RenderTimeManager.class);
    ScorePath path = ScoreController.getInstance().getScorePath();
    if (path.getLastLayerGroup() == null) {
        double markerTime = MainToolBar.getInstance().isRendering() ? timeManager.getRenderTime() + timeManager.getRenderStartTime() : data.getRenderStartTime();
        data.getMarkersList().addMarker(markerTime);
    }
}
Also used : BlueData(blue.BlueData) ScorePath(blue.ui.core.score.ScorePath) BlueProject(blue.projects.BlueProject) RenderTimeManager(blue.services.render.RenderTimeManager)

Example 15 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class GenerateCsdAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    final Frame mainWindow = WindowManager.getDefault().getMainWindow();
    File rValue = FileChooserManager.getDefault().showSaveDialog(FILE_GEN, mainWindow);
    if (rValue != null) {
        BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
        File temp = rValue;
        if (!(temp.getName().trim().endsWith(".csd"))) {
            temp = new File(temp.getAbsolutePath() + ".csd");
        }
        try {
            try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(temp)))) {
                final CsdRenderResult renderResult = CSDRenderService.getDefault().generateCSD(data, data.getRenderStartTime(), data.getRenderEndTime(), false, false);
                out.print(renderResult.getCsdText());
                out.flush();
            }
            StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generateScore.success") + " " + temp.getName());
        } catch (Exception ex) {
            ExceptionDialog.showExceptionDialog(mainWindow, ex);
            throw new RuntimeException("CSDRender Failed");
        }
    }
// if (rValue == JFileChooser.CANCEL_OPTION) {
// StatusDisplayer.getDefault().setStatusText(BlueSystem.getString(
// "message.actionCancelled"));
// }
}
Also used : BlueData(blue.BlueData) Frame(java.awt.Frame) FileWriter(java.io.FileWriter) File(java.io.File) PrintWriter(java.io.PrintWriter) BufferedWriter(java.io.BufferedWriter) CsdRenderResult(blue.services.render.CsdRenderResult)

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