/** * Definition of a single hardware HDMI encoder. */ export interface HdmiEncoderDefinition { /** * Human-readable label for this encoder (e.g., "Living Room Encoder"). Used in log output. */ label?: string; /** * The HTTP or RTSP stream URL provided by the hardware encoder itself * (e.g., "http://192.168.1.50/live/stream0"). This is what Channels DVR will consume. */ streamUrl: string; /** * X coordinate (pixels) of the left edge of the target display, as reported by the OS display * arrangement. For the primary display this is typically 0. For a secondary display positioned * to the right of the primary at 1920×1080, this would be 1920. * * NOTE: Must use logical pixels (100% DPI scaling). At 150% scaling, divide physical px by 1.5. */ windowX: number; /** * Y coordinate (pixels) of the top edge of the target display. */ windowY: number; /** * Width of the target display in logical pixels (e.g., 1920). */ displayWidth: number; /** * Height of the target display in logical pixels (e.g., 1080). */ displayHeight: number; /** * Partial name of the Windows or macOS audio output device to route Chrome audio to * (e.g., "Speakers", "HDMI", "BlackHole"). Optional — if absent, the system default is used. * Matched case-insensitively against device names reported by the OS. * * NOTE: Automatic per-process audio routing is a Phase 2 feature. In Phase 1, PrismCast logs * the available devices and a setup reminder but does not assign audio automatically. */ audioDevice?: string; /** * Chrome user-data-dir name inside the data directory (e.g., "encoder-0"). If absent, the name * is auto-derived as "encoder-". Using a stable name allows login sessions to persist * across restarts. */ profileName?: string; } /** * Top-level structure of encoders.json. */ export interface HdmiEncoderConfig { /** * Set to false to disable all encoder functionality without deleting the config file. */ enabled: boolean; /** * Array of encoder definitions. Each entry corresponds to one hardware encoder port. */ encoders: HdmiEncoderDefinition[]; } /** * Maps a PrismCast channel key to the index of the encoder in HdmiEncoderConfig.encoders that * should display that channel. This is the contents of encoder-channels.json. * * Example: * { "cnn": 0, "fox-news": 0, "msnbc": 1 } */ export type EncoderChannelMap = Record; /** * Returns the path to the encoders configuration file. */ export declare function getEncodersFilePath(): string; /** * Returns the path to the encoder channel assignment file. */ export declare function getEncoderChannelsFilePath(): string; /** * Returns the Chrome user-data-dir path for a specific encoder index. * @param index - The encoder index (0-based). * @param def - The encoder definition (may contain an explicit profileName). */ export declare function getEncoderProfileDir(index: number, def: HdmiEncoderDefinition): string; /** * Validates an HdmiEncoderConfig object. Returns an array of human-readable error strings. * An empty array means the config is valid. * @param config - The config object to validate. */ export declare function validateEncoderConfig(config: HdmiEncoderConfig): string[]; /** * Loads and validates encoders.json from the data directory. Returns the default (disabled) config * if the file does not exist. Logs warnings for parse errors and validation failures; returns the * default config in both cases so the rest of the server starts normally. */ export declare function loadEncoderConfig(): Promise; /** * Loads encoder-channels.json from the data directory. Returns an empty map if the file does not * exist. Logs warnings for parse errors. */ export declare function loadEncoderChannels(): Promise; /** * Saves an encoder channel assignment map to encoder-channels.json. Entries are sorted by key for * consistent diffs. * @param assignments - The channel-to-encoder-index map to save. */ /** * Saves an HdmiEncoderConfig to encoders.json in the data directory. * @param config - The encoder config to persist. */ export declare function saveEncoderConfig(config: HdmiEncoderConfig): Promise; export declare function saveEncoderChannels(assignments: EncoderChannelMap): Promise;