Search in sources :

Example 46 with BlueData

use of blue.BlueData in project blue by kunstmusik.

the class ScoreObjectEditorTopComponent method resultChanged.

@Override
public void resultChanged(LookupEvent ev) {
    if (!(TopComponent.getRegistry().getActivated() instanceof SoundObjectProvider)) {
        return;
    }
    Collection<? extends ScoreObject> scoreObjects = result.allInstances();
    if (scoreObjects.size() == 1) {
        SwingUtilities.invokeLater(() -> {
            BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
            ScoreObject sObj = scoreObjects.iterator().next();
            if (sObj instanceof PolyObject && data.getSoundObjectLibrary().contains(sObj)) {
                PolyObject pObj = (PolyObject) sObj;
                ScoreController.getInstance().editLayerGroup(pObj);
                editScoreObject(null);
            } else {
                editScoreObject(sObj);
            }
        });
    // FIXME - figure out how to discern if editing is from BlueLive...
    } else {
        SwingUtilities.invokeLater(() -> {
            editScoreObject(null);
        });
    }
}
Also used : SoundObjectProvider(blue.ui.core.score.layers.SoundObjectProvider) BlueData(blue.BlueData) ScoreObject(blue.score.ScoreObject) PolyObject(blue.soundObject.PolyObject)

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