use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class APCControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final APCControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
modeManager.registerMode(Modes.MODE_PAN, new PanMode(surface, this.model));
for (int i = 0; i < 8; i++) modeManager.registerMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + i), new SendMode(surface, this.model, i));
modeManager.registerMode(Modes.MODE_BROWSER, new BrowserMode(surface, this.model));
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class ShiftView method onScene.
/**
* {@inheritDoc}
*/
@Override
public void onScene(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
switch(index) {
case 5:
this.model.toggleCurrentTrackBank();
final boolean isEffectTrackBank = this.model.isEffectTrackBankActive();
if (isEffectTrackBank) {
// No Sends on effect tracks
final ModeManager modeManager = this.surface.getModeManager();
if (Modes.isSendMode(modeManager.getActiveModeId()))
modeManager.setActiveMode(Modes.MODE_VOLUME);
}
this.surface.getDisplay().notify(isEffectTrackBank ? "Effect Tracks" : "Instrument/Audio Tracks");
break;
case 6:
this.model.getCursorDevice().toggleWindowOpen();
break;
case 7:
this.model.getCurrentTrackBank().stop();
break;
default:
this.surface.setTrackState(index);
this.surface.getConfiguration().setSoftKeys(APCminiConfiguration.SOFT_KEYS_OPTIONS[index]);
this.surface.getDisplay().notify(APCminiConfiguration.SOFT_KEYS_OPTIONS[index]);
break;
}
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final APCminiControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
modeManager.registerMode(Modes.MODE_VOLUME, new VolumeMode(surface, this.model));
modeManager.registerMode(Modes.MODE_PAN, new PanMode(surface, this.model));
for (int i = 0; i < 8; i++) modeManager.registerMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + i), new SendMode(i, surface, this.model));
modeManager.registerMode(Modes.MODE_DEVICE, new DeviceMode(surface, this.model));
modeManager.setDefaultMode(Modes.MODE_VOLUME);
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method createObservers.
/**
* {@inheritDoc}
*/
@Override
protected void createObservers() {
final APCminiControlSurface surface = this.getSurface();
surface.getViewManager().addViewChangeListener((previousViewId, activeViewId) -> this.updateMode(null));
surface.getModeManager().addModeListener((previousModeId, activeModeId) -> this.updateMode(activeModeId));
this.createScaleObservers(this.configuration);
this.configuration.addSettingObserver(APCminiConfiguration.FADER_CTRL, () -> {
final ModeManager modeManager = surface.getModeManager();
switch(this.configuration.getFaderCtrl()) {
case "Volume":
modeManager.setActiveMode(Modes.MODE_VOLUME);
break;
case "Pan":
modeManager.setActiveMode(Modes.MODE_PAN);
break;
case "Send 1":
modeManager.setActiveMode(Modes.MODE_SEND1);
break;
case "Send 2":
modeManager.setActiveMode(Modes.MODE_SEND2);
break;
case "Send 3":
modeManager.setActiveMode(Modes.MODE_SEND3);
break;
case "Send 4":
modeManager.setActiveMode(Modes.MODE_SEND4);
break;
case "Send 5":
modeManager.setActiveMode(Modes.MODE_SEND5);
break;
case "Send 6":
modeManager.setActiveMode(Modes.MODE_SEND6);
break;
case "Send 7":
modeManager.setActiveMode(Modes.MODE_SEND7);
break;
case "Send 8":
modeManager.setActiveMode(Modes.MODE_SEND8);
break;
case "Device":
modeManager.setActiveMode(Modes.MODE_DEVICE);
break;
}
});
this.configuration.addSettingObserver(APCminiConfiguration.SOFT_KEYS, () -> {
for (int i = 0; i < APCminiConfiguration.SOFT_KEYS_OPTIONS.length; i++) {
final String opt = APCminiConfiguration.SOFT_KEYS_OPTIONS[i];
if (opt.equals(this.configuration.getSoftKeys()))
surface.setTrackState(i);
}
});
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class ModeMultiSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Integer activeModeId = modeManager.getActiveModeId();
int index = this.modeIds.indexOf(activeModeId) + 1;
if (index < 0 || index >= this.modeIds.size())
index = 0;
modeManager.setActiveMode(this.modeIds.get(index));
}
Aggregations