Search in sources :

Example 16 with IParameter

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

the class FireUserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final IParameterBank userBank = this.model.getUserParameterBank();
    final int page = userBank.getScrollPosition() / userBank.getPageSize();
    final String desc = "User Page: " + (page + 1);
    String paramLine = "";
    int value = -1;
    final int touchedKnob = this.getTouchedKnob();
    if (touchedKnob > -1) {
        final IParameter p = userBank.getItem(touchedKnob);
        paramLine = p.getName(5);
        if (paramLine.isEmpty())
            paramLine = "Not mapped";
        else {
            value = p.getValue();
            paramLine += ": " + p.getDisplayedValue(6);
        }
    }
    display.addElement(new TitleValueComponent(desc, paramLine, value, false));
    display.send();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) TitleValueComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)

Example 17 with IParameter

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

the class TransportHandler method handleMetronomeVolume.

private void handleMetronomeVolume(final KnobMode knobMode, final MidiValue value) {
    final ITransport transport = this.model.getTransport();
    final IParameter metronomeVolumeParameter = transport.getMetronomeVolumeParameter();
    final int val = value.getValue();
    if (isAbsolute(knobMode))
        metronomeVolumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        metronomeVolumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 18 with IParameter

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

the class UserView method onDeactivate.

/**
 * {@inheritDoc}
 */
@Override
public void onDeactivate() {
    for (int i = 0; i < 8; i++) {
        final ContinuousID faderID = ContinuousID.get(ContinuousID.FADER1, i);
        final IHwContinuousControl continuous = this.surface.getContinuous(faderID);
        if (continuous != null)
            continuous.bind((IParameter) null);
    }
    this.surface.rebindGrid();
    super.onDeactivate();
}
Also used : ContinuousID(de.mossgrabers.framework.controller.ContinuousID) IParameter(de.mossgrabers.framework.daw.data.IParameter) IHwContinuousControl(de.mossgrabers.framework.controller.hardware.IHwContinuousControl)

Example 19 with IParameter

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

the class LaunchpadShuffleView method onGridNote.

/**
 * {@inheritDoc}}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity != 0)
        return;
    // Toggle shuffle on/off
    if (note == 36) {
        final IGroove groove = this.model.getGroove();
        final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
        if (enabledParameter != null) {
            enabledParameter.setNormalizedValue(enabledParameter.getValue() == 0 ? 1 : 0);
            return;
        }
    }
    // Shuffle rate
    if (note == 38 || note == 39) {
        final IGroove groove = this.model.getGroove();
        final IParameter rateParameter = groove.getParameter(GrooveParameterID.SHUFFLE_RATE);
        if (rateParameter != null) {
            rateParameter.setNormalizedValue(rateParameter.getValue() == 0 ? 1 : 0);
            return;
        }
    }
    this.surface.getViewManager().restore();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGroove(de.mossgrabers.framework.daw.IGroove)

Example 20 with IParameter

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

the class LaunchpadShuffleView method fillBottom.

/**
 * {@index}
 */
@Override
protected void fillBottom() {
    super.fillBottom();
    final IGroove groove = this.model.getGroove();
    final IParameter enabledParameter = groove.getParameter(GrooveParameterID.ENABLED);
    if (enabledParameter == null || !enabledParameter.doesExist())
        return;
    this.padGrid.lightEx(0, 7, enabledParameter.getValue() == 0 ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN_HI);
    final IParameter rateParameter = groove.getParameter(GrooveParameterID.SHUFFLE_RATE);
    if (rateParameter == null || !rateParameter.doesExist())
        return;
    final boolean isEight = rateParameter.getValue() == 0;
    this.padGrid.lightEx(2, 7, isEight ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI);
    this.padGrid.lightEx(3, 7, !isEight ? LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI : LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_HI);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IGroove(de.mossgrabers.framework.daw.IGroove)

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