use of blue.BlueData 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.BlueData in project blue by kunstmusik.
the class ProcessConsole method renderToDisk.
@Override
public void renderToDisk(DiskRenderJob job) {
if (this.io != null) {
try {
this.io.getOut().reset();
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
try {
io = IOProvider.getDefault().getIO("Csound (Disk)", false);
IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.WHITE);
io.select();
String commandLine = StringUtils.join(job.getArgs(), " ");
BlueData data = job.getData();
double startTime = data.getRenderStartTime();
double endTime = data.getRenderEndTime();
if (data.getProjectProperties().diskAlwaysRenderEntireProject) {
startTime = 0.0f;
endTime = -1.0f;
}
CsdRenderResult result = CSDRenderService.getDefault().generateCSD(data, startTime, endTime, false, false);
String csd = result.getCsdText();
File temp = FileUtilities.createTempTextFile("tempCsd", ".csd", BlueSystem.getCurrentProjectDirectory(), csd);
commandLine += " \"" + temp.getAbsolutePath() + "\"";
commandLine += " -L stdin";
execDisk(commandLine, job.getCurrentWorkingDirectory());
process.waitFor();
destroy(true, true);
} catch (ScoreGenerationException | IOException | InterruptedException e) {
throw new RuntimeException(e);
}
}
use of blue.BlueData in project blue by kunstmusik.
the class SubChannelListPanel method reconcileSubChannelRemoveInBlueArrangement.
/**
* A hack to explicitly walk the current blue orchestra to find any
* BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
* with the removed channel
*
* @param removedChannel
*
* @param oldName
* @param newName
*/
private void reconcileSubChannelRemoveInBlueArrangement(String removedChannel) {
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
if (data == null) {
return;
}
Arrangement arr = data.getArrangement();
for (int i = 0; i < arr.size(); i++) {
Instrument instr = arr.getInstrument(i);
if (instr instanceof BlueSynthBuilder) {
BlueSynthBuilder bsb = (BlueSynthBuilder) instr;
BSBGraphicInterface bsbInterface = bsb.getGraphicInterface();
for (BSBObject bsbObj : bsbInterface.getAllSet()) {
if (bsbObj instanceof BSBSubChannelDropdown) {
BSBSubChannelDropdown bsbSubDrop = (BSBSubChannelDropdown) bsbObj;
if (bsbSubDrop.getChannelOutput().equals(removedChannel)) {
bsbSubDrop.setChannelOutput(Channel.MASTER);
}
}
}
}
}
}
use of blue.BlueData in project blue by kunstmusik.
the class ExportStemsRenderer method exportStemsByInstrument.
public void exportStemsByInstrument(BlueData data) {
BlueData tempData = new BlueData(data);
ArrayList<InstrumentAssignment> instrumentAssignments = tempData.getArrangement().getArrangement();
for (Iterator<InstrumentAssignment> it = instrumentAssignments.iterator(); it.hasNext(); ) {
InstrumentAssignment instrumentAssignment = it.next();
if (!instrumentAssignment.enabled) {
it.remove();
}
}
for (int i = 0; i < instrumentAssignments.size(); i++) {
InstrumentAssignment ia = instrumentAssignments.get(i);
for (int j = 0; j < instrumentAssignments.size(); j++) {
InstrumentAssignment temp = instrumentAssignments.get(j);
temp.enabled = (temp == ia);
}
RenderToDiskUtility.getInstance().renderToDisk(data, null);
}
}
use of blue.BlueData 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);
}
Aggregations