Search in sources :

Example 6 with ColorManager

use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.

the class SessionViewSelectMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ColorManager colorManager = this.model.getColorManager();
    final ViewManager viewManager = this.surface.getViewManager();
    for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(VIEWS[i] == null ? AbstractMode.BUTTON_COLOR_OFF : this.isSelected(viewManager, i) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 7 with ColorManager

use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.

the class FixedMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ColorManager colorManager = this.model.getColorManager();
    final Configuration configuration = this.surface.getConfiguration();
    for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(configuration.getNewClipLength() == i ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) AbstractConfiguration(de.mossgrabers.framework.configuration.AbstractConfiguration) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 8 with ColorManager

use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.

the class MidiModule method getNoteColor.

/**
 * Get the color for a note.
 *
 * @param note The note
 * @return The color
 */
private ColorEx getNoteColor(final int note) {
    final ColorManager colorManager = this.model.getColorManager();
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    if (!isKeyboardEnabled)
        return ColorEx.BLACK;
    if (this.keyManager.isKeyPressed(note))
        return this.model.hasRecordingState() ? ColorEx.RED : ColorEx.GREEN;
    final ITrack cursorTrack = this.model.getCursorTrack();
    final String colorID = AbstractView.replaceOctaveColorWithTrackColor(cursorTrack, this.keyManager.getColor(note));
    final int colorIndex = colorManager.getColorIndex(colorID);
    return colorManager.getColor(colorIndex, null);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 9 with ColorManager

use of de.mossgrabers.framework.controller.color.ColorManager 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 10 with ColorManager

use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.

the class PlayView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    final PadGrid padGrid = this.surface.getPadGrid();
    final ColorManager colorManager = this.model.getColorManager();
    for (int i = 36; i < 52; i++) padGrid.light(i, isKeyboardEnabled ? this.pressedKeys[i] > 0 ? BeatstepColors.BEATSTEP_BUTTON_STATE_PINK : colorManager.getColor(this.scales.getColor(this.noteMap, i)) : BeatstepColors.BEATSTEP_BUTTON_STATE_OFF);
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Aggregations

ColorManager (de.mossgrabers.framework.controller.color.ColorManager)21 ITrack (de.mossgrabers.framework.daw.data.ITrack)5 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)3 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)3 ViewManager (de.mossgrabers.framework.view.ViewManager)3 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 IScene (de.mossgrabers.framework.daw.data.IScene)2 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)2 OscAddressSpace (com.bitwig.extension.api.opensoundcontrol.OscAddressSpace)1 OscModule (com.bitwig.extension.api.opensoundcontrol.OscModule)1 ControllerHost (com.bitwig.extension.controller.api.ControllerHost)1 PushColorManager (de.mossgrabers.controller.ableton.push.controller.PushColorManager)1 LaunchkeyMk3ColorManager (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 SLMkIIIColorManager (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIColorManager)1 SettingsUI (de.mossgrabers.framework.bitwig.configuration.SettingsUI)1 AbstractConfiguration (de.mossgrabers.framework.configuration.AbstractConfiguration)1 Configuration (de.mossgrabers.framework.configuration.Configuration)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)1