Timeline moves. need to test the clip information.

This commit is contained in:
Michael Chung committed 2024-03-30 16:14:34 -04:00
1 parent e21af5fad9
commit c4a3dc7a83
3 files changed
+52 -1

No files matched your search

@@ -19,6 +19,7 @@ interface Arguments {
export function useQueueHandler() {
useSignals();
const handleActions = useCallback(({ action, data }: Arguments) => {
console.log(`FROM ENGINE:${action} ${data}`)
switch (action) {
case fromEngineActions.UPDATE_TIME:
currentTime.value = (data as UpdateTime).currentTime;
+4 -1
View File
@@ -206,7 +206,6 @@ class Editor {
// });
if (this.can_initialize == false) {
console.log("Editor Already Initialized");
return;
@@ -331,6 +330,10 @@ class Editor {
console.log(result);
}
public async testTestTimelineEvents() {
Que
}
public async testStylizeRequest() {
const result = await this.api_manager.stylizeVideo(
"mu_6wy1570a0c3c0tpkkncf4tsvb5234",
+47
View File
@@ -7,6 +7,12 @@ import TransformEngine from "./transform_engine";
import LipSyncEngine from "./lip_sync_engine";
import AnimationEngine from "./animation_engine";
import Queue from "~/pages/PageEnigma/Queue/Queue";
import { QueueNames } from "../Queue/QueueNames";
import { toEngineActions } from "../Queue/toEngineActions";
import { Action } from "@remix-run/router";
import { fromEngineActions } from "../Queue/fromEngineActions";
import { currentTime } from "../store";
// Every object uuid / entity has a track.
export class TimelineCurrentState {
is_editable: boolean
@@ -45,6 +51,8 @@ export class TimeLine {
lipSync_engine: LipSyncEngine
scene: Scene
current_time:number
// ensure that the elements are loaded first.
constructor(audio_engine: AudioEngine,
transform_engine: TransformEngine,
@@ -65,6 +73,45 @@ export class TimeLine {
this.animation_engine = animation_engine
this.scene = scene;
Queue.subscribe(QueueNames.TO_ENGINE, this.handleTimelineActions);
this.current_time = 0
// TODO: How to move the timeline should put in update.
// setInterval(()=> {
// this.current_time +=1
// this.pushEvent(fromEngineActions.UPDATE_TIME, { currentTime: this.current_time })
// },50)
}
public async pushEvent(action:fromEngineActions, data:any) {
this.current_time += 1
Queue.publish({
queueName: QueueNames.FROM_ENGINE,
action: fromEngineActions.UPDATE_TIME,
data: data ,
});
}
public async handleTimelineActions(data:any) {
const action = data["action"]
switch (action) {
case toEngineActions.ADD_CLIP:
break
case toEngineActions.DELETE_CLIP:
break
case toEngineActions.UPDATE_CLIP:
break
case toEngineActions.PLAY_CLIP:
break
case toEngineActions.UPDATE_TIME:
break
case toEngineActions.MUTE:
default:
console.log("Action Not Wired")
}
console.log(data)
}
public async addPlayableClip(clip: ClipUI): Promise<void> {