Skip to main content

wavyzon_plugin/
lib.rs

1//! # wavyzon-plugin
2//!
3//! The plugin API of [Wavyzon](https://gitlab.com/ihrz/wavyzon), and the data
4//! model every Wavyzon crate shares (tracks, failures, events, streams).
5//!
6//! A plugin implements [`Plugin`] and, in [`Plugin::register`], adds any of:
7//!
8//! | Extension | Trait | Exposed as |
9//! | --- | --- | --- |
10//! | Sources | [`Source`] (+ [`Playable`], [`IsrcLookup`], [`Recommender`]) | `loadtracks` prefixes and links, playback |
11//! | Audio filters | [`FilterFactory`] → [`AudioFilter`] | `filters.pluginFilters.<name>` |
12//! | Event listeners | [`EventListener`] | every player event |
13//! | HTTP routes | [`axum::Router`] | `/v1/plugins/<name>/…` |
14//!
15//! See `docs/src/plugins.md` in the repository for a full guide.
16
17mod event;
18mod failure;
19mod filter;
20mod plugin;
21mod source;
22mod track;
23
24pub use async_trait::async_trait;
25pub use axum;
26pub use serde_json;
27
28pub use event::{EndReason, Event, EventType};
29pub use failure::{Failure, Severity};
30pub use filter::{AudioFilter, CHANNELS, FRAME_SAMPLES, FilterFactory, SAMPLE_RATE};
31pub use plugin::{API_VERSION, EventListener, Plugin, PluginContext, PluginError, PluginManifest, Registry};
32pub use source::{Format, IsrcLookup, Playable, Recommender, Source, Stream};
33pub use track::{LoadResult, LoadType, Playlist, Track};