import { Entry } from "./entry";
import { AudioPlaylist, Playlist, VideoPlaylist } from "./playlist";
import { makeIDGen } from "./util";
export const trackIndexGen = makeIDGen(0);
export abstract class Tractor {
main_playlist: Playlist;
secondary_playlist: Playlist; // not sure what these are for, but Kdenlive generates them, sooo
public index = trackIndexGen.next().value;
abstract toXML(): string;
addEntry(entry: Entry): this {
this.main_playlist.addEntry(entry);
return this;
}
}
export class AudioTractor extends Tractor {
constructor() {
super();
this.main_playlist = new AudioPlaylist();
this.secondary_playlist = new AudioPlaylist();
}
toXML() {
return [
this.main_playlist.toXML(),
this.secondary_playlist.toXML(),
/* HTML */ `
1
67
1
0
`,
].join("\n");
}
}
export class VideoTractor extends Tractor {
constructor() {
super();
this.main_playlist = new VideoPlaylist();
this.secondary_playlist = new VideoPlaylist();
}
toXML() {
return [
this.main_playlist.toXML(),
this.secondary_playlist.toXML(),
/* HTML */ `
67
1
`,
].join("\n");
}
}