Search in sources :

Example 11 with Bean

use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method addInpointMenuItem.

@Bean
@Order(1940)
public SelectableMenuContribution addInpointMenuItem(AlertDialogFactory dialogFactory, TimelineState timelineState, MarkerRepository markerRepository) {
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("addInpoint", new KeyCodeCombination(KeyCode.I, KeyCodeCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN), "Add inpoint").getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, MARKER, "Add inpoint"), event -> {
        TimelinePosition position = timelineState.getPlaybackPosition();
        markerRepository.addMarker(position, new InpointMarker());
    }, combination);
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) InpointMarker(com.helospark.tactview.core.timeline.marker.markers.InpointMarker) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 12 with Bean

use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method addGeneralMarkerMenuItem.

@Bean
@Order(1942)
public SelectableMenuContribution addGeneralMarkerMenuItem(AlertDialogFactory dialogFactory, TimelineState timelineState, MarkerRepository markerRepository) {
    String name = "Add marker";
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey(name, new KeyCodeCombination(KeyCode.M, KeyCodeCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN), name).getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, MARKER, name), event -> {
        TimelinePosition position = timelineState.getPlaybackPosition();
        Optional<String> result = dialogFactory.showTextInputDialog("Add marker", "Label of marker", "Something interesting");
        if (result.isPresent()) {
            markerRepository.addMarker(position, new GeneralMarker(result.get()));
        }
    }, combination);
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) GeneralMarker(com.helospark.tactview.core.timeline.marker.markers.GeneralMarker) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 13 with Bean

use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method jumpToEndMenuItem.

@Bean
@Order(1905)
public SelectableMenuContribution jumpToEndMenuItem(UiTimelineManager uiTimelineManager, TimelineState timelineState, TimelineManagerAccessor timelineManagerAccessor) {
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("jumpToEnd", new KeyCodeCombination(KeyCode.END, KeyCombination.CONTROL_DOWN), "Jump to timeline end").getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, JUMP_ROOT, "Jump to timeline end"), event -> {
        TimelinePosition endPosition = timelineManagerAccessor.findEndPosition();
        uiTimelineManager.jumpAbsolute(endPosition.getSeconds());
    }, combination);
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 14 with Bean

use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method jumpToBeginningOfCurrentClipMenuItem.

@Bean
@Order(1906)
public SelectableMenuContribution jumpToBeginningOfCurrentClipMenuItem(UiTimelineManager uiTimelineManager, TimelineManagerAccessor timelineManager, SelectedNodeRepository selectedNodeRepository) {
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey("jumpToClipBeginning", new KeyCodeCombination(KeyCode.COMMA, KeyCombination.CONTROL_DOWN), "Jump to beginning of selected clip").getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, JUMP_ROOT, "Jump to beginning of selected clip"), event -> {
        Optional<String> primaryClip = selectedNodeRepository.getPrimarySelectedClip();
        if (primaryClip.isPresent()) {
            Optional<TimelineClip> clip = timelineManager.findClipById(primaryClip.get());
            uiTimelineManager.jumpAbsolute(clip.get().getInterval().getStartPosition().getSeconds());
        }
    }, combination);
}
Also used : DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) TimelineClip(com.helospark.tactview.core.timeline.TimelineClip) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Example 15 with Bean

use of com.helospark.lightdi.annotation.Bean in project tactview by helospark.

the class DefaultEditMenuItemConfiguration method addOutpointMenuItem.

@Bean
@Order(1941)
public SelectableMenuContribution addOutpointMenuItem(AlertDialogFactory dialogFactory, TimelineState timelineState, MarkerRepository markerRepository) {
    String name = "Add outpoint";
    KeyCodeCombination combination = hotKeyRepository.registerOrGetHotKey(name, new KeyCodeCombination(KeyCode.O, KeyCodeCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN), name).getCombination();
    return new DefaultMenuContribution(List.of(EDIT_ROOT, MARKER, name), event -> {
        TimelinePosition position = timelineState.getPlaybackPosition();
        markerRepository.addMarker(position, new OutpointMarker());
    }, combination);
}
Also used : OutpointMarker(com.helospark.tactview.core.timeline.marker.markers.OutpointMarker) DefaultMenuContribution(com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) Order(com.helospark.lightdi.annotation.Order) Bean(com.helospark.lightdi.annotation.Bean)

Aggregations

Bean (com.helospark.lightdi.annotation.Bean)43 Order (com.helospark.lightdi.annotation.Order)36 DefaultMenuContribution (com.helospark.tactview.ui.javafx.menu.DefaultMenuContribution)19 MenuItem (javafx.scene.control.MenuItem)17 KeyCodeCombination (javafx.scene.input.KeyCodeCombination)14 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)13 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)6 Configuration (com.helospark.lightdi.annotation.Configuration)5 ProjectRepository (com.helospark.tactview.core.repository.ProjectRepository)4 TimelineManagerAccessor (com.helospark.tactview.core.timeline.TimelineManagerAccessor)4 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)4 EffectFactory (com.helospark.tactview.core.timeline.effect.EffectFactory)4 UiCommandInterpreterService (com.helospark.tactview.ui.javafx.UiCommandInterpreterService)4 CopyPasteRepository (com.helospark.tactview.ui.javafx.repository.CopyPasteRepository)4 SelectedNodeRepository (com.helospark.tactview.ui.javafx.repository.SelectedNodeRepository)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Qualifier (com.helospark.lightdi.annotation.Qualifier)3 EffectFactoryChain (com.helospark.tactview.core.timeline.EffectFactoryChain)3 KeyframeSupportingDoubleInterpolator (com.helospark.tactview.core.timeline.effect.interpolation.interpolator.KeyframeSupportingDoubleInterpolator)3