Search in sources :

Example 21 with BlueProject

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

the class NewProjectAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    final BlueProjectManager blueProjectManager = BlueProjectManager.getInstance();
    BlueProject project = BlueProjectManager.createNewProject();
    blueProjectManager.setCurrentProject(project);
}
Also used : BlueProjectManager(blue.projects.BlueProjectManager) BlueProject(blue.projects.BlueProject)

Example 22 with BlueProject

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

the class BackupFileSaver method saveFileBackups.

private void saveFileBackups() {
    for (int i = 0; i < projectManager.getNumProjects(); i++) {
        BlueProject bdf = projectManager.getProject(i);
        if (bdf.getDataFile() != null && !bdf.isOpenedFromTempFile()) {
            if (bdf.getTempFile() == null) {
                bdf.setTempFile(new File(bdf.getDataFile().getAbsolutePath() + "~"));
            }
            try {
                try (PrintWriter out = new PrintWriter(new FileWriter(bdf.getTempFile()))) {
                    out.print(bdf.getData().saveAsXML().toString());
                    out.flush();
                }
            } catch (IOException ioe) {
            // String errorMessage = BlueSystem
            // .getString("message.file.couldNotSave")
            // + "\n\n" + ioe.getLocalizedMessage();
            // JOptionPane.showMessageDialog(null, errorMessage,
            // BlueSystem
            // .getString("message.error"),
            // JOptionPane.ERROR_MESSAGE);
            // StatusBar.updateStatus(BlueSystem
            // .getString("message.file.couldNotSave")
            // + " - " + ioe.getLocalizedMessage());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
Also used : BlueProject(blue.projects.BlueProject) FileWriter(java.io.FileWriter) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException) PrintWriter(java.io.PrintWriter)

Example 23 with BlueProject

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

the class TempFileCleaner method propertyChange.

@Override
public void propertyChange(PropertyChangeEvent evt) {
    BlueProjectManager bpm = BlueProjectManager.getInstance();
    BlueProject currentProject = bpm.getCurrentProject();
    if (currentProject.isTempCsdFilesChecked()) {
        return;
    }
    currentProject.setTempCsdFilesChecked(true);
    File curProjFile = currentProject.getDataFile();
    if (curProjFile == null) {
        return;
    }
    File parentProjDir = curProjFile.getParentFile();
    int size = bpm.getNumProjects();
    boolean otherOpenProjectsFound = false;
    for (int i = 0; i < size; i++) {
        BlueProject project = bpm.getProject(i);
        if (project != currentProject) {
            if (project.getDataFile() != null) {
                File parentDir = project.getDataFile().getParentFile();
                if (parentDir.equals(parentProjDir)) {
                    otherOpenProjectsFound = true;
                    break;
                }
            }
        }
    }
    if (otherOpenProjectsFound) {
        return;
    }
    File[] tempFiles = parentProjDir.listFiles((File dir, String name) -> name.startsWith("tempCsd") && name.endsWith(".csd"));
    if (tempFiles.length > 0) {
        int retVal = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), "Temporary CSD files were found.  These are " + "probably from a previous Blue session that crashed.  Would you like to " + "delete these?", "Temp CSD Files Found", JOptionPane.YES_NO_OPTION);
        if (retVal == JOptionPane.YES_OPTION) {
            deleteTempFiles(tempFiles);
        }
    }
}
Also used : BlueProjectManager(blue.projects.BlueProjectManager) BlueProject(blue.projects.BlueProject) File(java.io.File)

Example 24 with BlueProject

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

the class BlueLiveTopComponent method reinitialize.

private void reinitialize() {
    this.data = null;
    this.compileData = CompileData.createEmptyCompileData();
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    BlueData currentData = null;
    if (project != null) {
        currentData = project.getData();
    }
    if (currentData != null) {
        LiveData liveData = currentData.getLiveData();
        this.liveObjectsTable.setAutoCreateColumnsFromModel(true);
        model.setLiveObjectBins(liveData.getLiveObjectBins());
        setModel.setLiveObjectSetList(liveData.getLiveObjectSets());
        this.liveObjectsTable.setModel(model);
        this.liveObjectSetListTable.setModel(setModel);
        this.commandLineText.setText(liveData.getCommandLine());
        this.enableAdvancedFlags.setSelected(liveData.isCommandLineEnabled());
        this.completeOverride.setSelected(liveData.isCommandLineOverride());
        this.repeatButton.setSelected(liveData.isRepeatEnabled());
        commandLineText.setEnabled(liveData.isCommandLineEnabled());
        // liveObjectsTable.getColumnModel().getColumn(2).setMaxWidth(100);
        // liveObjectsTable.getColumnModel().getColumn(2).setMinWidth(100);
        // liveObjectsTable.getColumnModel().getColumn(2).setWidth(100);
        // csoundCommand.setText(data.getLiveData().getCommandLine());
        // liveSpace.setLiveObjects(data.getLiveData().getLiveSoundObjects());
        repeatSpinner.setValue(liveData.getRepeat());
        tempoSpinner.setValue(liveData.getTempo());
        liveCodeEditor.setText(liveData.getLiveCodeText());
        this.data = currentData;
        this.repaint();
    }
}
Also used : BlueProject(blue.projects.BlueProject)

Example 25 with BlueProject

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

the class OrchestraTopComponent method reinitialize.

private void reinitialize() {
    BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
    if (project == null) {
        instrumentEditPanel1.editInstrument(null);
        arrangementPanel.setMixer(null);
        arrangementPanel.setArrangement(null);
    } else {
        instrumentEditPanel1.editInstrument(null);
        arrangementPanel.setMixer(project.getData().getMixer());
        arrangementPanel.setArrangement(project.getData().getArrangement());
    }
}
Also used : BlueProject(blue.projects.BlueProject)

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