use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method cutSelectedUntilCurrent.
@Bean
@Order(1911)
public SelectableMenuContribution cutSelectedUntilCurrent(AlertDialogFactory dialogFactory, TimelineState timelineState, UiCutHandler uiCutHandler) {
String title = "Set selected startpoint";
KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("cutSelectedUntilCursor", new KeyCodeCombination(KeyCode.I, KeyCodeCombination.CONTROL_DOWN), title).getCombination();
return new DefaultMenuContribution(List.of(EDIT_ROOT, CUT_MENU_ITEM, title), event -> {
uiCutHandler.cutSelectedUntilCursor(true);
}, combination);
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class StandardEffectContextMenuChainItemConfiguration method moveUpItem.
@Bean
@Order(90)
public EffectContextMenuChainItem moveUpItem(UiCommandInterpreterService commandInterpreter, TimelineManagerAccessor timelineManager) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem moveUpClip = new MenuItem("Move up");
int index = timelineManager.findEffectChannel(request.getEffect().getId());
System.out.println("Up index: " + index);
if (index <= 0) {
moveUpClip.setDisable(true);
} else {
moveUpClip.setOnAction(e -> commandInterpreter.sendWithResult(new MoveEffectToChannelCommand(timelineManager, request.getEffect().getId(), index - 1)));
}
return moveUpClip;
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class StandardEffectContextMenuChainItemConfiguration method deleteMenuItem.
@Bean
@Order(110)
public EffectContextMenuChainItem deleteMenuItem(RemoveEffectService removeEffectService) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem deleteClipMenuItem = new MenuItem("Delete");
deleteClipMenuItem.setOnAction(e -> removeEffectService.removeEffect(request.getEffect().getId()));
return deleteClipMenuItem;
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method exportAsYoutubeChapterMenuItem.
@Bean
@Order(1952)
public SelectableMenuContribution exportAsYoutubeChapterMenuItem(MarkerRepository chapterRepository, AlertDialogFactory alertDialogFactory) {
return new DefaultMenuContribution(List.of(EDIT_ROOT, CHAPTER_ROOT, "Show as Youtube chapter"), event -> {
String result = "";
String errors = "";
int numberOfChapters = 0;
TimelinePosition previousPosition = null;
if (chapterRepository.getMarkers().get(TimelinePosition.ofZero()) == null) {
result += "00:00 Intro\n";
errors += "[WARN] No chapter is defined in position 00:00, added intro chapter at 0\n";
previousPosition = TimelinePosition.ofZero();
++numberOfChapters;
}
for (var chapter : chapterRepository.getMarkers().entrySet()) {
long allSeconds = chapter.getKey().getSeconds().longValue();
long minutes = allSeconds / 60;
long seconds = allSeconds % 60;
result += (String.format("%02d:%02d %s\n", minutes, seconds, chapter.getValue()));
++numberOfChapters;
if (previousPosition != null && chapter.getKey().subtract(previousPosition).isLessThan(10)) {
errors += "[ERROR] Chapter at " + minutes + ":" + seconds + " is less than 10s from previous chapter which is unaccaptable by YouTube\n";
}
previousPosition = chapter.getKey();
}
if (numberOfChapters < 3) {
errors += "[ERROR] Minimum 3 chapters needed by YouTube";
}
alertDialogFactory.showTextDialog("Youtube chapters", "Copy the below in your description to add chapters to Youtube", errors, result);
});
}
use of com.helospark.lightdi.annotation.Order in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method jumpToEndOfCurrentClipMenuItem.
@Bean
@Order(1907)
public SelectableMenuContribution jumpToEndOfCurrentClipMenuItem(UiTimelineManager uiTimelineManager, TimelineManagerAccessor timelineManager, SelectedNodeRepository selectedNodeRepository) {
KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("jumpToClipEnd", new KeyCodeCombination(KeyCode.PERIOD, KeyCombination.CONTROL_DOWN), "Jump to end of selected clip").getCombination();
return new DefaultMenuContribution(List.of(EDIT_ROOT, JUMP_ROOT, "Jump to end of selected clip"), event -> {
Optional<String> primaryClip = selectedNodeRepository.getPrimarySelectedClip();
if (primaryClip.isPresent()) {
Optional<TimelineClip> clip = timelineManager.findClipById(primaryClip.get());
uiTimelineManager.jumpAbsolute(clip.get().getInterval().getEndPosition().getSeconds());
}
}, combination);
}
Aggregations