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);
}
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);
}
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);
}
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();
}
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());
}
}
Aggregations