use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class AbstractPlayView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
final boolean isRecording = this.model.hasRecordingState();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
final PadGrid gridPad = this.surface.getPadGrid();
for (int i = this.scales.getStartNote(); i < this.scales.getEndNote(); i++) gridPad.light(i, this.getGridColor(isKeyboardEnabled, isRecording, selectedTrack, i));
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class CursorCommand method scrollTracksRight.
protected void scrollTracksRight() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack sel = tb.getSelectedTrack();
final int index = sel == null ? 0 : sel.getIndex() + 1;
if (index == 8 || this.surface.isShiftPressed()) {
this.scrollTrackBankRight(sel, index);
return;
}
this.selectTrack(index);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class DuplicateCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
// Is there a selected track?
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getSelectedTrack();
if (track == null || !track.doesExist())
return;
// Is there a selected slot?
final ISlot slot = track.getSelectedSlot();
if (slot == null)
return;
final boolean isPlaying = slot.isPlaying();
// Duplicate the clip in the selected slot
slot.duplicate();
if (!isPlaying)
return;
// Need to wait a bit with starting the duplicated clip until it is selected
this.model.getHost().scheduleTask(() -> {
final ISlot slotNew = track.getSelectedSlot();
if (slotNew != null) {
slotNew.launch();
return;
}
// Try to find the clip in the next page...
track.scrollClipPageForwards();
this.model.getHost().scheduleTask(() -> {
final ISlot slotNew2 = track.getSelectedSlot();
if (slotNew2 != null)
slotNew2.launch();
}, 200);
}, 200);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class FootswitchCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
switch(this.getSetting()) {
case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_PLAY:
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_PLAY, event);
break;
case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_RECORD:
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_RECORD, event);
break;
case AbstractConfiguration.FOOTSWITCH_2_STOP_ALL_CLIPS:
if (event == ButtonEvent.DOWN)
this.model.getCurrentTrackBank().stop();
break;
case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_CLIP_OVERDUB:
if (event == ButtonEvent.DOWN)
this.model.getTransport().toggleLauncherOverdub();
break;
case AbstractConfiguration.FOOTSWITCH_2_UNDO:
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_UNDO, event);
break;
case AbstractConfiguration.FOOTSWITCH_2_TAP_TEMPO:
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_TAP_TEMPO, event);
break;
case AbstractConfiguration.FOOTSWITCH_2_NEW_BUTTON:
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_NEW, event);
break;
case AbstractConfiguration.FOOTSWITCH_2_CLIP_BASED_LOOPER:
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getSelectedTrack();
if (track == null) {
this.surface.getDisplay().notify("Please select an Instrument track first.", true, true);
return;
}
final ISlot selectedSlot = track.getSelectedSlot();
final ISlot slot = selectedSlot == null ? track.getSlot(0) : selectedSlot;
if (event == ButtonEvent.DOWN) {
if (slot.hasContent()) {
// If there is a clip in the selected slot, enable (not toggle)
// LauncherOverdub.
this.model.getTransport().setLauncherOverdub(true);
} else {
// If there is no clip in the selected slot, create a clip and begin record
// mode. Releasing it ends record mode.
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_NEW, event);
slot.select();
this.model.getTransport().setLauncherOverdub(true);
}
} else {
// Releasing it would turn off LauncherOverdub.
this.model.getTransport().setLauncherOverdub(false);
}
// Start transport if not already playing
slot.launch();
break;
case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_ARRANGE:
if (event == ButtonEvent.DOWN)
this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_ARRANGE);
break;
case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_MIX:
if (event == ButtonEvent.DOWN)
this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_MIX);
break;
case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_EDIT:
if (event == ButtonEvent.DOWN)
this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_EDIT);
break;
case AbstractConfiguration.FOOTSWITCH_2_ADD_INSTRUMENT_TRACK:
if (event == ButtonEvent.DOWN)
this.model.getApplication().addInstrumentTrack();
break;
case AbstractConfiguration.FOOTSWITCH_2_ADD_AUDIO_TRACK:
if (event == ButtonEvent.DOWN)
this.model.getApplication().addAudioTrack();
break;
case AbstractConfiguration.FOOTSWITCH_2_ADD_EFFECT_TRACK:
if (event == ButtonEvent.DOWN)
this.model.getApplication().addEffectTrack();
break;
case AbstractConfiguration.FOOTSWITCH_2_QUANTIZE:
if (event == ButtonEvent.DOWN)
this.model.getCursorClip().quantize(this.surface.getConfiguration().getQuantizeAmount() / 100.0);
break;
}
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class ToggleTrackBanksCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
this.model.toggleCurrentTrackBank();
final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
if (currentTrackBank.getSelectedTrack() == null)
currentTrackBank.getTrack(0).select();
}
Aggregations