Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ dd text eol=lf
/src/Res/logo.png -text
/src/Res/logo15.png -text
/src/Res/logo30.png -text

# Read on Linux, where a desktop entry whose lines end in a carriage return is invalid.
/packaging/** text eol=lf
/packaging/linux/icons/** -text
3 changes: 3 additions & 0 deletions .github/instructions/docs.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ owning document.
two documents come to disagree, and an agent reading the wrong one cannot tell.
- **GitHub issues and releases own work, status, discussion, follow-up, and release history.**
Repository documents describe current behavior and constraints, not how they evolved.
- **The one exception is the next release's plan, `docs/v-<version>.md`.** It tracks that release's
work until it ships; its user-facing changes then become the GitHub release notes, and the next
release's plan replaces it.
- **Source owns exact APIs, enums, signatures and file lists.** Documents name files and stable
symbols so a reader can route; they do not restate a signature that the compiler already checks.
- Unfinished ideas, alternatives, open questions, validation transcripts, and rejected designs do
Expand Down
18 changes: 10 additions & 8 deletions .github/instructions/platform.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Owning documents: [implementation](../../docs/implementation.md) for the boundar
System headers, Windows API calls and OS handle types (`HWND`, `LRESULT`, `WPARAM`, `LPARAM`,
`<windows.h>`, `d3d11`, `dxgi`, `dwrite`, `shlobj`, `shellapi`, `wincodec`) appear **only** in `platform*`
files, apart from the entry points in `app.cpp`. The lint enforces this. `test_platform_win.cpp` is
the single test file permitted system headers, and keeping those tests there is what lets every other
test file stay free of them.
the single test file permitted Windows system headers, and keeping those tests there is what lets every other
test file stay free of them; `test_platform_linux.cpp` is the Linux counterpart, whose subject is what only
Linux builds.

## Adding to the abstraction

Expand All @@ -26,16 +27,17 @@ even though it compiles. A service only the window layer can implement is declar
[render.h](https://github.com/ZacWalk/libdesktop/blob/main/include/libdesktop/render.h) or
[ui.h](https://github.com/ZacWalk/libdesktop/blob/main/include/libdesktop/ui.h) instead, and implemented
by its render backends (`src/render/win`, `src/render/linux`), also in libdesktop. What stays here is the
application's own: its side of FFmpeg's hardware decoding (`platform_win_av.cpp`), the screen recorder
(`platform_win_record.cpp`), its resource script and Linux glue (`platform_linux_app.cpp`).
`src/app.cpp` owns the Windows `wWinMain` and Linux `main`, and both call `platform::run`.
application's own: its side of FFmpeg's hardware decoding (`platform_win_av.cpp`), which writer writes a movie
- the system's on Windows, FFmpeg's own on Linux - behind `df::create_movie_writer` (`av_movie_writer.h`), the
screen recorder (`platform_win_record.cpp`), its resource script and Linux glue (`platform_linux_app.cpp`).
`src/app.cpp` owns `main`, the same on both systems, which calls `platform::run`.

Every new platform capability needs a Linux implementation or an explicit unavailable answer.
libdesktop's [Linux backend](https://github.com/ZacWalk/libdesktop/blob/main/docs/platform.md#the-linux-backend)
lists what it answers as unavailable, and [linux.md](../../docs/linux.md) what that removes from
Diffractor. `platform_linux_app.cpp` supplies the Linux hardware-decode, screen-recorder and platform-test
answers; it is built instead of the Windows-only `platform_win_av.cpp`, `platform_win_record.cpp` and
`test_platform_win.cpp`.
Diffractor. `platform_linux_app.cpp` supplies the Linux hardware-decode, movie-writer and screen-recorder
answers and registers the Linux platform tests, `test_platform_linux.cpp`; it is built instead of the
Windows-only `platform_win_av.cpp`, `platform_win_record.cpp` and `test_platform_win.cpp`.

## Capability is answered at run time

Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ permissions:

jobs:
build:
runs-on: ubuntu-24.04
# The x64 legs keep their names; the legs on Arm's runner add arm64, and there FFmpeg's configure
# chooses its aarch64 assembly and nasm goes unused.
name: build (${{ matrix.config }}${{ matrix.os == 'ubuntu-24.04-arm' && ', arm64' || '' }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
config: [ Debug, Release ]
os: [ ubuntu-24.04, ubuntu-24.04-arm ]

steps:
- uses: actions/checkout@v4
Expand All @@ -33,26 +37,32 @@ jobs:
# The vendored build is the default (DIFFRACTOR_PREFER_SYSTEM is OFF), so these are the
# toolchain rather than the dependencies. FFmpeg is driven by its own configure and make.
# libdesktop-render's window layer sets text with Pango and drives X11 and Wayland through SDL3,
# which it builds from its pin, so it needs their development packages.
# which it builds from its pin, so it needs their development packages. libdesktop-platform's
# web client is the system's libcurl and its JPEG decoder the system's libjpeg-turbo; SDL3 builds
# its PulseAudio, ALSA and PipeWire audio backends only where their development packages are
# installed; and a phone or camera is reached over MTP through libmtp, which speaks USB through libusb.
- name: Install toolchain
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build pkg-config ccache nasm \
libpango1.0-dev libfontconfig-dev libfreetype-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libwayland-dev wayland-protocols libegl-dev libgl-dev libgles-dev libdrm-dev \
libgbm-dev libdecor-0-dev libdbus-1-dev libudev-dev
libgbm-dev libdecor-0-dev libdbus-1-dev libudev-dev \
libcurl4-openssl-dev libjpeg-dev libpulse-dev libasound2-dev libpipewire-0.3-dev libmtp-dev \
libusb-1.0-0-dev

# FFmpeg and the 25 vendored CMake modules are most of the build time and change rarely.
# CCACHE_DIR is set rather than assumed: ccache 4.x defaults to ~/.cache/ccache, not ~/.ccache,
# so caching the older path would silently cache nothing.
# so caching the older path would silently cache nothing. An ARM64 leg's key names its
# architecture, so neither architecture restores the other's objects.
- name: Cache compiler output
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ runner.os }}-${{ matrix.config }}-${{ github.sha }}
key: ccache-${{ runner.os }}${{ runner.arch == 'ARM64' && '-ARM64' || '' }}-${{ matrix.config }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ matrix.config }}-
ccache-${{ runner.os }}${{ runner.arch == 'ARM64' && '-ARM64' || '' }}-${{ matrix.config }}-

# bash ./dd rather than ./dd: the launcher is checked in from Windows and carries no
# executable bit. It prefers pwsh and falls back to tools/dd.py, which is what runs here.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ exe/tiles/*.png
/search_*.ps1
*.msixupload
*.appxsym
# Debian packages from `dd deb`, and their debug information.
/*.deb
/*.debug
# Store artwork from running tools/generate_store_assets.py by hand; packaging writes its own to dist/.
/exe/Assets/
12 changes: 7 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ open the listed source, and run the listed check. Do not read unrelated document
| Edit: a photo's adjustments, a video's or sound file's lossless trim, sound removal and turn | [design](docs/design.md#metadata-editing-and-files); writing is [file I/O](docs/file-io.md#writing)'s | [view_edit.cpp](src/view_edit.cpp), [media_edit.cpp](src/media_edit.cpp), [av_format.cpp](src/av_format.cpp)'s `av_remux` | `/test:*edit*`, `/test:*trim*` |
| SID tunes and their length, tracker modules, the Commodore 64 | [design](docs/design.md#selection-and-viewing) | [av_sid.cpp](src/av_sid.cpp), [ui_sid.cpp](src/ui_sid.cpp), [av_tracker.cpp](src/av_tracker.cpp), [ui_tracker.cpp](src/ui_tracker.cpp), [av_c64.cpp](src/av_c64.cpp), [ui_c64.cpp](src/ui_c64.cpp) | `/test:*SID tune*`, `/test:*monitor*`, `/test:*tracker*`, `/test:*Commodore*` |
| A guided operation: Rename, Import, Sync, Convert, Metadata, Date | [design](docs/design.md#guided-operations) | [view_rename.cpp](src/view_rename.cpp), [view_import.cpp](src/view_import.cpp), [view_sync.cpp](src/view_sync.cpp), [view_batch.cpp](src/view_batch.cpp) | `/test:*rename*`, `/test:*import*`, `/test:*sync*` |
| Movie mixer: the timeline, project files, rendering, YouTube Shorts, checking and rendering without the window | [movie](docs/movie.md) | [model_movie.cpp](src/model_movie.cpp), [view_movie.cpp](src/view_movie.cpp), [view_movie_audio.cpp](src/view_movie_audio.cpp), [app_movie_batch.cpp](src/app_movie_batch.cpp) | `/test:*movie*`, `/test:*YouTube*` |
| An agent session over MCP, its tools, `-tool:`, screenshots, recording and tutorial scripts | [agents](docs/agents.md) | [app_mcp.cpp](src/app_mcp.cpp), [app_mcp_tools.cpp](src/app_mcp_tools.cpp), [app_mcp_ui.cpp](src/app_mcp_ui.cpp), [app_mcp_controls.cpp](src/app_mcp_controls.cpp), [app_mcp_faces.cpp](src/app_mcp_faces.cpp), [app_tutorial.cpp](src/app_tutorial.cpp) | `/test:*agent*`, `/test:*tool call*`, `python tools/test_mcp_session.py exe/diffractor64-d.exe`, `python tools/sweep_mcp.py exe/diffractor64.exe` |
| Movie mixer: the timeline, project files, rendering, YouTube Shorts, checking and rendering without the window | [movie](docs/movie.md) | [model_movie.cpp](src/model_movie.cpp), [view_movie.cpp](src/view_movie.cpp), [view_movie_audio.cpp](src/view_movie_audio.cpp), [app_movie_batch.cpp](src/app_movie_batch.cpp), [av_movie_writer.cpp](src/av_movie_writer.cpp) | `/test:*movie*`, `/test:*YouTube*` |
| An agent session over MCP, its tools, `-tool:`, screenshots, recording and tutorial scripts | [agents](docs/agents.md) | [app_mcp.cpp](src/app_mcp.cpp), [app_mcp_tools.cpp](src/app_mcp_tools.cpp), [app_mcp_ui.cpp](src/app_mcp_ui.cpp), [app_mcp_faces.cpp](src/app_mcp_faces.cpp), [app_tutorial.cpp](src/app_tutorial.cpp), [app_record.cpp](src/app_record.cpp) | `/test:*agent*`, `/test:*shows work*`, `/test:*recording*`, `python tools/test_mcp_session.py exe/diffractor64-d.exe`, `python tools/sweep_mcp.py exe/diffractor64.exe` |
| Faces: names read from and written into face regions, face search's scan of pictures and videos' key frames, the store and its comparisons, the face book and its database, people and groups, face terms, the Faces view, and faces on a picture or video | [faces](docs/faces.md) | [model_faces.cpp](src/model_faces.cpp), [model_faces_search.cpp](src/model_faces_search.cpp), [model_faces_book.cpp](src/model_faces_book.cpp), [model_db_faces.cpp](src/model_db_faces.cpp), [model_faces_groups.cpp](src/model_faces_groups.cpp), [view_faces.cpp](src/view_faces.cpp), [view_faces_actions.cpp](src/view_faces_actions.cpp), [ui_elements.cpp](src/ui_elements.cpp)'s `picture_faces`, [av_format.cpp](src/av_format.cpp)'s `read_key_frame` and `av_decode_key_frame`, [metadata.cpp](src/metadata.cpp)'s `apply_face_names` | `/test:*face*`, `python tools/test_mcp_session.py exe/diffractor64-d.exe` (its faces sessions) |
| A crash report, dump, or symbolization | [crash investigation](docs/crash.md) | [app.cpp](src/app.cpp)'s `app_frame::crash`, libdesktop's [process.cpp](https://github.com/ZacWalk/libdesktop/blob/main/src/platform/win/process.cpp), [util_crash_files_db.h](src/util_crash_files_db.h) | see [crash](docs/crash.md) |
| Where a test belongs, or why the suite is arranged this way | [testing](docs/testing.md) | `src/test_*.cpp` | `.\dd.ps1 test` |
Expand All @@ -43,10 +43,11 @@ open the listed source, and run the listed check. Do not read unrelated document

## Information ownership

GitHub issues and releases own work, status, discussion, follow-up, and release history. Source owns exact APIs, enums, and file lists. Every other subject has exactly one owning document:
GitHub issues and releases own work, status, discussion, follow-up, and release history, apart from the next release's plan, which its own document tracks until that release ships. Source owns exact APIs, enums, and file lists. Every other subject has exactly one owning document:

| Document | Owns |
|---|---|
| [mission](docs/mission.md) | Why Diffractor exists: whom it serves, the experience it promises them, what it will not become, and the order of the bets that follow |
| [design](docs/design.md) | Durable user concepts and behavior: the user mental model, targeting and command availability, and view, mode, and presentation naming |
| [implementation](docs/implementation.md) | Architecture and source organization, data flow, threading, ownership, invalidation, index/search internals |
| [crash investigation](docs/crash.md) | Crash report contents, symbol store and debugger setup, dump symbolization, attributing a fault to a cause |
Expand All @@ -63,6 +64,7 @@ GitHub issues and releases own work, status, discussion, follow-up, and release
| [faces](docs/faces.md) | Faces: the people files name, face search - finding, embedding and comparing faces - the face book of what the user says of them, people and groups, the Faces view, and saving names to files |
| [third-party](docs/third-party.md) | Fetched dependencies and their pins, the outbound licence they constrain, the upgrade procedure, and the integration constraints an upgrade must keep |
| [Linux port](docs/linux.md) | Current Linux support, the platform boundary, unsupported surfaces, and build behavior |
| [next release](docs/v-1.27.5.md) | The plan for 1.27.5 until it ships: the changes in the tree, the planned work, the release tasks, and how the release is verified |
| [README](README.md) | Product overview, build prerequisites, command line, and the licence Diffractor is released under |

Move information to its owner; link rather than duplicate volatile detail. `tools/lint_repo.ps1` fails when a document has no owner row, when a link does not resolve, or when a `src/` path a document names no longer exists.
Expand All @@ -82,7 +84,7 @@ Diffractor's `df::` and `str::` are its own types. Four sibling libraries supply

- **libdesktop** ([DiffractorLibdesktop.cmake](cmake/DiffractorLibdesktop.cmake)): the `core::` vocabulary in `libdesktop/core.h`; OS services and the application loop in `platform::`/`libdesktop/platform.h`; drawing backends and counters in `render::`/`libdesktop/render.h`; frames, controls, menus and text views in `ui::`/`libdesktop/ui.h`, with headless fakes in `libdesktop/ui/test_support.h` and syntax highlighters in `libdesktop/ui/syntax.h`.
- **libfiles** ([DiffractorLibfiles.cmake](cmake/DiffractorLibfiles.cmake)): scanning, decoding and encoding stills, scanning audio and video containers, and reading and writing EXIF, IPTC and XMP. `files.cpp` and `metadata.cpp` are Diffractor's side of it.
- **lib64** ([DiffractorLib64.cmake](cmake/DiffractorLib64.cmake)): the Commodore 64 emulator. It plays SID tunes, through `av_sid.cpp`, and runs a disk's, tape's, cartridge's or program file's program in the media pane, through `av_c64.cpp`.
- **lib64** ([DiffractorLib64.cmake](cmake/DiffractorLib64.cmake)): the Commodore 64 emulator and its media, through `lib64/*.h`. It plays SID tunes, through `av_sid.cpp`; lists what a disk, tape, cartridge or program file holds, through `files.cpp` and `ui_c64.cpp`; and runs its program in the media pane, through `av_c64.cpp`.
- **libmug** ([DiffractorLibmug.cmake](cmake/DiffractorLibmug.cmake)): face detection and recognition, on libfiles' Highway. `model_faces.cpp` is Diffractor's side of it, and `model_faces_search.cpp` runs it over the collection.

A sibling checkout at `..\libdesktop`, `..\libfiles`, `..\lib64` or `..\libmug` is built instead of the pin whenever it exists, so a local edit there reaches this build at once while isolated CI builds the pin. A change to one of them is made in that repository, under its own AGENTS.md. Before release, follow the [pinned build check](docs/third-party.md#upgrade-procedure): a green sibling build does not validate a release pin.
Expand All @@ -96,7 +98,7 @@ Four recurring workflows are `.github/prompts/` slash commands rather than proce
- Build and validate with `.\dd.ps1 test --label headless`: it runs `tools/lint_repo.ps1`, the release-tool and headless command-line checks, rebuilds `exe\diffractor64.exe` (Release) when a source file under `src/` is newer than it, then runs the unit tests, both translation validators and the MCP session test. It does not look at the sibling libraries, so after editing one, build first with `python tools\dd.py build --config Release`.
- Build with `tools/dd.py`: `python tools\dd.py build` for Debug (`exe\diffractor64-d.exe`), `--config Release` for Release. `.\dd.ps1 build` also bumps the build number in `src/app.cpp`, `installer/diff.nsi` and `exe/AppxManifest.xml`; use it only to cut a build. CMake is the only description of the build on both platforms. App source belongs in `src/`; temporary output belongs in `tmp/`.
- Style: C and C++ follow the repository's `.clang-format` (tabs, Allman braces, 120 columns); `.\dd.ps1` has no format command, so run the `clang-format` Visual Studio installs in `VC\Tools\Llvm\x64\bin`. `.clang-format-ignore` lists the generated files it skips, and hand-aligned tables sit between `// clang-format off` and `// clang-format on`. Diffractor's own code builds without a warning at `/W4` and at GCC's `-Wall`, in Debug and Release - fix a warning rather than suppress it - while vendored targets build at `/W0` (`-w`). `.clang-tidy` holds the static-analysis checks; where a finding is wrong, a `// NOLINTNEXTLINE(check)` says why.
- System, OS, Windows API, and other platform-specific implementation code MUST exist only in `platform*.*` files or in libdesktop; the one exception is the entry points, `wWinMain` and `main`, in `app.cpp`. Other modules use platform abstractions.
- System, OS, Windows API, and other platform-specific implementation code MUST exist only in `platform*.*` files or in libdesktop. Other modules use platform abstractions; the entry point, `main` in `app.cpp`, is the same on every platform.
- Keep `// Purpose:` comments accurate in modified `src/*.h` and `src/*.cpp` files.
- Preserve [product design](docs/design.md), especially targeting, recovery, navigation restoration, and preview-before-run.

Expand Down
28 changes: 28 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cff-version: 1.2.0
title: "Diffractor"
message: "If you use this software, please cite it using the metadata from this file."
type: software
authors:
- given-names: "Zac"
family-names: "Walker"
alias: "ZacWalk"
website: "https://github.com/ZacWalk"
repository-code: "https://github.com/ZacWalk/diffractor"
url: "https://diffractor.com/"
abstract: >-
Diffractor is a free, high-performance photo, video and audio organizer for
Windows, optimized for speed and local file control, with no cloud storage or
subscriptions required. It indexes a collection locally for instant metadata
search, reads and writes XMP, IPTC, EXIF and ID3, places photos and videos by
GPS, finds duplicates and faces on the computer itself, edits photos, trims
videos and sound files losslessly, and joins them into movies.
keywords:
- "photo management"
- "media organizer"
- "video"
- "audio"
- "metadata"
- "XMP"
- "EXIF"
- "face recognition"
license: MPL-2.0
Loading
Loading