Search in sources :

Example 11 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class VolumeCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer currentMode = modeManager.getActiveModeId();
    // Layer mode selection for Push 1
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
        modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER_VOLUME);
        return;
    }
    if (Modes.MODE_VOLUME.equals(currentMode))
        modeManager.setActiveMode(Modes.MODE_CROSSFADER);
    else
        modeManager.setActiveMode(Modes.MODE_VOLUME);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 12 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class PlayView method initMaxVelocity.

private void initMaxVelocity() {
    final int[] maxVelocity = new int[128];
    final PushConfiguration config = this.surface.getConfiguration();
    Arrays.fill(maxVelocity, config.getFixedAccentValue());
    maxVelocity[0] = 0;
    this.surface.setVelocityTranslationTable(config.isAccentActive() ? maxVelocity : this.defaultVelocity);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration)

Example 13 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class PitchbendCommand method updateValue.

/**
 * {@inheritDoc}
 */
@Override
public void updateValue() {
    final PushConfiguration config = this.surface.getConfiguration();
    switch(config.getRibbonMode()) {
        case PushConfiguration.RIBBON_MODE_CC:
            this.surface.setRibbonValue(this.pitchValue);
            break;
        case PushConfiguration.RIBBON_MODE_FADER:
            final ITrack t = this.model.getCurrentTrackBank().getSelectedTrack();
            this.surface.setRibbonValue(t == null ? 0 : this.model.getValueChanger().toMidiValue(t.getVolume()));
            break;
        default:
            this.surface.setRibbonValue(64);
            break;
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 14 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class RibbonMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final PushConfiguration config = this.surface.getConfiguration();
    final String ribbonModeCC = Integer.toString(config.getRibbonModeCCVal());
    final int ribbonMode = config.getRibbonMode();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    for (int i = 0; i < 7; i++) message.addOptionElement(i == 0 ? "CC Quick Select" : "", RibbonMode.CC_QUICK_SELECT[i], false, i == 0 ? "Function" : "", RibbonMode.FUNCTION[i], i < RibbonMode.FUNCTION_IDS.length && ribbonMode == RibbonMode.FUNCTION_IDS[i], false);
    message.addParameterElement("Midi CC", -1, ribbonModeCC, this.isKnobTouched[5], -1);
    display.send(message);
    return;
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) PushDisplay(de.mossgrabers.push.controller.PushDisplay) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 15 with PushConfiguration

use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.

the class RibbonMode method onValueKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnob(final int index, final int value) {
    if (index == 7) {
        final PushConfiguration config = this.surface.getConfiguration();
        config.setRibbonModeCC(this.model.getValueChanger().changeValue(value, config.getRibbonModeCCVal(), 1, 128));
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration)

Aggregations

PushConfiguration (de.mossgrabers.push.PushConfiguration)33 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)19 ITrack (de.mossgrabers.framework.daw.data.ITrack)14 PushDisplay (de.mossgrabers.push.controller.PushDisplay)8 IChannel (de.mossgrabers.framework.daw.data.IChannel)7 ModeManager (de.mossgrabers.framework.mode.ModeManager)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)5 ISend (de.mossgrabers.framework.daw.data.ISend)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 Display (de.mossgrabers.framework.controller.display.Display)4 ViewManager (de.mossgrabers.framework.view.ViewManager)1