Search in sources :

Example 6 with ISceneBank

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

the class MixerMode method getKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public int getKnobValue(final int index) {
    // Note: Since we need multiple value (more than 8), index is the MIDI CC of the knob
    final IValueChanger valueChanger = this.model.getValueChanger();
    if (index >= KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME && index < KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME + 8) {
        final ITrack track = this.bank.getItem(index - KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME);
        return valueChanger.toMidiValue(track.getVolume());
    }
    if (index >= KontrolProtocolControlSurface.KONTROL_TRACK_PAN && index < KontrolProtocolControlSurface.KONTROL_TRACK_PAN + 8) {
        final ITrack track = this.bank.getItem(index - KontrolProtocolControlSurface.KONTROL_TRACK_PAN);
        return valueChanger.toMidiValue(track.getPan());
    }
    final Optional<ITrack> selectedTrack = this.bank.getSelectedItem();
    final int scrollTracksState = (this.bank.canScrollBackwards() ? 1 : 0) + (this.bank.canScrollForwards() ? 2 : 0);
    int scrollClipsState = 0;
    if (selectedTrack.isPresent()) {
        final ISlotBank slotBank = selectedTrack.get().getSlotBank();
        scrollClipsState = (slotBank.canScrollBackwards() ? 1 : 0) + (slotBank.canScrollForwards() ? 2 : 0);
    }
    final ISceneBank sceneBank = this.model.getSceneBank();
    final int scrollScenesState = (sceneBank.canScrollBackwards() ? 1 : 0) + (sceneBank.canScrollForwards() ? 2 : 0);
    final KontrolProtocolConfiguration configuration = this.surface.getConfiguration();
    switch(index) {
        case KontrolProtocolControlSurface.KONTROL_NAVIGATE_BANKS:
            return (this.bank.canScrollPageBackwards() ? 1 : 0) + (this.bank.canScrollPageForwards() ? 2 : 0);
        case KontrolProtocolControlSurface.KONTROL_NAVIGATE_TRACKS:
            if (configuration.isFlipTrackClipNavigation())
                return configuration.isFlipClipSceneNavigation() ? scrollScenesState : scrollClipsState;
            return scrollTracksState;
        case KontrolProtocolControlSurface.KONTROL_NAVIGATE_CLIPS:
            if (configuration.isFlipTrackClipNavigation())
                return scrollTracksState;
            return configuration.isFlipClipSceneNavigation() ? scrollScenesState : scrollClipsState;
        default:
            return 0;
    }
}
Also used : ISlotBank(de.mossgrabers.framework.daw.data.bank.ISlotBank) ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) ITrack(de.mossgrabers.framework.daw.data.ITrack) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) KontrolProtocolConfiguration(de.mossgrabers.controller.ni.kontrol.mkii.KontrolProtocolConfiguration)

Example 7 with ISceneBank

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

the class SessionView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final ColorManager colorManager = this.model.getColorManager();
    final int colorScene = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE);
    final int colorSceneSelected = colorManager.getColorIndex(AbstractSessionView.COLOR_SELECTED_SCENE);
    final int colorSceneOff = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE_OFF);
    final ISceneBank sceneBank = this.model.getSceneBank();
    IScene s = sceneBank.getItem(0);
    if (buttonID == ButtonID.SCENE1) {
        if (!s.doesExist())
            return colorSceneOff;
        return s.isSelected() ? colorSceneSelected : colorScene;
    }
    if (this.padMode == null) {
        s = sceneBank.getItem(1);
        if (!s.doesExist())
            return colorSceneOff;
        return s.isSelected() ? colorSceneSelected : colorScene;
    }
    switch(this.padMode) {
        case REC_ARM:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI;
        case TRACK_SELECT:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_WHITE;
        case MUTE:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI;
        case SOLO:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI;
        case STOP_CLIP:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_ROSE;
        default:
            return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) LaunchkeyMiniMk3ColorManager(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 8 with ISceneBank

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

the class ChordsView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    if (!ButtonID.isSceneButton(buttonID))
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    if (this.surface.isPressed(ButtonID.REPEAT))
        return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
    final ISceneBank sceneBank = this.model.getSceneBank();
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final IScene s = sceneBank.getItem(scene);
    if (s.doesExist())
        return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 9 with ISceneBank

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

the class PlayView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    if (!ButtonID.isSceneButton(buttonID))
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    if (this.surface.isPressed(ButtonID.REPEAT))
        return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
    final ISceneBank sceneBank = this.model.getSceneBank();
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final IScene s = sceneBank.getItem(scene);
    if (s.doesExist())
        return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 10 with ISceneBank

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

the class SessionView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (scene < 0 || scene >= 8)
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    final ISceneBank sceneBank = this.model.getSceneBank();
    final IScene s = sceneBank.getItem(scene);
    if (s.doesExist())
        return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Aggregations

ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)28 IScene (de.mossgrabers.framework.daw.data.IScene)20 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)5 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 KontrolProtocolConfiguration (de.mossgrabers.controller.ni.kontrol.mkii.KontrolProtocolConfiguration)1 LaunchkeyMk3ColorManager (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)1 ISlotBank (de.mossgrabers.framework.daw.data.bank.ISlotBank)1 IMode (de.mossgrabers.framework.featuregroup.IMode)1 Modes (de.mossgrabers.framework.mode.Modes)1