use of de.mossgrabers.framework.daw.ISceneBank in project DrivenByMoss by git-moss.
the class ScenePlayView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ISceneBank sceneBank = this.trackBank.getSceneBank();
for (int i = 0; i < 64; i++) {
final IScene scene = sceneBank.getScene(i);
final String color = scene.doesExist() ? this.trackBank.getColorOfFirstClipInScene(i) : PadGrid.GRID_OFF;
this.surface.getPadGrid().light(36 + i, color);
}
}
use of de.mossgrabers.framework.daw.ISceneBank in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 8; i++) {
final IScene scene = sceneBank.getScene(i);
final String name = StringUtils.fixASCII(scene.getName());
d.setCell(2, i, name.isEmpty() ? "Scene " + (i + 1) : name);
}
d.clearRow(0).done(0).done(2);
}
use of de.mossgrabers.framework.daw.ISceneBank in project DrivenByMoss by git-moss.
the class OSCWriter method flush.
/**
* Flush out all values.
*
* @param dump Forces a flush if true otherwise only changed values are flushed
*/
public void flush(final boolean dump) {
if (this.udpServer == null)
return;
//
// Transport
//
final ITransport trans = this.model.getTransport();
this.sendOSC("/play", trans.isPlaying(), dump);
this.sendOSC("/record", trans.isRecording(), dump);
this.sendOSC("/overdub", trans.isArrangerOverdub(), dump);
this.sendOSC("/overdub/launcher", trans.isLauncherOverdub(), dump);
this.sendOSC("/repeat", trans.isLoop(), dump);
this.sendOSC("/punchIn", trans.isPunchInEnabled(), dump);
this.sendOSC("/punchOut", trans.isPunchOutEnabled(), dump);
this.sendOSC("/click", trans.isMetronomeOn(), dump);
this.sendOSC("/click/ticks", trans.isMetronomeTicksOn(), dump);
this.sendOSC("/click/volume", trans.getMetronomeVolume(), dump);
this.sendOSC("/click/volumeStr", trans.getMetronomeVolumeStr(), dump);
this.sendOSC("/click/preroll", trans.isPrerollMetronomeEnabled(), dump);
this.sendOSC("/preroll", trans.getPrerollAsBars(), dump);
this.sendOSC("/tempo/raw", trans.getTempo(), dump);
this.sendOSC("/crossfade", trans.getCrossfade(), dump);
this.sendOSC("/autowrite", trans.isWritingArrangerAutomation(), dump);
this.sendOSC("/autowrite/launcher", trans.isWritingClipLauncherAutomation(), dump);
this.sendOSC("/automationWriteMode", trans.getAutomationWriteMode(), dump);
this.sendOSC("/time/str", trans.getPositionText(), dump);
this.sendOSC("/time/signature", trans.getNumerator() + " / " + trans.getDenominator(), dump);
this.sendOSC("/beat/str", trans.getBeatText(), dump);
//
// Frames
//
final IApplication app = this.model.getApplication();
this.sendOSC("/layout", app.getPanelLayout().toLowerCase(), dump);
final IArranger arrange = this.model.getArranger();
this.sendOSC("/arranger/cueMarkerVisibility", arrange.areCueMarkersVisible(), dump);
this.sendOSC("/arranger/playbackFollow", arrange.isPlaybackFollowEnabled(), dump);
this.sendOSC("/arranger/trackRowHeight", arrange.hasDoubleRowTrackHeight(), dump);
this.sendOSC("/arranger/clipLauncherSectionVisibility", arrange.isClipLauncherVisible(), dump);
this.sendOSC("/arranger/timeLineVisibility", arrange.isTimelineVisible(), dump);
this.sendOSC("/arranger/ioSectionVisibility", arrange.isIoSectionVisible(), dump);
this.sendOSC("/arranger/effectTracksVisibility", arrange.areEffectTracksVisible(), dump);
final IMixer mix = this.model.getMixer();
this.sendOSC("/mixer/clipLauncherSectionVisibility", mix.isClipLauncherSectionVisible(), dump);
this.sendOSC("/mixer/crossFadeSectionVisibility", mix.isCrossFadeSectionVisible(), dump);
this.sendOSC("/mixer/deviceSectionVisibility", mix.isDeviceSectionVisible(), dump);
this.sendOSC("/mixer/sendsSectionVisibility", mix.isSendSectionVisible(), dump);
this.sendOSC("/mixer/ioSectionVisibility", mix.isIoSectionVisible(), dump);
this.sendOSC("/mixer/meterSectionVisibility", mix.isMeterSectionVisible(), dump);
//
// Project
//
this.sendOSC("/project/name", this.model.getProject().getName(), dump);
this.sendOSC("/project/engine", app.isEngineActive(), dump);
//
// Master-/Track(-commands)
//
final IChannelBank trackBank = this.model.getCurrentTrackBank();
for (int i = 0; i < trackBank.getNumTracks(); i++) this.flushTrack("/track/" + (i + 1) + "/", trackBank.getTrack(i), dump);
this.flushTrack("/master/", this.model.getMasterTrack(), dump);
final ITrack selectedTrack = trackBank.getSelectedTrack();
this.flushTrack("/track/selected/", selectedTrack == null ? EMPTY_TRACK : selectedTrack, dump);
this.sendOSC("/track/toggleBank", this.model.isEffectTrackBankActive() ? 1 : 0, dump);
//
// Scenes
//
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < sceneBank.getNumScenes(); i++) this.flushScene("/scene/" + (i + 1) + "/", sceneBank.getScene(i), dump);
//
// Device / Primary Device
//
final ICursorDevice cd = this.model.getCursorDevice();
this.flushDevice("/device/", cd, dump);
if (cd.hasDrumPads()) {
for (int i = 0; i < cd.getNumDrumPads(); i++) this.flushDeviceLayers("/device/drumpad/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
}
for (int i = 0; i < cd.getNumLayers(); i++) this.flushDeviceLayers("/device/layer/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
this.flushDevice("/primary/", this.model.getPrimaryDevice(), dump);
//
// Browser
//
this.flushBrowser("/browser/", this.model.getBrowser(), dump);
//
// Notes
//
this.flushNotes("/vkb_midi/note/", dump);
try {
int pos = 0;
this.udpServer.startBundle();
for (final OscMessageData message : this.messages) {
final String address = message.getAddress();
final Object[] values = message.getValues();
this.udpServer.sendMessage(address, values);
pos++;
if (pos > 1000) {
pos = 0;
this.udpServer.endBundle();
this.udpServer.startBundle();
}
}
this.udpServer.endBundle();
} catch (final IOException ex) {
this.model.getHost().error("Could not send UDP message.", ex);
}
this.messages.clear();
}
use of de.mossgrabers.framework.daw.ISceneBank in project DrivenByMoss by git-moss.
the class PlayView method updateSceneButtons.
/**
* {@inheritDoc}
*/
@Override
public void updateSceneButtons() {
final ISceneBank sceneBank = this.model.getSceneBank();
if (sceneBank == null)
return;
final boolean isPush2 = this.surface.getConfiguration().isPush2();
final int off = isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
final int green = isPush2 ? PushColors.PUSH2_COLOR_SCENE_GREEN : PushColors.PUSH1_COLOR_SCENE_GREEN;
for (int i = 0; i < 8; i++) this.surface.updateButton(PushControlSurface.PUSH_BUTTON_SCENE1 + i, sceneBank.sceneExists(7 - i) ? green : off);
}
use of de.mossgrabers.framework.daw.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method updateSceneButtons.
/**
* {@inheritDoc}
*/
@Override
public void updateSceneButtons() {
final ISceneBank sceneBank = this.model.getSceneBank();
final boolean isPush2 = this.surface.getConfiguration().isPush2();
final int off = isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
final int green = isPush2 ? PushColors.PUSH2_COLOR_SCENE_GREEN : PushColors.PUSH1_COLOR_SCENE_GREEN;
for (int i = 0; i < 8; i++) this.surface.updateButton(PushControlSurface.PUSH_BUTTON_SCENE1 + i, sceneBank.sceneExists(7 - i) ? green : off);
}
Aggregations