Search in sources :

Example 31 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method updateIndication.

protected void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActive(Views.TRACK);
    final boolean isDevice = viewManager.isActive(Views.DEVICE);
    final boolean isSession = viewManager.isActive(Views.SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    final ITrackBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    if (tbe != null)
        tbe.setIndication(isEffect && isSession);
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = tb.getItem(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        final ISendBank sendBank = track.getSendBank();
        for (int j = 0; j < 6; j++) sendBank.getItem(j).setIndication(!isEffect && hasTrackSel && isTrack);
        if (tbe != null) {
            final Optional<ITrack> selectedFXTrack = tbe.getSelectedItem();
            final boolean hasFXTrackSel = selectedFXTrack.isPresent() && selectedFXTrack.get().getIndex() == i;
            final ITrack fxTrack = tbe.getItem(i);
            fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
            fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        }
        parameterBank.getItem(i).setIndication(isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 32 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.register(Views.TRACK, new TrackView(surface, this.model));
    viewManager.register(Views.DEVICE, new DeviceView(surface, this.model));
    viewManager.register(Views.PLAY, new PlayView(surface, this.model));
    viewManager.register(Views.DRUM, new DrumView(surface, this.model));
    viewManager.register(Views.SEQUENCER, new SequencerView(surface, this.model));
    viewManager.register(Views.SESSION, new SessionView(surface, this.model));
    viewManager.register(Views.BROWSER, new BrowserView(surface, this.model));
    viewManager.register(Views.SHIFT, new ShiftView(surface, this.model));
}
Also used : SequencerView(de.mossgrabers.controller.arturia.beatstep.view.SequencerView) TrackView(de.mossgrabers.controller.arturia.beatstep.view.TrackView) ShiftView(de.mossgrabers.controller.arturia.beatstep.view.ShiftView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.arturia.beatstep.view.SessionView) DeviceView(de.mossgrabers.controller.arturia.beatstep.view.DeviceView) BrowserView(de.mossgrabers.controller.arturia.beatstep.view.BrowserView) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) DrumView(de.mossgrabers.controller.arturia.beatstep.view.DrumView) PlayView(de.mossgrabers.controller.arturia.beatstep.view.PlayView)

Example 33 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class BeatstepControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    for (int i = 0; i < 8; i++) {
        this.addRelativeKnob(ContinuousID.get(ContinuousID.KNOB1, i), "Knob " + (i + 1), new KnobRowViewCommand(i, this.model, surface), BindType.CC, 2, BeatstepControlSurface.BEATSTEP_KNOB_1 + i, RelativeEncoding.OFFSET_BINARY);
        this.addRelativeKnob(ContinuousID.get(ContinuousID.DEVICE_KNOB1, i), "Knob " + (i + 9), new KnobRowViewCommand(i + 8, this.model, surface), BindType.CC, 2, BeatstepControlSurface.BEATSTEP_KNOB_9 + i, RelativeEncoding.OFFSET_BINARY);
    }
    this.addRelativeKnob(ContinuousID.MASTER_KNOB, "Master", new PlayPositionCommand<>(this.model, surface), BindType.CC, 2, BeatstepControlSurface.BEATSTEP_KNOB_MAIN, RelativeEncoding.OFFSET_BINARY);
    final PlayView playView = (PlayView) viewManager.get(Views.PLAY);
    playView.registerAftertouchCommand(new AftertouchViewCommand<>(playView, this.model, surface));
}
Also used : KnobRowViewCommand(de.mossgrabers.controller.arturia.beatstep.command.continuous.KnobRowViewCommand) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) PlayView(de.mossgrabers.controller.arturia.beatstep.view.PlayView)

Example 34 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class BrowserCommand method discardBrowser.

/**
 * Stop browsing and restore the previous mode.
 *
 * @param commit True to commit otherwise cancel
 */
public void discardBrowser(final boolean commit) {
    this.model.getBrowser().stopBrowsing(commit);
    if (!commit)
        return;
    // Workaround for drum page scroll bug
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActive(Views.DRUM))
        AbstractDrumView.class.cast(viewManager.get(Views.DRUM)).repositionBankPage();
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 35 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class NoteViewSelectMode method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    int index = this.isButtonRow(0, buttonID);
    if (index >= 0) {
        final ViewManager viewManager = this.surface.getViewManager();
        if (VIEWS[index] == null)
            return AbstractFeatureGroup.BUTTON_COLOR_OFF;
        return viewManager.isActive(VIEWS[index]) ? AbstractMode.BUTTON_COLOR_HI : AbstractFeatureGroup.BUTTON_COLOR_ON;
    }
    index = this.isButtonRow(1, buttonID);
    if (index >= 0) {
        final ViewManager viewManager = this.surface.getViewManager();
        if (VIEWS_TOP[index] == null)
            return AbstractFeatureGroup.BUTTON_COLOR_OFF;
        return viewManager.isActive(VIEWS_TOP[index]) ? AbstractMode.BUTTON_COLOR_HI : AbstractFeatureGroup.BUTTON_COLOR_ON;
    }
    return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Aggregations

ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)58 ITrack (de.mossgrabers.framework.daw.data.ITrack)12 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)11 Views (de.mossgrabers.framework.view.Views)11 INoteMode (de.mossgrabers.framework.mode.INoteMode)5 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)4 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 IView (de.mossgrabers.framework.featuregroup.IView)4 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)3 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)3 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 IHost (de.mossgrabers.framework.daw.IHost)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)3 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 DrumView (de.mossgrabers.controller.novation.slmkiii.view.DrumView)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2