Search in sources :

Example 1 with AddClipRequest

use of com.helospark.tactview.core.timeline.AddClipRequest in project tactview by helospark.

the class FakeImageSequenceChooserDialog method clickOkButton.

public TimelineClip clickOkButton() {
    Map<AddClipRequestMetaDataKey, Object> metadata = new HashMap<>();
    metadata.put(AddClipRequestMetaDataKey.FPS, new BigDecimal(fps.toString()));
    String filePath = path + FileNamePatternToFileResolverService.PATH_FILENAME_SEPARATOR + pattern;
    AddClipRequest clipRequest = AddClipRequest.builder().withChannelId(timelineManagerAccessor.getChannels().get(channel).getId()).withPosition(position).withAddClipRequestMetadataKey(metadata).withFilePath(filePath).build();
    return timelineManagerAccessor.addClip(clipRequest);
}
Also used : HashMap(java.util.HashMap) AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest) AddClipRequestMetaDataKey(com.helospark.tactview.core.timeline.AddClipRequestMetaDataKey) BigDecimal(java.math.BigDecimal)

Example 2 with AddClipRequest

use of com.helospark.tactview.core.timeline.AddClipRequest in project tactview by helospark.

the class FakeUi method dragFileToTimeline.

public TimelineClip dragFileToTimeline(File testFile, TimelinePosition position) {
    TimelineChannel channel = timelineManagerAccessor.getChannels().get(0);
    AddClipRequest request = AddClipRequest.builder().withChannelId(channel.getId()).withFilePath(testFile.getAbsolutePath()).withPosition(position).build();
    return timelineManagerAccessor.addClip(request);
}
Also used : TimelineChannel(com.helospark.tactview.core.timeline.TimelineChannel) AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest)

Example 3 with AddClipRequest

use of com.helospark.tactview.core.timeline.AddClipRequest in project tactview by helospark.

the class FakeUi method dragProceduralClipToChannel.

public TimelineClip dragProceduralClipToChannel(String proceduralClipId, TimelinePosition position, int channelIndex) {
    TimelineChannel channel = timelineManagerAccessor.getChannels().get(channelIndex);
    AddClipRequest request = AddClipRequest.builder().withChannelId(channel.getId()).withFilePath(null).withPosition(position).withProceduralClipId(proceduralClipId).build();
    return timelineManagerAccessor.addClip(request);
}
Also used : TimelineChannel(com.helospark.tactview.core.timeline.TimelineChannel) AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest)

Example 4 with AddClipRequest

use of com.helospark.tactview.core.timeline.AddClipRequest in project tactview by helospark.

the class StandardGraphElementFactoryConfiguration method fileClipGraphElementFactory.

@Bean
public GraphElementFactory fileClipGraphElementFactory(List<ClipFactory> clipFactories, ClipFactoryChain clipFactoryChain, MessagingService messagingService) {
    return StandardGraphElementFactory.builder().withId("file").withDoesSupport(uri -> uri.startsWith("file://")).withName("File").withCategory(GraphCategory.INPUT).withNeedsInputParam(true).withCreator(graphRequest -> {
        AddClipRequest request = AddClipRequest.builder().withAddClipRequestMetadataKey(Map.of()).withPosition(TimelinePosition.ofZero()).withFilePath(graphRequest.uri.replaceFirst("file://", "")).build();
        VisualTimelineClip clip = (VisualTimelineClip) clipFactoryChain.createClips(request).get(0);
        clip.setInterval(INTERVAL);
        messagingService.sendAsyncMessage(new ClipDescriptorsAdded(clip.getId(), clip.getDescriptors(), clip));
        return new VisualTimelineClipElement(clip);
    }).withRestorer((node, metadata) -> {
        node.get("creatorFactoryId").asText();
        return new VisualTimelineClipElement(node, metadata, (VisualTimelineClip) clipFactoryChain.restoreClip(node.get("clip"), metadata));
    }).build();
}
Also used : TimelineClipType(com.helospark.tactview.core.timeline.TimelineClipType) TactviewPlatform(com.helospark.tactview.core.util.conditional.TactviewPlatform) ConditionalOnPlatform(com.helospark.tactview.core.util.conditional.ConditionalOnPlatform) ClipFactory(com.helospark.tactview.core.timeline.ClipFactory) StatelessVideoEffect(com.helospark.tactview.core.timeline.StatelessVideoEffect) EffectParametersRepository(com.helospark.tactview.core.timeline.effect.EffectParametersRepository) Configuration(com.helospark.lightdi.annotation.Configuration) CreateEffectRequest(com.helospark.tactview.core.timeline.effect.CreateEffectRequest) KeyframeSuccesfullyAddedMessage(com.helospark.tactview.core.timeline.message.KeyframeSuccesfullyAddedMessage) ConditionalOnProperty(com.helospark.lightdi.annotation.ConditionalOnProperty) AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest) EffectFactory(com.helospark.tactview.core.timeline.effect.EffectFactory) GraphProvider(com.helospark.tactview.core.timeline.effect.interpolation.provider.GraphProvider) Map(java.util.Map) Bean(com.helospark.lightdi.annotation.Bean) CameraOutputToV4L2LoopbackElement(com.helospark.tactview.core.timeline.effect.interpolation.graph.domain.types.realtime.CameraOutputToV4L2LoopbackElement) ProceduralClipFactoryChainItem(com.helospark.tactview.core.timeline.proceduralclip.ProceduralClipFactoryChainItem) GraphCategory(com.helospark.tactview.core.timeline.effect.interpolation.graph.domain.types.GraphElementFactory.GraphCategory) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) OpencvL4V2LoopbackImplementation(com.helospark.tactview.core.timeline.effect.interpolation.graph.domain.types.realtime.camera.OpencvL4V2LoopbackImplementation) ClipDescriptorsAdded(com.helospark.tactview.core.timeline.message.ClipDescriptorsAdded) Collectors(java.util.stream.Collectors) TimelineLength(com.helospark.tactview.core.timeline.TimelineLength) MessagingService(com.helospark.tactview.core.util.messaging.MessagingService) TimelineInterval(com.helospark.tactview.core.timeline.TimelineInterval) VisualTimelineClip(com.helospark.tactview.core.timeline.VisualTimelineClip) List(java.util.List) Optional(java.util.Optional) ClipFactoryChain(com.helospark.tactview.core.timeline.ClipFactoryChain) ProceduralVisualClip(com.helospark.tactview.core.timeline.proceduralclip.ProceduralVisualClip) AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest) ClipDescriptorsAdded(com.helospark.tactview.core.timeline.message.ClipDescriptorsAdded) VisualTimelineClip(com.helospark.tactview.core.timeline.VisualTimelineClip) Bean(com.helospark.lightdi.annotation.Bean)

