Search in sources :

Example 46 with ITrack

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

the class TrackDetailsMode method onFirstRowTrack.

private void onFirstRowTrack(final int index) {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack t = tb.getSelectedTrack();
    if (t == null)
        return;
    switch(index) {
        case 0:
            t.toggleIsActivated();
            break;
        case 1:
            t.toggleRecArm();
            break;
        case 2:
            t.toggleMute();
            break;
        case 3:
            t.toggleSolo();
            break;
        case 4:
            t.toggleMonitor();
            break;
        case 5:
            t.toggleAutoMonitor();
            break;
        case 6:
            this.model.toggleCursorTrackPinned();
            break;
        case 7:
            final ViewManager viewManager = this.surface.getViewManager();
            ((ColorView) viewManager.getView(Views.VIEW_COLOR)).setMode(ColorView.SelectMode.MODE_TRACK);
            viewManager.setActiveView(Views.VIEW_COLOR);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ColorView(de.mossgrabers.push.view.ColorView)

Example 47 with ITrack

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

the class PushControllerSetup method handleTrackChange.

/**
 * Handle a track selection change.
 *
 * @param index The index of the track
 * @param isSelected Has the track been selected?
 */
private void handleTrackChange(final int index, final boolean isSelected) {
    if (!isSelected)
        return;
    final PushControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final ModeManager modeManager = surface.getModeManager();
    // Recall last used view (if we are not in session mode)
    if (!viewManager.isActiveView(Views.VIEW_SESSION)) {
        final ITrack selectedTrack = this.model.getCurrentTrackBank().getSelectedTrack();
        if (selectedTrack != null) {
            final Integer preferredView = viewManager.getPreferredView(selectedTrack.getPosition());
            viewManager.setActiveView(preferredView == null ? this.configuration.getDefaultNoteView() : preferredView);
        }
    }
    if (modeManager.isActiveMode(Modes.MODE_MASTER))
        modeManager.setActiveMode(Modes.MODE_TRACK);
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.getActiveView().updateNoteMapping();
    // Reset drum octave because the drum pad bank is also reset
    this.scales.setDrumOctave(0);
    if (viewManager.isActiveView(Views.VIEW_DRUM))
        viewManager.getView(Views.VIEW_DRUM).updateNoteMapping();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.view.ViewManager) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 48 with ITrack

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

the class PushControllerSetup method updateIndication.

private void updateIndication(final Integer mode) {
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final PushControlSurface surface = this.getSurface();
    final boolean isSession = surface.getViewManager().isActiveView(Views.VIEW_SESSION);
    final boolean isEffect = this.model.isEffectTrackBankActive();
    final boolean isPan = Modes.MODE_PAN.equals(mode);
    final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
    tb.setIndication(!isEffect && isSession);
    if (tbe != null)
        tbe.setIndication(isEffect && isSession);
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final ITrack selectedTrack = tb.getSelectedTrack();
    for (int i = 0; i < tb.getNumTracks(); i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
        track.setPanIndication(!isEffect && (isPan || hasTrackSel));
        for (int j = 0; j < tb.getNumSends(); j++) track.getSend(j).setIndication(!isEffect && (mode.intValue() - Modes.MODE_SEND1.intValue() == j || hasTrackSel));
        if (tbe != null) {
            final ITrack fxTrack = tbe.getTrack(i);
            fxTrack.setVolumeIndication(isEffect);
            fxTrack.setPanIndication(isEffect && isPan);
        }
        cursorDevice.indicateParameter(i, true);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushControlSurface(de.mossgrabers.push.controller.PushControlSurface) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 49 with ITrack

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

the class PitchbendCommand method onPitchbend.

/**
 * {@inheritDoc}
 */
@Override
public void onPitchbend(final int channel, final int data1, final int data2) {
    // Don't get in the way of configuration
    if (this.surface.isShiftPressed())
        return;
    final PushConfiguration config = this.surface.getConfiguration();
    switch(config.getRibbonMode()) {
        case PushConfiguration.RIBBON_MODE_PITCH:
            this.surface.sendMidiEvent(0xE0, data1, data2);
            break;
        case PushConfiguration.RIBBON_MODE_CC:
            this.surface.sendMidiEvent(0xB0, config.getRibbonModeCCVal(), data2);
            this.pitchValue = data2;
            break;
        case PushConfiguration.RIBBON_MODE_CC_PB:
            if (data2 > 64)
                this.surface.sendMidiEvent(0xE0, data1, data2);
            else if (data2 < 64)
                this.surface.sendMidiEvent(0xB0, config.getRibbonModeCCVal(), 127 - data2 * 2);
            else {
                this.surface.sendMidiEvent(0xE0, data1, data2);
                this.surface.sendMidiEvent(0xB0, config.getRibbonModeCCVal(), 0);
            }
            break;
        case PushConfiguration.RIBBON_MODE_PB_CC:
            if (data2 > 64)
                this.surface.sendMidiEvent(0xB0, config.getRibbonModeCCVal(), (data2 - 64) * 2);
            else if (data2 < 64)
                this.surface.sendMidiEvent(0xE0, data1, data2);
            else {
                this.surface.sendMidiEvent(0xE0, data1, data2);
                this.surface.sendMidiEvent(0xB0, config.getRibbonModeCCVal(), 0);
            }
            break;
        case PushConfiguration.RIBBON_MODE_FADER:
            final IChannelBank tb = this.model.getCurrentTrackBank();
            final ITrack selTrack = tb.getSelectedTrack();
            if (selTrack != null)
                selTrack.setVolume(this.model.getValueChanger().toDAWValue(data2));
            return;
    }
    this.surface.getOutput().sendPitchbend(data1, data2);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 50 with ITrack

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

the class DeviceLayerMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasSelectedDevice()) {
        d.setBlock(1, 0, "           Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'...  ").allDone();
        return;
    }
    final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
    if (noLayers) {
        d.setBlock(1, 1, "    Please create").setBlock(1, 2, cd.hasDrumPads() ? "a Drum Pad..." : "a Device Layer...");
    } else {
        final IChannel l = cd.getSelectedLayerOrDrumPad();
        if (l != null) {
            d.setCell(0, 0, "Volume").setCell(1, 0, l.getVolumeStr(8)).setCell(2, 0, this.surface.getConfiguration().isEnableVUMeters() ? l.getVu() : l.getVolume(), Format.FORMAT_VALUE);
            d.setCell(0, 1, "Pan").setCell(1, 1, l.getPanStr(8)).setCell(2, 1, l.getPan(), Format.FORMAT_PAN);
            final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
            if (fxTrackBank == null) {
                for (int i = 0; i < 6; i++) {
                    final int pos = 2 + i;
                    final ISend send = l.getSend(i);
                    d.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
                }
            } else {
                final boolean isFX = this.model.isEffectTrackBankActive();
                for (int i = 0; i < 6; i++) {
                    final ITrack fxTrack = fxTrackBank.getTrack(i);
                    final boolean isEmpty = isFX || !fxTrack.doesExist();
                    final int pos = 2 + i;
                    if (isEmpty) {
                        d.clearCell(0, pos);
                        d.clearCell(2, pos);
                    } else {
                        final ISend send = l.getSend(i);
                        d.setCell(0, pos, fxTrack.getName()).setCell(1, pos, send.getDisplayedValue(8));
                        d.setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
                    }
                }
            }
        }
    }
    this.drawRow4(d, cd);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9