-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Landed on a structure that i can get behind, thanks to shallowRef and…
… shallowReactive. Changed a bunch of file locations Changed timecode Added tests for timecode Split AVTimelineItem into VideoTimelineItem and AudioTimelineItem
- Loading branch information
Showing
30 changed files
with
378 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type BaseProject from '@safelight/shared/base/Project'; | ||
import type BaseTimeline from '@safelight/shared/base/Timeline'; | ||
import type { InjectionKey } from 'vue'; | ||
|
||
export const CURRENT_PROJECT: InjectionKey<BaseProject> = Symbol('current.project'); | ||
export const CURRENT_TIMELINE: InjectionKey<BaseTimeline> = Symbol('current.timeline'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,16 @@ | ||
import Media from '@/controllers/Media/Media'; | ||
import SimpleTimeline from '@/controllers/Timeline/SimpleTimeline'; | ||
import Timecode from '@safelight/shared/timecode'; | ||
import SimpleProject from '@safelight/shared/Project/SimpleProject'; | ||
|
||
export const useProject = defineStore('Project', () => { | ||
const name = ref('Untitled'); | ||
const media = ref<Media[]>([]); | ||
const timelines = ref<SimpleTimeline[]>([new SimpleTimeline()]); | ||
const activeTimelineIndex = ref(0); | ||
const cursor = Timecode.from(0); | ||
const timelineViewStart = Timecode.from(0); | ||
const timelineViewEnd = Timecode.from(0); | ||
const cursor = ref(0); | ||
const timelineViewStart = ref(0); | ||
const timelineViewEnd = ref(0); | ||
|
||
const activeTimeline = computed(() => timelines.value[activeTimelineIndex.value]); | ||
|
||
function getMediaFromID(id: string) { | ||
return useArrayFind(media, (m) => m.id == id); | ||
} | ||
const project = new SimpleProject(); | ||
|
||
return { | ||
name, | ||
media, | ||
timelines, | ||
cursor, | ||
timelineViewStart, | ||
timelineViewEnd, | ||
activeTimeline, | ||
getMediaFromID | ||
timelineViewEnd | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
import SimpleTimeline from '@/Timeline/SimpleTimeline'; | ||
import { computed, ref, shallowReactive } from 'vue'; | ||
import Media from '../Media/Media'; | ||
import SimpleTimeline from '../Timeline/SimpleTimeline'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
import BaseProject, { type ProjectType } from '../base/Project'; | ||
|
||
export default class SimpleProject extends BaseProject { | ||
public id = uuidv4(); | ||
public name = 'Untitled'; | ||
public type: ProjectType = 'Simple'; | ||
|
||
public media: Media[] = []; | ||
public timelines: SimpleTimeline[] = []; | ||
public activeTimeline: number; | ||
public media = shallowReactive<Media[]>([]); | ||
|
||
constructor() { | ||
super(); | ||
|
||
const tl = new SimpleTimeline(); | ||
|
||
this.timelines = [tl]; | ||
this.activeTimeline = 0; | ||
} | ||
protected selectedTimelineIndex = ref(0); | ||
public timelines = shallowReactive<SimpleTimeline[]>([]); | ||
public timeline = computed(() => this.timelines.at(this.selectedTimelineIndex.value)!); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.