@guquan-2002/pi-foobar
v1.0.1
Published
foobar2000 tools for Pi
Readme
Pi Foobar Extension
English
This is a native Pi extension with no third-party runtime dependencies. It connects Pi to foobar2000 through the Beefweb 0.10 API and provides the foobar_status, foobar_playlists, foobar_play, foobar_pause, foobar_next, foobar_previous, and foobar_volume tools.
Install it from npm:
pi install npm:@guquan-2002/pi-foobarThe foobar2000 side requires the Beefweb plugin. Download foo_beefweb-*.fb2k-component from the Beefweb releases and open it with foobar2000, or install it from Preferences → Components. This extension targets the Beefweb 0.10 API.
After Beefweb is installed and enabled, the extension connects by default to:
http://localhost:8880/apiThe configuration file is created automatically at:
~/.config/pi-foobar/config.jsonIts default contents are:
{
"baseUrl": "http://localhost:8880/api"
}Change baseUrl when Beefweb is available at another address. For example, Pi running inside WSL may need the Windows host address instead of localhost. The extension reads the configuration before every request, so configuration changes take effect without restarting Pi.
foobar_status reports whether playback is playing, paused, or stopped and returns the active track, playback position, duration, and volume. foobar_playlists lists playlists and can return tracks from a selected playlist. The remaining tools control playback, track navigation, and volume.
Playback and volume tools execute immediately without an interactive confirmation prompt. Beefweb must be reachable from the environment where Pi is running.
中文
这是一个不依赖第三方运行时包的原生 Pi 扩展。它通过 Beefweb 0.10 API 将 Pi 连接到 foobar2000,并提供 foobar_status、foobar_playlists、foobar_play、foobar_pause、foobar_next、foobar_previous 和 foobar_volume 工具。
通过 npm 安装:
pi install npm:@guquan-2002/pi-foobarfoobar2000 端需要安装 Beefweb 插件。请从 Beefweb Releases 下载 foo_beefweb-*.fb2k-component,然后使用 foobar2000 打开该文件,或在 Preferences → Components 中安装。本扩展使用 Beefweb 0.10 API。
安装并启用 Beefweb 后,扩展默认连接地址为:
http://localhost:8880/api配置文件会自动创建在:
~/.config/pi-foobar/config.json默认内容为:
{
"baseUrl": "http://localhost:8880/api"
}如果 Beefweb 位于其他地址,请修改 baseUrl。例如,Pi 在 WSL 中运行时,可能需要使用 Windows 主机地址而不是 localhost。扩展会在每次请求前重新读取配置,因此修改配置后无需重启 Pi。
foobar_status 会返回正在播放、暂停或停止状态,以及当前歌曲、播放进度、时长和音量。foobar_playlists 可以列出播放列表并读取指定列表中的歌曲。其余工具用于控制播放、切换歌曲和调整音量。
播放和音量工具会立即执行,不会显示交互确认提示。Beefweb 必须能从运行 Pi 的环境中访问。
