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();
}
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);
}
}
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();
}
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);
}
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);
});
}
});
}
}
}
Aggregations