Search in sources :

Example 26 with BlueProject

use of blue.projects.BlueProject in project blue by kunstmusik.

the class TablesTopComponent method reinitialize.

private void reinitialize() {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    if (project == null) {
        tablesText.setText("");
        tablesText.getJEditorPane().setEditable(false);
    } else {
        Tables localTables = project.getData().getTableSet();
        tablesText.setText(localTables.getTables());
        tablesText.getJEditorPane().setEditable(true);
        tables = localTables;
    }
    undo.discardAllEdits();
}
Also used : BlueProject(blue.projects.BlueProject) Tables(blue.Tables)

Example 27 with BlueProject

use of blue.projects.BlueProject 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)

Example 28 with BlueProject

use of blue.projects.BlueProject 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 29 with BlueProject

use of blue.projects.BlueProject 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)

Example 30 with BlueProject

use of blue.projects.BlueProject in project blue by kunstmusik.

the class RenderToDiskAndPlayAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    if (project != null) {
        BlueData data = project.getData();
        if (data != null) {
            RenderToDiskUtility.getInstance().renderToDisk(data, f -> {
                DiskRenderSettings settings = DiskRenderSettings.getInstance();
                if (settings.externalPlayCommandEnabled) {
                    String command = settings.externalPlayCommand;
                    command = command.replaceAll("\\$outfile", f.getAbsolutePath());
                    try {
                        if (System.getProperty("os.name").contains("Windows")) {
                            Runtime.getRuntime().exec(command);
                        } else {
                            String[] cmdArray = ProcessConsole.splitCommandString(command);
                            Runtime.getRuntime().exec(cmdArray);
                        }
                        System.out.println(command);
                    } catch (Exception ex) {
                        JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Could not run command: " + command, "Error", JOptionPane.ERROR_MESSAGE);
                        System.err.println("[" + BlueSystem.getString("message.error") + "] - " + ex.getLocalizedMessage());
                        ex.printStackTrace();
                    }
                } else {
                    SwingUtilities.invokeLater(() -> {
                        AudioFilePlayerTopComponent tc = (AudioFilePlayerTopComponent) WindowManager.getDefault().findTopComponent("AudioFilePlayerTopComponent");
                        tc.setAudioFile(f);
                    });
                }
            });
        }
    }
}
Also used : BlueData(blue.BlueData) BlueProject(blue.projects.BlueProject) DiskRenderSettings(blue.settings.DiskRenderSettings) AudioFilePlayerTopComponent(blue.ui.core.soundFile.AudioFilePlayerTopComponent)

Aggregations

BlueProject (blue.projects.BlueProject)31 BlueData (blue.BlueData)18 File (java.io.File)6 BlueProjectManager (blue.projects.BlueProjectManager)4 Frame (java.awt.Frame)3 GlobalOrcSco (blue.GlobalOrcSco)2 DiskRenderSettings (blue.settings.DiskRenderSettings)2 ProjectProperties (blue.ProjectProperties)1 Tables (blue.Tables)1 ChannelList (blue.mixer.ChannelList)1 ProjectPluginEditor (blue.project.ProjectPluginEditor)1 Score (blue.score.Score)1 ScoreObject (blue.score.ScoreObject)1 AudioLayerChannelBinding (blue.score.layers.audio.ui.bindings.AudioLayerChannelBinding)1 AudioLayerGroupBinding (blue.score.layers.audio.ui.bindings.AudioLayerGroupBinding)1 Tempo (blue.score.tempo.Tempo)1 RenderTimeManager (blue.services.render.RenderTimeManager)1 NoteParseException (blue.soundObject.NoteParseException)1 PolyObject (blue.soundObject.PolyObject)1 OpcodeList (blue.udo.OpcodeList)1