Search in sources :

Example 36 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScoreTopComponent method reinitialize.

public synchronized void reinitialize() {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    BlueData currentData = null;
    if (project != null) {
        currentData = project.getData();
    }
    if (this.currentTimeState != null) {
        this.currentTimeState.removePropertyChangeListener(this);
    }
    if (this.data != null) {
        this.data.removePropertyChangeListener(this);
        data.getScore().removeListener(this);
        content.remove(data.getScore());
    }
    this.clearAll();
    this.data = currentData;
    AutomationManager.getInstance().setData(this.data);
    for (ScoreObject scoreObj : getLookup().lookupAll(ScoreObject.class)) {
        content.remove(scoreObj);
    }
    if (data != null) {
        Tempo tempo = data.getScore().getTempo();
        tempoControlPanel.setTempo(tempo);
        tempoEditor.setTempo(tempo);
        timeBar.setData(data);
        this.data.addPropertyChangeListener(this);
        Score score = data.getScore();
        score.addListener(this);
        ScoreController.getInstance().setScore(score);
        content.add(score);
    } else {
    }
    layerHeaderPanel.repaint();
}
Also used : BlueData(blue.BlueData) Score(blue.score.Score) Tempo(blue.score.tempo.Tempo) BlueProject(blue.projects.BlueProject) ScoreObject(blue.score.ScoreObject)

Example 37 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ProcessConsole method renderToDisk.

@Override
public void renderToDisk(DiskRenderJob job) {
    if (this.io != null) {
        try {
            this.io.getOut().reset();
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
    try {
        io = IOProvider.getDefault().getIO("Csound (Disk)", false);
        IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.WHITE);
        io.select();
        String commandLine = StringUtils.join(job.getArgs(), " ");
        BlueData data = job.getData();
        double startTime = data.getRenderStartTime();
        double endTime = data.getRenderEndTime();
        if (data.getProjectProperties().diskAlwaysRenderEntireProject) {
            startTime = 0.0f;
            endTime = -1.0f;
        }
        CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, false, false);
        String csd = result.getCsdText();
        File temp = FileUtilities.createTempTextFile("tempCsd", ".csd", BlueSystem.getCurrentProjectDirectory(), csd);
        commandLine += " \"" + temp.getAbsolutePath() + "\"";
        commandLine += " -L stdin";
        execDisk(commandLine, job.getCurrentWorkingDirectory());
        process.waitFor();
        destroy(true, true);
    } catch (ScoreGenerationException | IOException | InterruptedException e) {
        throw new RuntimeException(e);
    }
}
Also used : BlueData(blue.BlueData) ScoreGenerationException(blue.score.ScoreGenerationException) IOException(java.io.IOException) File(java.io.File) CsdRenderResult(blue.services.render.CsdRenderResult)

Example 38 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class SubChannelListPanel method reconcileSubChannelRemoveInBlueArrangement.

/**
 * A hack to explicitly walk the current blue orchestra to find any
 * BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
 * with the removed channel
 *
 * @param removedChannel
 *
 * @param oldName
 * @param newName
 */
private void reconcileSubChannelRemoveInBlueArrangement(String removedChannel) {
    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(removedChannel)) {
                        bsbSubDrop.setChannelOutput(Channel.MASTER);
                    }
                }
            }
        }
    }
}
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 39 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ExportStemsRenderer method exportStemsByInstrument.

public void exportStemsByInstrument(BlueData data) {
    BlueData tempData = new BlueData(data);
    ArrayList<InstrumentAssignment> instrumentAssignments = tempData.getArrangement().getArrangement();
    for (Iterator<InstrumentAssignment> it = instrumentAssignments.iterator(); it.hasNext(); ) {
        InstrumentAssignment instrumentAssignment = it.next();
        if (!instrumentAssignment.enabled) {
            it.remove();
        }
    }
    for (int i = 0; i < instrumentAssignments.size(); i++) {
        InstrumentAssignment ia = instrumentAssignments.get(i);
        for (int j = 0; j < instrumentAssignments.size(); j++) {
            InstrumentAssignment temp = instrumentAssignments.get(j);
            temp.enabled = (temp == ia);
        }
        RenderToDiskUtility.getInstance().renderToDisk(data, null);
    }
}
Also used : BlueData(blue.BlueData) InstrumentAssignment(blue.InstrumentAssignment)

Example 40 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class AuditionSelectedSoundObjectsAction 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;
    }
    RealtimeRenderManager.getInstance().auditionSoundObjects(data, context);
}
Also used : BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject)

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