Search in sources :

Example 1 with ProjectProperties

use of blue.ProjectProperties in project blue by kunstmusik.

the class BlueProjectManager method createNewProject.

public static BlueProject createNewProject() {
    final BlueData blueData = new BlueData();
    BlueProject project = new BlueProject(blueData, null);
    for (LayerGroup<?> layerGroup : blueData.getScore()) {
        if (layerGroup instanceof PolyObject) {
            PolyObject pObj = (PolyObject) layerGroup;
            pObj.setDefaultHeightIndex(ProjectDefaultsSettings.getInstance().layerHeightDefault);
            if (pObj.size() == 0) {
                pObj.newLayerAt(-1);
            }
        }
    }
    blueData.getMixer().setEnabled(ProjectDefaultsSettings.getInstance().mixerEnabled);
    ProjectProperties proj = blueData.getProjectProperties();
    proj.author = ProjectDefaultsSettings.getInstance().defaultAuthor;
    RealtimeRenderSettings rtSettings = RealtimeRenderSettings.getInstance();
    proj.sampleRate = rtSettings.defaultSr;
    proj.ksmps = rtSettings.defaultKsmps;
    proj.channels = rtSettings.defaultNchnls;
    proj.useZeroDbFS = rtSettings.useZeroDbFS;
    proj.zeroDbFS = rtSettings.zeroDbFS;
    proj.useAudioOut = rtSettings.audioOutEnabled;
    proj.useAudioIn = rtSettings.audioInEnabled;
    proj.useMidiIn = rtSettings.midiInEnabled;
    proj.useMidiOut = rtSettings.midiOutEnabled;
    proj.noteAmpsEnabled = rtSettings.noteAmpsEnabled;
    proj.outOfRangeEnabled = rtSettings.outOfRangeEnabled;
    proj.warningsEnabled = rtSettings.warningsEnabled;
    proj.benchmarkEnabled = rtSettings.benchmarkEnabled;
    proj.advancedSettings = rtSettings.advancedSettings;
    // proj.commandLine = ProgramOptions.getDefaultCommandline();
    DiskRenderSettings diskSettings = DiskRenderSettings.getInstance();
    proj.diskSampleRate = diskSettings.defaultSr;
    proj.diskKsmps = diskSettings.defaultKsmps;
    proj.diskChannels = diskSettings.defaultNchnls;
    proj.diskUseZeroDbFS = diskSettings.useZeroDbFS;
    proj.diskZeroDbFS = diskSettings.zeroDbFS;
    proj.diskNoteAmpsEnabled = diskSettings.noteAmpsEnabled;
    proj.diskOutOfRangeEnabled = diskSettings.outOfRangeEnabled;
    proj.diskWarningsEnabled = diskSettings.warningsEnabled;
    proj.diskBenchmarkEnabled = diskSettings.benchmarkEnabled;
    proj.diskAdvancedSettings = diskSettings.advancedSettings;
    return project;
}
Also used : BlueData(blue.BlueData) RealtimeRenderSettings(blue.settings.RealtimeRenderSettings) DiskRenderSettings(blue.settings.DiskRenderSettings) ProjectProperties(blue.ProjectProperties) PolyObject(blue.soundObject.PolyObject)

Example 2 with ProjectProperties

use of blue.ProjectProperties in project blue by kunstmusik.

the class CSDRender method appendCsInstruments.

