kdenlive-ts/src/playlist.ts

24 lines
531 B
TypeScript

import { makeIDGen } from "./util";
const playlistIndexGen = makeIDGen(0);
export abstract class Playlist {
constructor(public index = playlistIndexGen.next().value) {}
abstract toXML(): string;
}
export class AudioPlaylist extends Playlist {
toXML() {
return /* HTML */ ` <playlist id="playlist${this.index}">
<property name="kdenlive:audio_track">1</property>
</playlist>`;
}
}
export class VideoPlaylist extends Playlist {
toXML() {
return /* HTML */ ` <playlist id="playlist${this.index}"></playlist>`;
}
}