Skip to main content

plughost_core/
lib.rs

1//! Shared types and offline render rules for plughost.
2//!
3//! See the [integration guide](https://github.com/emulette/plughost/blob/v0.2.6/llms.txt)
4//! for end-to-end processing, routing, scanning, and recovery contracts.
5
6#![warn(missing_docs)]
7
8mod audio;
9mod capabilities;
10pub use audio::{
11    AudioBusConfig, AudioBusInfo, AudioBusRole, AudioConfig, AudioConfiguration, AudioDirection,
12    AudioInputRoute, AudioSource, BypassState, ChannelAdaptation, MAX_ALIGNMENT_BYTES,
13    MAX_AUDIO_BUSES, MAX_AUDIO_CHANNELS, RoutedChainConfig, SlotAudioConfig,
14};
15mod config;
16mod diagnostics;
17mod errors;
18mod event;
19mod event_routing;
20mod host;
21#[doc(hidden)]
22pub mod ipc;
23mod parameter;
24mod programs;
25pub use programs::{FactoryPreset, FactoryPresetId, MAX_FACTORY_PRESETS};
26mod parameter_events;
27mod plugin;
28pub mod remote;
29pub mod render;
30mod sample;
31mod state;
32mod transport;
33
34pub use capabilities::{Capabilities, CapabilityReport, Support};
35pub use config::{Layout, ProcessConfig, ProcessMode, SampleFormat};
36pub use diagnostics::{
37    DIAGNOSTIC_CAPACITY, DIAGNOSTIC_MESSAGE_BYTES, Diagnostic, DiagnosticBatch, DiagnosticSeverity,
38};
39pub use errors::{Failure, FailureKind, InputError, RenderError};
40
41/// Diagnostic messages shared by the plughost crates. Internal to plughost, plughost-formats, and
42/// plughost-helper; exempt from semver.
43#[doc(hidden)]
44pub mod messages {
45    pub use crate::errors::{
46        AUDIT, CHAIN_NOT_PREPARED, MAIN_BUS, OUTPUT_EVENT_CAPACITY, STATE_MISMATCH,
47        UNCONVERTIBLE_OUTPUT_EVENTS, UNKNOWN_EVENT_PORT,
48    };
49}
50/// The processing path's real-time audit. Internal to plughost-formats and plughost-helper;
51/// exempt from semver.
52#[doc(hidden)]
53pub mod audit;
54/// Buffers and checks the plughost crates share. Internal to plughost, plughost-formats, and
55/// plughost-helper; exempt from semver.
56#[doc(hidden)]
57pub mod internal {
58    pub use crate::changes::ChangeBuffer;
59    pub use crate::diagnostics::DiagnosticBuffer;
60    pub use crate::event::{events_fit, validate_event_budget};
61    pub use crate::parameter::{
62        changes_fit, validate_choice_page, validate_normalized, validate_parameter_text,
63    };
64    pub use crate::parameter_events::ParameterEventBuffer;
65    pub use crate::sample::{Level, level};
66}
67pub use event::{
68    Event, EventData, Events, ExpressionKind, Iter as EventsIter, MAX_BLOCK_EVENTS,
69    MAX_BLOCK_SYSEX_BYTES, MAX_NOTE_ID, Message, Note, NoteExpression,
70};
71pub use event_routing::{
72    EventConfig, EventInputRoute, EventPortInfo, EventSource, MAX_EVENT_PORTS, SlotEventConfig,
73};
74pub use host::HostIdentity;
75pub use parameter::{
76    AutomationEvent, PARAMETER_TEXT_BYTES, ParameterChange, ParameterFlags, ParameterInfo,
77};
78pub use parameter_events::{PARAMETER_EVENT_CAPACITY, ParameterEvent, ParameterEventBatch};
79pub use plugin::{ClassId, PluginFormat, PluginId, PluginInfo, PluginKind, PluginRef};
80pub use sample::Sample;
81pub use state::{MAX_STATE_BYTES, PluginState};
82pub use transport::{BarPosition, BlockContext, LoopRegion, TimeSignature, Transport};
83
84mod changes;
85pub use changes::{CHANGE_CAPACITY, ChangeBatch, PluginTiming, SlotChange};
86
87pub use state::{MAX_PRESET_BYTES, PresetInfo, PresetMetadata, StatePurpose};
88
89pub use parameter::{
90    PARAMETER_CHOICE_PAGE_SIZE, ParameterChoice, ParameterChoicePage, ParameterDetails,
91    ParameterGroup,
92};
93
94mod preset_discovery;
95pub use preset_discovery::{
96    DiscoveredPreset, PRESET_DISCOVERY_TEXT_BYTES, PresetDiscovery, PresetDiscoveryTarget,
97    PresetFileFailure, PresetFileType, PresetFlags, PresetLocation, PresetLocationInfo,
98    PresetPluginId, PresetProviderInfo, PresetSoundpack,
99};