private void appendCsInstruments(CompileData compileData, BlueData data, OpcodeList udos, Arrangement arrangement, GlobalOrcSco globalOrcSco, StrBuilder score, Mixer mixer, boolean isRealTime) {
    ProjectProperties projProps = data.getProjectProperties();
    score.append("<CsInstruments>\n");
    int nchnls = 2;
    if (isRealTime) {
        try {
            nchnls = Integer.parseInt(projProps.channels.trim());
        } catch (NumberFormatException nfe) {
            System.err.println("Could not parse nchnls: defaulting to 2");
        }
        score.append("sr=").append(projProps.sampleRate).append("\n");
        score.append("ksmps=").append(projProps.getKsmps()).append("\n");
        score.append("nchnls=").append(nchnls).append("\n");
        if (projProps.useZeroDbFS) {
            score.append("0dbfs=").append(projProps.zeroDbFS).append("\n");
        }
    } else {
        try {
            nchnls = Integer.parseInt(projProps.diskChannels.trim());
        } catch (NumberFormatException nfe) {
            System.err.println("Could not parse nchnls: defaulting to 2");
        }
        score.append("sr=").append(projProps.diskSampleRate).append("\n");
        score.append("ksmps=").append(projProps.diskKsmps).append("\n");
        score.append("nchnls=").append(nchnls).append("\n");
        if (projProps.diskUseZeroDbFS) {
            score.append("0dbfs=").append(projProps.diskZeroDbFS).append("\n");
        }
    }
    score.append("\n");
    score.append(globalOrcSco.getGlobalOrc()).append("\n");
    score.append("\n");
    score.append(CommandProcessor.processCommandBlocks(arrangement.generateGlobalOrc(compileData))).append("\n");
    score.append("\n");
    score.append(udos.toString()).append("\n");
    score.append("\n");
    score.append(arrangement.generateOrchestra(compileData, mixer, nchnls));
    score.append("\n");
    score.append("</CsInstruments>\n\n");
}
Also used : ProjectProperties(blue.ProjectProperties) LinePoint(blue.components.lines.LinePoint)

Example 3 with ProjectProperties

use of blue.ProjectProperties 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 4 with ProjectProperties

use of blue.ProjectProperties in project blue by kunstmusik.

the class CSDRender method appendProjectInfo.

private void appendProjectInfo(BlueData data, StrBuilder score) {
    ProjectProperties props = data.getProjectProperties();
    String notes = props.notes.replaceAll("\n", "\n; ");
    score.append(";\n");
    score.append("; \"").append(props.title).append("\"\n");
    score.append("; by ").append(props.author).append("\n");
    score.append(";\n");
    score.append("; ").append(notes).append("\n");
    score.append(";\n");
    score.append("; Generated by blue ").append(BlueConstants.getVersion()).append(" (http://blue.kunstmusik.com)\n");
    score.append(";\n\n");
}
Also used : ProjectProperties(blue.ProjectProperties)

Example 5 with ProjectProperties

use of blue.ProjectProperties in project blue by kunstmusik.

the class RenderToDiskUtility method getDiskCommandLine.

/**
 * Gets the disk commandline, asking for file output if necessary
 *
 * SIDE EFFECT: also sets property for dialog for what the outputted file
 * was, to be used by clients of the dialog
 *
 * @param data
 * @return
 * @throws IOException
 */
private DiskRenderCommand getDiskCommandLine(BlueData data) throws IOException {
    String[] args;
    String fileOutput;
    ProjectProperties props = data.getProjectProperties();
    if (props.diskCompleteOverride) {
        String command = props.diskAdvancedSettings;
        if (!GeneralSettings.getInstance().isMessageColorsEnabled()) {
            command += " -+msg_color=false ";
        }
        args = command.split("\\s+");
        fileOutput = getFileOutputFromCommand(command);
    } else {
        String fileName = "";
        if (props.askOnRender || props.fileName.trim().length() == 0) {
            File retVal = FileChooserManager.getDefault().showSaveDialog(FILE_CHOOSER_ID, WindowManager.getDefault().getMainWindow());
            if (retVal != null) {
                fileName = retVal.getCanonicalPath();
            } else {
                return null;
            }
        } else {
            fileName = props.fileName;
        }
        fileOutput = fileName;
        DiskRenderSettings settings = DiskRenderSettings.getInstance();
        String command = settings.getCommandLine() + " " + getMessageLevelFlag(props) + " " + props.diskAdvancedSettings + " -o \"" + fileName + "\"";
        args = command.split("\\s+");
    }
    return new DiskRenderCommand(args, fileOutput);
}
Also used : DiskRenderSettings(blue.settings.DiskRenderSettings) ProjectProperties(blue.ProjectProperties) File(java.io.File)

Aggregations

ProjectProperties (blue.ProjectProperties)5 BlueData (blue.BlueData)2 DiskRenderSettings (blue.settings.DiskRenderSettings)2 LinePoint (blue.components.lines.LinePoint)1 ProjectPluginEditor (blue.project.ProjectPluginEditor)1 BlueProject (blue.projects.BlueProject)1 RealtimeRenderSettings (blue.settings.RealtimeRenderSettings)1 PolyObject (blue.soundObject.PolyObject)1 File (java.io.File)1