use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class Drum64View method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
return;
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (this.surface.isPressed(ButtonID.REPEAT)) {
NoteRepeatSceneHelper.handleNoteRepeatSelection(this.surface, 7 - index);
return;
}
final IScene scene = this.model.getCurrentTrackBank().getSceneBank().getItem(index);
if (this.isButtonCombination(ButtonID.DELETE)) {
scene.remove();
return;
}
if (this.isButtonCombination(ButtonID.DUPLICATE)) {
scene.duplicate();
return;
}
scene.select();
scene.launch();
}
use of de.mossgrabers.framework.daw.data.IScene 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;
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SceneModule method flush.
/**
* {@inheritDoc}
*/
@Override
public void flush(final boolean dump) {
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < sceneBank.getPageSize(); i++) {
final IScene scene = sceneBank.getItem(i);
final String sceneAddress = "/scene/" + (i + 1) + "/";
this.writer.sendOSC(sceneAddress + TAG_EXISTS, scene.doesExist(), dump);
this.writer.sendOSC(sceneAddress + TAG_NAME, scene.getName(), dump);
this.writer.sendOSC(sceneAddress + TAG_SELECTED, scene.isSelected(), dump);
}
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 8; i++) {
final IScene scene = sceneBank.getItem(i);
final String name = StringUtils.fixASCII(scene.getName());
d.setCell(1, i, name.isEmpty() ? "Scene " + (i + 1) : name);
}
d.done(0).done(1);
}
use of de.mossgrabers.framework.daw.data.IScene in project DrivenByMoss by git-moss.
the class SceneHandler method handle.
/**
* {@inheritDoc}
*/
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
final boolean isButtonPressed = this.isButtonPressed(knobMode, value);
switch(command) {
// Scene 1-8: Launch Scene
case SCENE_1_LAUNCH_SCENE:
case SCENE_2_LAUNCH_SCENE:
case SCENE_3_LAUNCH_SCENE:
case SCENE_4_LAUNCH_SCENE:
case SCENE_5_LAUNCH_SCENE:
case SCENE_6_LAUNCH_SCENE:
case SCENE_7_LAUNCH_SCENE:
case SCENE_8_LAUNCH_SCENE:
if (isButtonPressed) {
final IScene scene = this.model.getSceneBank().getItem(command.ordinal() - FlexiCommand.SCENE_1_LAUNCH_SCENE.ordinal());
scene.select();
scene.launch();
}
break;
// Scene: Select Previous Bank
case SCENE_SELECT_PREVIOUS_BANK:
if (isButtonPressed)
this.model.getSceneBank().selectPreviousPage();
break;
// Scene: Select Next Bank
case SCENE_SELECT_NEXT_BANK:
if (isButtonPressed)
this.model.getSceneBank().selectNextPage();
break;
// Scene: Create Scene
case SCENE_CREATE_SCENE:
if (isButtonPressed)
this.model.getProject().createScene();
break;
// Scene: Create Scene from playing Clips
case SCENE_CREATE_SCENE_FROM_PLAYING_CLIPS:
if (isButtonPressed)
this.model.getProject().createSceneFromPlayingLauncherClips();
break;
default:
throw new FlexiHandlerException(command);
}
}
Aggregations