Search in sources :

Example 21 with PushConfiguration

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

the class DeviceLayerMode method updateMenu.

protected void updateMenu() {
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 3; i++) this.menu[4 + i] = fxTrackBank.getTrack(sendOffset + i).getName();
    this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 22 with PushConfiguration

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

the class DeviceLayerModeVolume method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ICursorDevice cd = this.model.getCursorDevice();
    // Drum Pad Bank has size of 16, layers only 8
    final int offset = getDrumPadIndex(cd);
    final PushConfiguration config = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) {
        final IChannel layer = cd.getLayerOrDrumPad(offset + i);
        d.setCell(0, i, layer.doesExist() ? "Volume" : "").setCell(1, i, layer.getVolumeStr(8));
        if (layer.doesExist())
            d.setCell(2, i, config.isEnableVUMeters() ? layer.getVu() : layer.getVolume(), Format.FORMAT_VALUE);
        else
            d.clearCell(2, i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4(d, cd);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 23 with PushConfiguration

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

the class AbstractTrackMode method updateTrackMenu.

protected void updateTrackMenu() {
    final PushConfiguration config = this.surface.getConfiguration();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    if (this.model.isEffectTrackBankActive()) {
        // No sends for FX tracks
        for (int i = 3; i < 7; i++) this.menu[i] = " ";
        return;
    }
    this.menu[2] = config.isDisplayCrossfader() ? "Crossfader" : " ";
    final IChannelBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 3; i++) {
        this.menu[4 + i] = tb.getEditSendName(sendOffset + i);
        if (this.menu[4 + i].isEmpty())
            this.menu[4 + i] = " ";
    }
    this.menu[3] = config.isSendsAreToggled() ? "Sends 5-8" : "Sends 1-4";
    this.menu[7] = tb instanceof ITrackBank && ((ITrackBank) tb).hasParent() ? "Up" : " ";
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 24 with PushConfiguration

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

the class AbstractTrackMode method updateChannelDisplay.

// Push 2
// Called from sub-classes
protected void updateChannelDisplay(final int selectedMenu, final boolean isVolume, final boolean isPan) {
    this.updateTrackMenu();
    final PushConfiguration config = this.surface.getConfiguration();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    final IValueChanger valueChanger = this.model.getValueChanger();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final boolean displayCrossfader = config.isDisplayCrossfader();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        // The menu item
        String topMenu;
        boolean isTopMenuOn;
        if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP) && this.model.getHost().hasClips()) {
            topMenu = t.doesExist() ? "Stop Clip" : "";
            isTopMenuOn = t.isPlaying();
        } else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
            topMenu = t.doesExist() ? "Mute" : "";
            isTopMenuOn = t.isMute();
        } else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
            topMenu = t.doesExist() ? "Solo" : "";
            isTopMenuOn = t.isSolo();
        } else {
            topMenu = this.menu[i];
            isTopMenuOn = i == selectedMenu - 1 || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
        }
        final int crossfadeMode = displayCrossfader ? t.getCrossfadeModeAsNumber() : -1;
        message.addChannelElement(selectedMenu, topMenu, isTopMenuOn, t.doesExist() ? t.getName(12) : "", t.getType(), t.getColor(), t.isSelected(), valueChanger.toDisplayValue(t.getVolume()), valueChanger.toDisplayValue(t.getModulatedVolume()), isVolume && this.isKnobTouched[i] ? t.getVolumeStr(8) : "", valueChanger.toDisplayValue(t.getPan()), valueChanger.toDisplayValue(t.getModulatedPan()), isPan && this.isKnobTouched[i] ? t.getPanStr() : "", valueChanger.toDisplayValue(config.isEnableVUMeters() ? t.getVu() : 0), t.isMute(), t.isSolo(), t.isRecArm(), crossfadeMode);
    }
    display.send(message);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IValueChanger(de.mossgrabers.framework.controller.IValueChanger) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) PushDisplay(de.mossgrabers.push.controller.PushDisplay) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 25 with PushConfiguration

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

the class AbstractTrackMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getTrack(index);
    if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
        track.stop();
        return;
    }
    final PushConfiguration config = this.surface.getConfiguration();
    if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
        if (config.isMuteState())
            track.toggleMute();
        else
            track.toggleSolo();
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    switch(index) {
        case 0:
            if (modeManager.isActiveMode(Modes.MODE_VOLUME))
                modeManager.setActiveMode(Modes.MODE_TRACK);
            else
                modeManager.setActiveMode(Modes.MODE_VOLUME);
            break;
        case 1:
            if (modeManager.isActiveMode(Modes.MODE_PAN))
                modeManager.setActiveMode(Modes.MODE_TRACK);
            else
                modeManager.setActiveMode(Modes.MODE_PAN);
            break;
        case 2:
            if (config.isDisplayCrossfader()) {
                if (modeManager.isActiveMode(Modes.MODE_CROSSFADER))
                    modeManager.setActiveMode(Modes.MODE_TRACK);
                else
                    modeManager.setActiveMode(Modes.MODE_CROSSFADER);
            }
            break;
        case 3:
            if (!this.model.isEffectTrackBankActive()) {
                config.setSendsAreToggled(!config.isSendsAreToggled());
                if (!modeManager.isActiveMode(Modes.MODE_TRACK))
                    modeManager.setActiveMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + (config.isSendsAreToggled() ? 4 : 0)));
            }
            break;
        case 7:
            if (!this.model.isEffectTrackBankActive())
                this.model.getTrackBank().selectParent();
            break;
        default:
            final int sendIndex = index - (config.isSendsAreToggled() ? 0 : 4);
            if (tb.canEditSend(sendIndex)) {
                final Integer si = Integer.valueOf(Modes.MODE_SEND1.intValue() + sendIndex);
                modeManager.setActiveMode(modeManager.isActiveMode(si) ? Modes.MODE_TRACK : si);
            }
            break;
    }
    config.setDebugMode(modeManager.getActiveModeId());
}
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)

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