Skip to content

Add a draft file-paths extension - #525

Draft
linuxnow wants to merge 1 commit into
free-audio:nextfrom
linuxnow:draft-file-paths
Draft

linuxnow wants to merge 1 commit into
free-audio:nextfrom
linuxnow:draft-file-paths

Conversation

@linuxnow

@linuxnow linuxnow commented Nov 3, 2026 •

Copy link
Copy Markdown

Following up on #523. You asked what the shape would be, so here it is in code.

I work on OpenMixer, a Linux mixing console that hosts CLAP and LV2 plugins without opening their GUIs. The case that started this is simple: someone loads a convolution reverb on a channel and wants to pick a different impulse response from the console. Today that path lives only inside the plugin's state, which the host can't read or change, so the only way is to open the plugin's own window. On a console without a screen for plugin GUIs, there's no way at all.

LV2 has this already: a patch:writable property with range atom:Path, set with patch:Set. A plugin ported or wrapped from LV2 to CLAP loses it today.

This adds clap.file-paths/1. The plugin side has:

  • count() and get_info(), giving each path's id and name;
  • get() and set() for the absolute path;
  • get_display(), a short text for the current value, usually the file name, while the value itself stays the full path.

The host side has changed() when the list changes, and value_changed(id) when the plugin changes a path on its own.

Everything runs on the main thread. These aren't parameters: no range, no automation, no events.

On your questions in #523:

  • Dirty state: a path is part of the plugin's state. After the host calls set(), the host already knows its project changed. When the plugin changes a path itself, it calls value_changed() and mark_dirty().
  • The host never has to supply a value. The plugin keeps its default and its saved value, and the host only reads and sets.
  • Display: that's get_display(), kept separate from the value.

We use this shape in omx-clap-core's LV2 adapter today, as a private call that reaches the plugin as a patch:Set:

I kept it narrow on purpose. There are no free-text values, since #326 settled that strings aren't parameters and I don't have a real case for them without a GUI. There are also no directories, no file-type filters, and nothing about collecting or relinking files, which resource-directory already covers.

The compile tests (src/main.c, src/main.cc) pass as C11, C17 and C++11 to C++20 with -Wall -Wextra -pedantic -Werror.

What I'd like your opinion on:

  • Should get_info() list the file extensions a plugin accepts, so a host can filter its file browser?
  • Should a path be allowed to name a folder, for a folder of samples?
  • Is get_display() worth its own call, or should hosts just show the file name?
  • The name: file-paths, or something closer to LV2's "path properties"?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant