Search in sources :

Example 31 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScoreSection method main.

public static void main(String[] args) {
    File test = new File("/work/blue/trappedInConvert/01-Trapped.csd");
    try {
        BufferedReader in = new BufferedReader(new FileReader(test));
        String line = "";
        StringBuilder buffer = new StringBuilder();
        while ((line = in.readLine()) != null) {
            buffer.append(line).append("\n");
        }
        String CSD = buffer.toString();
        BlueData data = CSDUtility.convertCSDtoBlue(CSD, CSDUtility.IMPORT_SINGLE_SOUNDOBJECT);
        System.out.println(data.saveAsXML());
    } catch (Exception e) {
        e.printStackTrace();
        System.exit(1);
    }
}
Also used : BlueData(blue.BlueData) BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) File(java.io.File)

Example 32 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScoreSection method convertOrcScoToBlue.

public static BlueData convertOrcScoToBlue(File orcFile, File scoFile, int importMode) {
    BlueData data = null;
    try {
        String orc = TextUtilities.getTextFromFile(orcFile);
        String sco = TextUtilities.getTextFromFile(scoFile);
        data = new BlueData();
        parseCsOrc(data, orc);
        parseCsScore(data, sco, importMode);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return data;
}
Also used : BlueData(blue.BlueData)

Example 33 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScoreSection method convertCSDtoBlue.

public static BlueData convertCSDtoBlue(File csdFile, int importMode) {
    BlueData data = null;
    try {
        String CSD = TextUtilities.getTextFromFile(csdFile);
        data = convertCSDtoBlue(CSD, importMode);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return data;
}
Also used : BlueData(blue.BlueData)

Example 34 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class AddToSoundObjectLibraryAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    SoundObject sObj = (SoundObject) soundObjects.iterator().next().deepCopy();
    if (sObj instanceof Instance) {
        return;
    }
    BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
    Instance i = new Instance(sObj);
    i.setStartTime(sObj.getStartTime());
    i.setSubjectiveDuration(sObj.getSubjectiveDuration());
    data.getSoundObjectLibrary().addSoundObject(sObj);
    SoundLayer layer = (SoundLayer) scorePath.getGlobalLayerForY(p.y);
    layer.remove(soundObjects.iterator().next());
    layer.add(i);
// BlueUndoManager.setUndoManager("score");
// BlueUndoManager.addEdit(new ReplaceScoreObjectEdit(
// sCanvas.getPolyObject(), oldSoundObject,
// newSoundObject, index));
}
Also used : BlueData(blue.BlueData) SoundObject(blue.soundObject.SoundObject) Instance(blue.soundObject.Instance) SoundLayer(blue.SoundLayer)

Example 35 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScratchPadTopComponent method reinitialize.

private void reinitialize() {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    if (project != null) {
        BlueData currentData = project.getData();
        setScratchPadData(currentData.getScratchPadData());
    } else {
        setScratchPadData(null);
    }
}
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