Search in sources :

Example 51 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class GrooveCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IParameter parameter = this.model.getGroove().getParameters()[0];
    parameter.setValue(parameter.getValue() == 0 ? this.model.getValueChanger().getUpperBound() - 1 : 0);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Example 52 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class DeviceParamsMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.clear().setBlock(1, 0, "           Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'...  ").allDone();
        return;
    }
    // Row 1 & 2
    for (int i = 0; i < 8; i++) {
        final IParameter param = cd.getFXParam(i);
        d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
    }
    // Row 3
    d.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
    // Row 4
    if (this.showDevices) {
        for (int i = 0; i < 8; i++) d.setCell(3, i, cd.doesSiblingExist(i) ? (i == cd.getPositionInBank() ? PushDisplay.RIGHT_ARROW : "") + cd.getSiblingDeviceName(i) : "");
    } else {
        final String[] pages = cd.getParameterPageNames();
        final int page = Math.min(Math.max(0, cd.getSelectedParameterPage()), pages.length - 1);
        final int start = page / 8 * 8;
        for (int i = 0; i < 8; i++) {
            final int index = start + i;
            d.setCell(3, i, index < pages.length ? (index == page ? PushDisplay.RIGHT_ARROW : "") + pages[index] : "");
        }
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 53 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class GrooveMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final IParameter[] parameters = this.model.getGroove().getParameters();
    final int quantizeAmount = this.surface.getConfiguration().getQuantizeAmount();
    d.clear().setCell(0, 0, "Quant Amnt").setCell(1, 0, quantizeAmount + "%").setCell(2, 0, quantizeAmount * 1023 / 100, Format.FORMAT_VALUE);
    for (int i = 0; i < parameters.length; i++) d.setCell(0, 2 + i, parameters[i].getName(8)).setCell(1, 2 + i, parameters[i].getDisplayedValue(8)).setCell(2, 2 + i, parameters[i].getValue(), Format.FORMAT_VALUE);
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 54 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class EqualizerDeviceImpl method setType.

/**
 * {@inheritDoc}
 */
@Override
public void setType(final int index, final EqualizerBandType typeID) {
    final IParameter param = this.types.get(index);
    final Integer v = EQ_TYPE_INDICES.get(typeID);
    ((ParameterImpl) param).getParameter().set(v == null ? Integer.valueOf(0) : v, Integer.valueOf(15));
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Example 55 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class ControlMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ACVSDisplay d = (ACVSDisplay) this.surface.getDisplay();
    final ACVSConfiguration configuration = this.surface.getConfiguration();
    final boolean isForce = configuration.isActiveACVSDevice(ACVSDevice.FORCE);
    final boolean isMPC = !isForce;
    final boolean isMPC_X = configuration.isActiveACVSDevice(ACVSDevice.MPC_X);
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ICursorDevice device = this.model.getCursorDevice();
    final int maxScene = calcMaxScene(this.model.getSceneBank());
    d.setScreenItem(ScreenItem.TRACK_NUMBER_OF_SCENES, maxScene);
    // Maximum number of sends
    d.setScreenItem(ScreenItem.TRACK_SENDS_NO, calcNumberOfSends(tb));
    for (int i = 0; i < 8; i++) {
        // Send track data
        final ITrack track = tb.getItem(i);
        sendTrackData(d, i, track);
        this.sendClipData(d, isMPC, i, track.getSlotBank());
    }
    this.sendSceneData(d, isMPC);
    // Set device data
    final boolean exists = device.doesExist();
    final Optional<String> selectedPage = device.getParameterPageBank().getSelectedItem();
    d.setRow(ACVSDisplay.ITEM_ID_DEVICE_BANK_NAME, exists ? selectedPage.orElse("") : "");
    d.setRow(ACVSDisplay.ITEM_ID_DEVICE_NAME, exists ? device.getName() : "");
    d.setScreenItem(ScreenItem.DEVICE_COUNT, device.doesExist() ? device.getDeviceBank().getItemCount() : 0);
    final int devicePosition = device.getPosition();
    d.setScreenItem(ScreenItem.CURRENT_DEVICE_INDEX, devicePosition >= 0 ? devicePosition : 0);
    d.setScreenItem(ScreenItem.CURRENT_DEVICE_ACTIVE, device.isEnabled() ? 127 : 0);
    final IParameterBank parameterBank = device.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(i);
        d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_NAME_FIRST + i, param.getName());
        d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_VALUE_FIRST + i, param.getDisplayedValue());
        d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_ENABLED, i), param.doesExist() ? 127 : 0);
        d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_VALUE, i), param.getValue());
        if (isForce || isMPC_X) {
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, 8 + i), param.doesExist() ? 1 : 0);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, 8 + i), param.getValue());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + 8 + i, param.getName());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + 8 + i, param.getDisplayedValue());
            final ITrack track = tb.getItem(i);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, i), track.doesExist() ? 1 : 0);
            d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, i), track.getVolume());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + i, track.getName());
            d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + i, track.getVolumeStr());
        }
    }
    // Set transport data
    final ITransport transport = this.model.getTransport();
    d.setRow(ACVSDisplay.ITEM_ID_TEMPO, transport.getTempoParameter().getDisplayedValue());
    d.setRow(ACVSDisplay.ITEM_ID_ARRANGEMENT_POSITION, transport.getBeatText().split(":")[0].replace('.', ':'));
    d.setRow(ACVSDisplay.ITEM_ID_LOOP_START, transport.getLoopStartBeatText().split(":")[0].replace('.', ':'));
    d.setRow(ACVSDisplay.ITEM_ID_LOOP_LENGTH, transport.getLoopLengthBeatText().split(":")[0].replace('.', ':'));
    this.sendAdditionalMPCParameters(d);
    if (!isMPC)
        this.sendAdditionalForceParameters(d);
    d.allDone();
    if (this.currentMaxScene != maxScene) {
        this.currentMaxScene = maxScene;
        this.surface.forceFlush();
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITrack(de.mossgrabers.framework.daw.data.ITrack) ACVSDisplay(de.mossgrabers.controller.akai.acvs.controller.ACVSDisplay) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITransport(de.mossgrabers.framework.daw.ITransport) ACVSConfiguration(de.mossgrabers.controller.akai.acvs.ACVSConfiguration) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

IParameter (de.mossgrabers.framework.daw.data.IParameter)76 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)6 IGroove (de.mossgrabers.framework.daw.IGroove)5 Display (de.mossgrabers.framework.controller.display.Display)4 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)4 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)4 PushDisplay (de.mossgrabers.push.controller.PushDisplay)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)2 FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2