34 lines
599 B
TypeScript
34 lines
599 B
TypeScript
import { Producer } from "./producer";
|
|
|
|
export abstract class Entry {
|
|
abstract toXML(): string;
|
|
}
|
|
|
|
export class MediaEntry extends Entry {
|
|
constructor(
|
|
public producer: Producer,
|
|
public in_point: string,
|
|
public out_point: string
|
|
) {
|
|
super();
|
|
}
|
|
|
|
toXML(): string {
|
|
return /* HTML */ `<entry
|
|
producer="${this.producer.id}"
|
|
in="${this.in_point}"
|
|
${this.out_point ? `out="${this.out_point}"` : ""}
|
|
></entry>`;
|
|
}
|
|
}
|
|
|
|
export class BlankEntry extends Entry {
|
|
constructor(public length: string) {
|
|
super();
|
|
}
|
|
|
|
toXML(): string {
|
|
return `<blank length="${this.length}"/>`;
|
|
}
|
|
}
|