Search in sources :

Example 6 with ICursorDevice

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);
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) ITransport(de.mossgrabers.framework.daw.ITransport) IArranger(de.mossgrabers.framework.daw.IArranger) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 7 with ICursorDevice

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);
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 8 with ICursorDevice

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;
}
Also used : IParameterPageBank(de.mossgrabers.framework.daw.data.bank.IParameterPageBank) IDevice(de.mossgrabers.framework.daw.data.IDevice) IDeviceBank(de.mossgrabers.framework.daw.data.bank.IDeviceBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 9 with ICursorDevice

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()));
}
Also used : IItem(de.mossgrabers.framework.daw.data.IItem) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 10 with ICursorDevice

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);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)67 IParameter (de.mossgrabers.framework.daw.data.IParameter)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)10 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)8 ILayer (de.mossgrabers.framework.daw.data.ILayer)8 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)8 ITrack (de.mossgrabers.framework.daw.data.ITrack)7 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)7 IBrowser (de.mossgrabers.framework.daw.IBrowser)5 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)5 Modes (de.mossgrabers.framework.mode.Modes)5 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDevice (de.mossgrabers.framework.daw.data.IDevice)3 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)3 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)3 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)2