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);
}
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);
}
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;
}
}
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;
}
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));
}
}
Aggregations