import { BitData } from "./BitData.js"; import { DisplaySamples } from "./DisplaySamples.js"; import { ByteData } from "./ByteData.js"; import { SimpleEventDispatcher } from "strongly-typed-events"; import { TapeDecoder } from "./TapeDecoder.js"; import { ProgramAnnotation } from "trs80-base"; /** * Get the binary wrapped in a CAS. */ export declare function binaryAsCasFile(binary: Uint8Array, baud: number): Uint8Array; /** * Get the audio for a CAS binary (not including the WAV header). */ export declare function casAsAudio(cas: Uint8Array, baud: number, sampleRate: number): Int16Array; /** * Represents a program on a tape. */ export declare class Program { trackNumber: number; copyNumber: number; startFrame: number; endFrame: number; decoder: TapeDecoder; readonly baud: number; binary: Uint8Array; bitData: BitData[]; byteData: ByteData[]; annotations: ProgramAnnotation[] | undefined; reconstructedSamples: DisplaySamples | undefined; name: string; notes: string; screenshot: string; readonly onName: SimpleEventDispatcher; readonly onNotes: SimpleEventDispatcher; readonly onScreenshot: SimpleEventDispatcher; constructor(trackNumber: number, copyNumber: number, startFrame: number, endFrame: number, decoder: TapeDecoder, baud: number, binary: Uint8Array, bitData: BitData[], byteData: ByteData[]); /** * Set the high-speed samples reconstructed from the binary. */ setReconstructedSamples(reconstructedSamples: Int16Array): void; /** * Get a generic label for the program. */ getLabel(): string; /** * Get a generic short label for the program. */ getShortLabel(): string; /** * Returns a filename-like string for this program, without an extension. */ getPseudoFilename(): string; /** * Whether the binary represents a Basic program. */ isBasicProgram(): boolean; /** * Set the name of the program, as set by the user. */ setName(name: string): void; /** * Set the notes for the program, as set by the user. */ setNotes(notes: string): void; /** * Set the screenshot for the program. */ setScreenshot(screenshot: string): void; /** * Get a representative timestamp for this program, in seconds. */ getTimestamp(sampleRate: number): number; /** * Whether the given timestamp (in seconds) could apply to this program. */ isForTimestamp(timestamp: number, sampleRate: number): boolean; /** * Whether the binary represents an EDTASM program. * * http://www.trs-80.com/wordpress/zaps-patches-pokes-tips/edtasm-file-format/ */ isEdtasmProgram(): boolean; /** * Whether these two programs have the same binaries. */ sameBinaryAs(other: Program): boolean; /** * Return a .cas file version of the binary. * * @param baud the baud rate, or undefined to use the original. 1500 is considered high speed, * anything below that is considered low speed. */ asCasFile(baud?: number): Uint8Array; /** * Return just the audio portion of a WAV file for this program. * * @param baud the output baud rate, or undefined to use the original. */ asAudio(baud?: number): Int16Array; /** * Return a .wav file version of the binary. */ asWavFile(): Uint8Array; /** * Whether this program is strictly nested in the other program, with margin to spare. */ isNestedIn(candidate: Program, marginFrames: number): boolean; /** * Return the number of bit errors we've found. This is not super cheap, cache if you need it a lot. */ countBitErrors(): number; } //# sourceMappingURL=Program.d.ts.map