Skip to content

filmopen_media

Generated by scripts/package_digest.py; regenerate, never edit.

Local media storage, playback values and input descriptions.

pure Dart. 11 files, 1,046 lines under lib/; 66 tests in 8 files. Barrel: lib/filmopen_media.dart.

  • filmopen_format — uses Author, Entity, EntityGroup, EntityType, FileNameParser, FilmProject, MediaEntry, MediaKind, MediaLocation, MediaStage, ProjectArea, ProjectSource, ReferenceCodec, ReferenceKind, ReferenceTarget, RenderBatch, RenderItem, ScriptBlock, StaleFileException, Take, TakeName, blockIdsOf, blocksOf, coverageIntact, entriesIn, entryNaming, isDeleted, isGroupDeleted, isMediaFileName, liveReferencesOf and 14 more
  • filmopen_test_support (dev) — uses nothing by name the digest could see

filmopen_app, filmopen_browser, filmopen_drive, filmopen_forms, filmopen_insertion, filmopen_insertion_ui, filmopen_media_ui, filmopen_plugin_host, filmopen_prompt_ui, filmopen_render_ui, filmopen_state, filmopen_timeline

What the barrel exports, file by file. A name is class, enum, mixin, extension, typedef, a top-level function, getter, setter or variable; under a class, its public constructors, fields, getters, setters and methods.

  • function MediaLocation? epochPictureFor(FilmProject project, EntityGroup group, String? epoch, Entity entity) — The picture for [group] at [epoch], whose version in use is [entity] (§9.0).
  • function MediaLocation? pictureInUse(FilmProject project, EntityGroup group, String? epoch, Author? viewer) — The picture of [group] as [viewer] sees it at [epoch], for a picker’s entry (§9.0).
  • function Take? epochFallbackTake(FilmProject project, EntityGroup group, String? epoch, Entity entity) — The picture an epoch’s card falls back to: the first image take rendered for any version of [group] at [epoch] that [entity], the version in use, does not hold deleted — whoever keeps its file (§9.0).
  • function List<String> epochPictureCandidates(Entity entity) — What an epoch’s card may take its picture from, in order: the version’s preview, then its picks.sheet.
  • class LocalMediaStore — The store of the project’s media folder, on disk or in a session copy.
    • const LocalMediaStore(this.source) — Uses the project’s own source; names passed to the store are file names.
    • LocalMediaStore.of(FilmProject project) — The media store of an open project.
    • final ProjectSource source
  • enum MediaFetchStatus — Where one media file of a film stands for this device (§6.14).
    • values: remote, fetching, local, failed
  • class MediaFetchState — One change of one media file’s [MediaFetchStatus], as a tile or a viewer redraws from it.
    • const MediaFetchState({ required this.filmKey, required this.fileName, required this.status, this.progress, this.code, }) — Names the film by its key and the file by its name in the media folder.
    • final String filmKey — The film’s key (projectSourceKey).
    • final String fileName — The file’s name in the film’s media folder.
    • final MediaFetchStatus status — Where the file stands.
    • final double? progress — The download’s progress from 0 to 1 while [MediaFetchStatus.fetching], where known.
    • final String? code — A safe code where [MediaFetchStatus.failed].
  • class MediaFetchProblem — A download a read needed and could not have: its safe [code] only (§6.14).
    • const MediaFetchProblem(this.code) — Keeps the download’s safe code, such as notAvailable or the fetch job’s own.
    • final String code — The download’s safe code.
  • class MediaFetch — The seam that downloads a remote-only media file before it is read; the default does nothing (§6.14).
    • const MediaFetch() — Lets an implementation be constant.
    • static MediaFetch current — Starts as [NoMediaFetch]; the application installs its own.
    • static void Function(String event, Map<String, Object?> data)? log — Hears the store’s own lines; the application installs its log here.
    • Future<void> ensureLocal(ProjectSource source, String fileName, {String reason = 'read'}) — Answers once the media file [fileName] of the film [source] holds is local: at once where the source has it, else after downloading it where the sync has it.
    • bool isRemote(String filmKey, String fileName) — Whether [fileName] of the film [filmKey] is on the target only, so a picture of it would download it.
    • Stream<MediaFetchState> get states — Every change of a file’s status, for the widgets that show it.
    • static Future<void> ensureIn(MediaStore store, String fileName, {required String reason}) — Ensures [fileName] is local before a reader of [store] reads it: a store of a project’s media folder only; any other store’s files are its own (§6.14).
  • class NoMediaFetch — The seam where nothing is remote: every file is read as it is.
    • const NoMediaFetch() — Starts no listener.
  • class MediaInput — Bytes to import, from wherever they come.
    • const MediaInput()
    • const factory MediaInput.file(String path, {String? name}) — A file on this machine, chosen in a file dialog.
    • const factory MediaInput.bytes(List<int> bytes, String name) — Bytes the caller already has, with the name they had.
    • const factory MediaInput.url(Uri uri, {String? name}) — An address to fetch: http or https, the content type checked before anything is stored.
    • String get originalName — The name the file had where it came from.
  • class FileInput — A file the person chose in a file dialog.
    • const FileInput(this.path, {this.name})
    • final String path
    • final String? name — The name a person saw, where a picker gives one that is not the path’s last segment.
  • class BytesInput — Bytes the caller already has: what a browser’s own picker hands over, and what a test gives.
    • const BytesInput(this.bytes, this.originalName)
    • final List<int> bytes
  • class UrlInput — An address to fetch.
    • const UrlInput(this.uri, {this.name})
    • final Uri uri
    • final String? name — What the caller knows the file is called, where the address does not say; the address’s last segment when absent.
  • class MediaFact — One of an entry’s facts — its length or its size — as the entry and its record each say it (§6.9).
    • const MediaFact({this.entry, this.record})
    • final int? entry — What the entry says; null where it says nothing.
    • final int? record — What the record’s item says; null where no record names the media or the item says nothing.
    • int? get drawn — The value to draw: the record’s where it has one, else the entry’s.
    • bool get disagrees — Whether the entry and its record both say it and say it differently, which the tooltip names.
  • class MediaProvenance — What is known of a placed render: its status, when it was asked, what changed since, when it was kept, and its facts beside its record’s (§6.9).
    • const MediaProvenance({ required this.status, this.askedAt, this.changes = const [], this.keptAt, this.duration = const MediaFact(), this.width = c…
    • factory MediaProvenance.of(FilmProject project, Map<String, dynamic> document, MediaEntry entry, { String? group, String? block, ProjectMedia? medi… — What is known of [entry] as [document] shows it, its record read from [project] (§6.9).
    • final MediaStatus status — Whether what it was rendered from has changed since.
    • final DateTime? askedAt — When its render was asked; null for an upload and where the record does not say.
    • final List<MediaChange> changes — What changed after it was asked, in the order the rule reads them; empty unless [status] is outdated.
    • final DateTime? keptAt — When a person kept it; null until then.
    • final MediaFact duration — Its length in milliseconds, 0 for a still.
    • final MediaFact width — Its width in pixels.
    • final MediaFact height — Its height in pixels.
    • final Map<String, Object?>? from — The take as a render continued from it receives it: the record’s stem, the take’s item, the record’s request and top container whole, its seed applied and its way; null where the record asked nothing.
  • enum MediaStatus — A placed render’s standing against what it was rendered from (§6.9).
    • values: current, outdated, unknown
    • static MediaStatus of(FilmProject project, Map<String, dynamic> document, MediaEntry entry, { String? group, String? block, }) — The status of [entry] as [document] shows it, its record read from [project] (§6.9).
    • static MediaStatus fromChanges(List<MediaChange>? changes) — The status [changes] give, as MediaChange.after answers them: unknown for null, current for none.
  • enum MediaChangeKind — What a change that outdates a render was made to.
    • values: document, block, coverage, source, stage
  • class MediaChange — One thing a render depended on that changed after it was asked (§6.9).
    • const MediaChange({required this.kind, this.at, this.position, this.stem, this.renderStage, this.holderStage})
    • final MediaChangeKind kind — What changed.
    • final DateTime? at — When it changed, as its updated says; null for a [MediaChangeKind.coverage] and a [MediaChangeKind.stage].
    • final int? position — The 1-based position of a [MediaChangeKind.block] among the document’s blocks, the count the editor shows.
    • final String? stem — The version stem of a [MediaChangeKind.source].
    • final MediaStage? renderStage — The stage a [MediaChangeKind.stage]’s render was asked at.
    • final MediaStage? holderStage — The stage the holder of a [MediaChangeKind.stage]’s render is at now, above [renderStage].
    • static List<MediaChange>? after(FilmProject project, RenderBatch? batch, Map<String, dynamic> document, MediaEntry entry, { String? group, String?… — What changed after [batch]’s render was asked, for [entry] as [document] shows it; null where unknown.
  • class Playable — What a player opens: a local file, session bytes or a streaming address.
    • const Playable()
  • class PlayableFile — A file on this machine’s disk.
    • const PlayableFile(this.path)
    • final String path
  • class PlayableBytes — Bytes in memory: a session copy’s own media, where there is no disk.
    • const PlayableBytes(this.bytes, {this.name})
    • final List<int> bytes
    • final String? name
  • class PlayableUrl — An address a player may stream from, with whatever headers it needs.
    • const PlayableUrl(this.uri, {this.headers = const {}})
    • final Uri uri
    • final Map<String, String> headers
  • class MediaStore — The project’s media folder.
    • Future<bool> get isAvailable — Whether the store can accept writes.
    • Future<void> put(String path, Stream<List<int>> bytes, {int? length}) — Writes [bytes] at [path].
    • Future<Playable> open(String path) — How a player reaches the file: a path on this machine, bytes, or an address to stream from.
    • Future<bool> exists(String path)
    • Future<int?> length(String path) — The size of the file in bytes, or null when there is no such file.
    • Future<List<int>> read(String path) — The whole bytes of one file: the thumbnailer’s way in.
    • Future<List<String>> list() — Every filename in the flat media folder.
    • Future<void> delete(String path) — Removes one file, including a take an unsuccessful import rolls back.
  • enum MediaRefKind — What a reference is (§6.3): a take stem, a media path or a URL.
    • values: takeStem, path, url
  • class MediaRef — A media reference as a file wrote it, and what kind of reference it is.
    • factory MediaRef.of(String reference)
    • final String reference — Exactly what the file says; never rewritten.
    • final MediaRefKind kind
    • bool get isUrl
  • class ProjectMedia — A piece of media a file names, in its media folder or by an external URL.
    • const ProjectMedia({ required this.ref, required this.kind, required this.displayName, this.mediaPath, this.thumbnailPath, this.hasThumbnail = fals…
    • factory ProjectMedia.of(FilmProject project, String reference, {String? batch, int? item}) — The piece of media a reference names, read from [project] (§6.3, §12.2).
    • factory ProjectMedia.ofEntry(FilmProject project, MediaEntry entry) — The piece of media an entry names, with the record the entry names (§9.0).
    • final MediaRef ref
    • final MediaKind kind
    • final String displayName — What a person calls it.
    • final String? mediaPath — The file name in media/; null for a URL or an unresolved reference.
    • final String? thumbnailPath — Where its thumbnail would be, relative to the project folder (§6.3); null for a URL.
    • final bool hasThumbnail — Whether the project actually holds that thumbnail.
    • final MediaLocation? location — Where the project’s source can load the bytes, when available.
    • final RenderItem? recorded — The batch item that names this piece of media, where one does.
    • final RenderBatch? batch — The batch record [recorded] is an item of: what a tile’s provenance and its new mark read (§12.2).
    • MediaLocation? thumbnail(FilmProject project) — The thumbnail to paint, or null when there is none.
    • Future<Playable> open(MediaStore store) — Opens the bytes through the store of whatever place they are in.
  • function List<ProjectMedia> liveMediaOf(FilmProject project, Map<String, dynamic> json) — Every piece of media [json] keeps live (§9.0), in file order and without repeats, then a preview no entry names — a deleted one included, as the media card reads it (§9.3).
  • extension EntityMedia — A file’s [liveMediaOf].
    • List<ProjectMedia> media(FilmProject project)
  • class PromptToken — One piece of media a prompt may name: its token, whose it is, and its entry.
    • const PromptToken({ required this.token, required this.holder, required this.holderName, required this.word, required this.n, required this.entry, }) — Describes the [n]th usable entry of [word]’s group on [holder].
    • final String token — The token as a prompt writes it: @inspiration-1, or in a frame @ch_kira:character_sheet-1.
    • final String holder — The stem of the file whose media it is: the version being edited, or in a frame the version in use.
    • final String holderName — The holder’s display name, as the version in use says it.
    • final String word — The token’s word: inspiration, reference or a sheet, character_sheet … prop_sheet ([mediaTokenGroups]).
    • final int n — The entry’s position among its group’s usable entries, from 1.
    • final MediaEntry entry — The entry it names.
    • String get group — The group [word] names.
    • bool get scoped — Whether the token names its holder, as a frame’s do.
    • ReferenceTarget get target — The codec’s target for this token.
  • function bool isPromptInput(MediaEntry entry) — Whether [entry] may be sent to a model as a prompt’s input.
  • function List<PromptToken> promptTokenCandidates(FilmProject project, Entity document, String kind, {required Author? viewer}) — The tokens a prompt of the writers’ [kind] on [document] may name for [viewer], in order (§9.8).
  • function ({List<String> own, Map<EntityType, List<String>> film}) promptTokenGroups(String kind) — The media groups a prompt of the writers’ [kind] names, its own file’s or the film’s per type (§9.8).
  • function ({List<PromptToken> inputs, List<String> missing}) promptInputsOf(String text, List<PromptToken> candidates) — What [text]’s media tokens name among [candidates], and the tokens that name none.
  • function String substitutePromptTokens(String words, List<PromptToken> inputs, String placeholders) — [words] with each media token naming one of [inputs] written in the model’s [placeholders] (§9.8).
  • class StoreProblem — A store’s stable failure code, without exposing its package or server text.
    • String get storeCode