use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class ControlMode method sendAdditionalMPCParameters.
/**
* Send additional parameters specific to the MPC models.
*
* @param d The display
*/
private void sendAdditionalMPCParameters(final ACVSDisplay d) {
final ITransport transport = this.model.getTransport();
final IApplication application = this.model.getApplication();
final IArranger arranger = this.model.getArranger();
final ICursorDevice device = this.model.getCursorDevice();
d.setScreenItem(ScreenItem.MPC_METRONOME, transport.isMetronomeOn() ? 127 : 0);
// ScreenItem.MPC_CAPTURE_MIDI - not supported
// ScreenItem.MPC_ABLETON_LINK - not supported
final boolean isOverdub = this.surface.isShiftPressed() ? transport.isLauncherOverdub() : transport.isArrangerOverdub();
d.setScreenItem(ScreenItem.MPC_ARRANGE_OVERDUB, isOverdub ? 127 : 0);
final boolean isAutomation = this.surface.isShiftPressed() ? transport.isWritingClipLauncherAutomation() : transport.isWritingArrangerAutomation();
d.setScreenItem(ScreenItem.MPC_ARRANGER_AUTOMATION_ARM, isAutomation ? 127 : 0);
d.setScreenItem(ScreenItem.MPC_LOOP_SWITCH, transport.isLoop() ? 127 : 0);
d.setScreenItem(ScreenItem.MPC_LAUNCH_QUANTIZE, convertLaunchQuantization(transport.getDefaultLaunchQuantization()));
d.setScreenItem(ScreenItem.MPC_ARRANGEMENT_SESSION, application.isArrangeLayout() ? 1 : 0);
d.setScreenItem(ScreenItem.MPC_FOLLOW, arranger.isPlaybackFollowEnabled() ? 127 : 0);
// ScreenItem.MPC_CLIP_DEVICE_VIEW - not supported
d.setScreenItem(ScreenItem.MPC_DEVICE_LOCK, device.isPinned() ? 127 : 0);
d.setScreenItem(ScreenItem.MPC_DETAIL_VIEW, device.isExpanded() ? 127 : 0);
d.setScreenItem(ScreenItem.MPC_QUANTIZE_INTERVAL, Math.max(0, Math.min(7, 10 - this.surface.getConfiguration().getQuantizeAmount() / 10)));
d.setScreenItem(ScreenItem.MPC_CLIP_SCENE_LAUNCH, this.surface.getConfiguration().isLaunchClips() ? 0 : 1);
}
use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class MaschineJamParameterMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (!cursorDevice.doesExist())
return FADER_OFF;
final IParameter parameter = cursorDevice.getParameterBank().getItem(index);
if (!parameter.doesExist())
return FADER_OFF;
final int value = this.model.getValueChanger().toMidiValue(parameter.getValue());
return new FaderConfig(FaderConfig.TYPE_SINGLE, MaschineColorManager.PARAM_COLORS.get(index).intValue(), value);
}
use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class ParametersMode method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
// Colors in combination with Shift
if (this.surface.isShiftPressed())
return this.getButtonColorShifted(buttonID);
// Colors in combination with Arrow Up
if (this.surface.isLongPressed(ButtonID.ARROW_UP))
return this.getButtonColorArrowUp(buttonID);
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist())
return 0;
// Colors normal behavior
final int index = buttonID.ordinal() - ButtonID.ROW1_1.ordinal();
if (this.showDevices) {
final IDeviceBank bank = cd.getDeviceBank();
final IDevice item = bank.getItem(index);
if (!item.doesExist())
return SLMkIIIColorManager.SLMKIII_BLACK;
return index == cd.getIndex() ? SLMkIIIColorManager.SLMKIII_MINT : SLMkIIIColorManager.SLMKIII_MINT_HALF;
}
final IParameterPageBank bank = cd.getParameterPageBank();
final int selectedItemIndex = bank.getSelectedItemIndex();
if (bank.getItem(index).isEmpty())
return SLMkIIIColorManager.SLMKIII_BLACK;
return index == selectedItemIndex ? SLMkIIIColorManager.SLMKIII_PURPLE : SLMkIIIColorManager.SLMKIII_PURPLE_HALF;
}
use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class ParametersMode method setShowDevices.
/**
* Show devices or the parameter banks of the cursor device for selection.
*
* @param showDevices True to show devices otherwise parameters
*/
@SuppressWarnings("unchecked")
public final void setShowDevices(final boolean showDevices) {
this.showDevices = showDevices;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
this.switchBanks((IBank<IItem>) (this.showDevices ? cursorDevice.getDeviceBank() : cursorDevice.getParameterBank()));
}
use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class SLParameterMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.setRow(0, " Please select a device... ");
d.done(0).done(1);
return;
}
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(i);
d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 8) : "");
d.setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(8), 8));
}
d.done(0).done(1);
}
Aggregations