Example 5 with AddClipRequest

use of com.helospark.tactview.core.timeline.AddClipRequest in project tactview by helospark.

the class AddClipsCommand method execute.

@Override
public void execute() {
    TimelinePosition positionToAddClipTo = position;
    for (var file : filePaths) {
        AddClipRequest addClipRequest = AddClipRequest.builder().withChannelId(channelId).withFilePath(file).withPosition(positionToAddClipTo).withProceduralClipId(null).withAddClipRequestMetadataKey(addClipRequestMetadataKey).build();
        TimelineClip result = timelineManager.addClip(addClipRequest);
        positionToAddClipTo = result.getInterval().getEndPosition();
        addedClipIds.add(result.getId());
    }
    if (proceduralClipId != null) {
        AddClipRequest addClipRequest = AddClipRequest.builder().withChannelId(channelId).withFilePath(null).withPosition(positionToAddClipTo).withProceduralClipId(proceduralClipId).build();
        TimelineClip result = timelineManager.addClip(addClipRequest);
        addedClipIds.add(result.getId());
    }
}
Also used : AddClipRequest(com.helospark.tactview.core.timeline.AddClipRequest) TimelinePosition(com.helospark.tactview.core.timeline.TimelinePosition) TimelineClip(com.helospark.tactview.core.timeline.TimelineClip)

Aggregations

AddClipRequest (com.helospark.tactview.core.timeline.AddClipRequest)5 TimelineChannel (com.helospark.tactview.core.timeline.TimelineChannel)2 TimelinePosition (com.helospark.tactview.core.timeline.TimelinePosition)2 Bean (com.helospark.lightdi.annotation.Bean)1 ConditionalOnProperty (com.helospark.lightdi.annotation.ConditionalOnProperty)1 Configuration (com.helospark.lightdi.annotation.Configuration)1 AddClipRequestMetaDataKey (com.helospark.tactview.core.timeline.AddClipRequestMetaDataKey)1 ClipFactory (com.helospark.tactview.core.timeline.ClipFactory)1 ClipFactoryChain (com.helospark.tactview.core.timeline.ClipFactoryChain)1 StatelessVideoEffect (com.helospark.tactview.core.timeline.StatelessVideoEffect)1 TimelineClip (com.helospark.tactview.core.timeline.TimelineClip)1 TimelineClipType (com.helospark.tactview.core.timeline.TimelineClipType)1 TimelineInterval (com.helospark.tactview.core.timeline.TimelineInterval)1 TimelineLength (com.helospark.tactview.core.timeline.TimelineLength)1 VisualTimelineClip (com.helospark.tactview.core.timeline.VisualTimelineClip)1 CreateEffectRequest (com.helospark.tactview.core.timeline.effect.CreateEffectRequest)1 EffectFactory (com.helospark.tactview.core.timeline.effect.EffectFactory)1 EffectParametersRepository (com.helospark.tactview.core.timeline.effect.EffectParametersRepository)1 GraphCategory (com.helospark.tactview.core.timeline.effect.interpolation.graph.domain.types.GraphElementFactory.GraphCategory)1 CameraOutputToV4L2LoopbackElement (com.helospark.tactview.core.timeline.effect.interpolation.graph.domain.types.realtime.CameraOutputToV4L2LoopbackElement)1