use of blue.BlueData in project blue by kunstmusik.
the class SubChannelListPanel method reconcileNameChangeInBlueArrangement.
/**
* A hack to explicitly walk the current blue orchestra to find any
* BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
* the name change.
*
* @param oldName
* @param newName
*/
private void reconcileNameChangeInBlueArrangement(String oldName, String newName) {
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(oldName)) {
bsbSubDrop.setChannelOutput(newName);
}
}
}
}
}
}
use of blue.BlueData in project blue by kunstmusik.
the class BlueLiveToolBar method reinitialize.
private void reinitialize() {
this.data = null;
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
BlueData currentData = null;
if (project != null) {
this.data = project.getData();
}
}
use of blue.BlueData in project blue by kunstmusik.
the class MidiInputPanelTopComponent method reinitialize.
protected void reinitialize() {
BlueProject project = BlueProjectManager.getInstance().getCurrentProject();
BlueData data = null;
if (project != null) {
data = project.getData();
midiInputProcessorPanel1.setMidiInputProcessor(data.getMidiInputProcessor());
}
}
use of blue.BlueData in project blue by kunstmusik.
the class AddMarkerAction 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;
}
RenderTimeManager timeManager = Lookup.getDefault().lookup(RenderTimeManager.class);
ScorePath path = ScoreController.getInstance().getScorePath();
if (path.getLastLayerGroup() == null) {
double markerTime = MainToolBar.getInstance().isRendering() ? timeManager.getRenderTime() + timeManager.getRenderStartTime() : data.getRenderStartTime();
data.getMarkersList().addMarker(markerTime);
}
}
use of blue.BlueData in project blue by kunstmusik.
the class GenerateCsdAction method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
final Frame mainWindow = WindowManager.getDefault().getMainWindow();
File rValue = FileChooserManager.getDefault().showSaveDialog(FILE_GEN, mainWindow);
if (rValue != null) {
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
File temp = rValue;
if (!(temp.getName().trim().endsWith(".csd"))) {
temp = new File(temp.getAbsolutePath() + ".csd");
}
try {
try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(temp)))) {
final CsdRenderResult renderResult = CSDRenderService.getDefault().generateCSD(data, data.getRenderStartTime(), data.getRenderEndTime(), false, false);
out.print(renderResult.getCsdText());
out.flush();
}
StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generateScore.success") + " " + temp.getName());
} catch (Exception ex) {
ExceptionDialog.showExceptionDialog(mainWindow, ex);
throw new RuntimeException("CSDRender Failed");
}
}
// if (rValue == JFileChooser.CANCEL_OPTION) {
// StatusDisplayer.getDefault().setStatusText(BlueSystem.getString(
// "message.actionCancelled"));
// }
}
Aggregations