Search in sources :

Example 21 with View

use of de.mossgrabers.framework.view.View in project DrivenByMoss by git-moss.

the class AbstractControlSurface method handleMidi.

/**
 * Handle received midi data.
 *
 * @param status The midi status byte
 * @param data1 The midi data byte 1
 * @param data2 The midi data byte 2
 */
protected void handleMidi(final int status, final int data1, final int data2) {
    final int code = status & 0xF0;
    final int channel = status & 0xF;
    View view;
    switch(code) {
        // Note on/off
        case 0x80:
        case 0x90:
            if (this.isGridNote(data1))
                this.handleGridNote(data1, code == 0x80 ? 0 : data2);
            else
                this.handleNoteEvent(data1, code == 0x80 ? 0 : data2);
            break;
        // Polyphonic Aftertouch
        case 0xA0:
            view = this.viewManager.getActiveView();
            if (view != null)
                view.executeAftertouchCommand(data1, data2);
            break;
        // CC
        case 0xB0:
            this.handleCC(channel, data1, data2);
            break;
        // Channel Aftertouch
        case 0xD0:
            view = this.viewManager.getActiveView();
            if (view != null)
                view.executeAftertouchCommand(-1, data1);
            break;
        // Pitch Bend
        case 0xE0:
            view = this.viewManager.getActiveView();
            if (view != null)
                view.executePitchbendCommand(channel, data1, data2);
            break;
        default:
            this.host.println("Unhandled midi status: " + status);
            break;
    }
}
Also used : View(de.mossgrabers.framework.view.View)

Example 22 with View

use of de.mossgrabers.framework.view.View in project DrivenByMoss by git-moss.

the class AbstractControlSurface method redrawGrid.

/**
 * Redraws the grid for the active view.
 */
protected void redrawGrid() {
    final View view = this.viewManager.getActiveView();
    if (view == null)
        return;
    view.drawGrid();
    if (this.pads != null)
        this.pads.flush();
}
Also used : View(de.mossgrabers.framework.view.View)

Example 23 with View

use of de.mossgrabers.framework.view.View in project DrivenByMoss by git-moss.

the class AbstractControlSurface method handleNoteEvent.

/**
 * Handle note events.
 *
 * @param note The midi note
 * @param velocity The velocity
 */
protected void handleNoteEvent(final int note, final int velocity) {
    this.noteVelocities[note] = velocity;
    final View view = this.viewManager.getActiveView();
    if (view == null)
        return;
    final Integer commandID = this.getNoteCommand(note);
    if (commandID != null) {
        view.executeNoteCommand(commandID, velocity);
        return;
    }
    this.println("Unsupported Midi Note: " + note);
}
Also used : View(de.mossgrabers.framework.view.View)

Example 24 with View

use of de.mossgrabers.framework.view.View in project DrivenByMoss by git-moss.

the class NoteViewSelectMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ViewManager viewManager = this.surface.getViewManager();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    for (int i = 0; i < VIEWS.length; i++) {
        String menuBottomName = "";
        if (VIEWS[i] != null) {
            final View view = viewManager.getView(VIEWS[i]);
            if (view != null)
                menuBottomName = view.getName();
        }
        final String menuTopName = VIEWS_TOP[i] == null ? "" : viewManager.getView(VIEWS_TOP[i]).getName();
        final boolean isMenuBottomSelected = VIEWS[i] != null && viewManager.isActiveView(VIEWS[i]);
        final boolean isMenuTopSelected = VIEWS_TOP[i] != null && viewManager.isActiveView(VIEWS_TOP[i]);
        message.addOptionElement("", menuTopName, isMenuTopSelected, i == 0 ? "Note view" : "", menuBottomName, isMenuBottomSelected, false);
    }
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) ViewManager(de.mossgrabers.framework.view.ViewManager) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage) View(de.mossgrabers.framework.view.View)

Aggregations

View (de.mossgrabers.framework.view.View)24 ViewManager (de.mossgrabers.framework.view.ViewManager)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)8 SceneView (de.mossgrabers.framework.view.SceneView)8 ITrack (de.mossgrabers.framework.daw.data.ITrack)6 ModeManager (de.mossgrabers.framework.mode.ModeManager)6 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)5 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 DrumView (de.mossgrabers.launchpad.view.DrumView)4 PlayView (de.mossgrabers.launchpad.view.PlayView)4 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)4 SequencerView (de.mossgrabers.launchpad.view.SequencerView)4 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)3 ClipView (de.mossgrabers.push.view.ClipView)3 ColorView (de.mossgrabers.push.view.ColorView)3 DrumView (de.mossgrabers.push.view.DrumView)3 PianoView (de.mossgrabers.push.view.PianoView)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 DrumView (de.mossgrabers.apc.view.DrumView)2