Search in sources :

Example 31 with PushConfiguration

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

the class VolumeMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        d.setCell(0, i, t.doesExist() ? "Volume" : "").setCell(1, i, t.getVolumeStr(8));
        if (t.doesExist())
            d.setCell(2, i, config.isEnableVUMeters() ? t.getVu() : t.getVolume(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) Display(de.mossgrabers.framework.controller.display.Display)

Example 32 with PushConfiguration

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

the class TrackCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    if (this.surface.isShiftPressed()) {
        config.setVUMetersEnabled(!config.isEnableVUMeters());
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer currentMode = modeManager.getActiveModeId();
    if (currentMode != null) {
        if (config.isPush2()) {
            if (Modes.MODE_TRACK.equals(currentMode) || Modes.MODE_VOLUME.equals(currentMode) || Modes.MODE_CROSSFADER.equals(currentMode) || Modes.MODE_PAN.equals(currentMode)) {
                this.model.toggleCurrentTrackBank();
            } else if (currentMode.intValue() >= Modes.MODE_SEND1.intValue() && currentMode.intValue() <= Modes.MODE_SEND8.intValue()) {
                modeManager.setActiveMode(Modes.MODE_TRACK);
                this.model.toggleCurrentTrackBank();
            } else
                modeManager.setActiveMode(config.getCurrentMixMode());
        } else {
            // Layer mode selection for Push 1
            if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
                modeManager.setActiveMode(Modes.MODE_DEVICE_LAYER);
                return;
            }
            if (currentMode == Modes.MODE_TRACK)
                this.model.toggleCurrentTrackBank();
            else
                modeManager.setActiveMode(Modes.MODE_TRACK);
        }
    } else
        modeManager.setActiveMode(Modes.MODE_TRACK);
    config.setDebugMode(modeManager.getActiveModeId());
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null)
        tb.getTrack(0).select();
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 33 with PushConfiguration

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

the class AccentMode method onValueKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnob(final int index, final int value) {
    // Will never need fine increments on accent velocity since they are integers
    final IValueChanger valueChanger = this.model.getValueChanger();
    final PushConfiguration config = this.surface.getConfiguration();
    final int fixedAccentValue = config.getFixedAccentValue();
    config.setAccentValue(Math.max(1, valueChanger.changeValue(value, fixedAccentValue, 1, 128)));
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IValueChanger(de.mossgrabers.framework.controller.IValueChanger)

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