1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
//! WirePlumber's [entry point](Core) and base [Object] type.
//!
//! # PipeWire Main Loop
//!
//! The [Core] is used to initialize the library and connect to an external PipeWire service. The
//! most basic self-contained WirePlumber daemon can be started like so:
//!
//! ```no_run
//! use wireplumber::Core;
//!
//! fn main() {
//! Core::init();
//! Core::run(None, |context, mainloop, core| {
//! context.spawn_local(async move {
//! # #[cfg(feature = "futures")]
//! match core.connect_future().await {
//! Ok(()) => println!("Connected to PipeWire!"),
//! Err(e) => println!("Failed to connect: {e:?}"),
//! }
//! mainloop.quit(); // return from Core::run() and disconnect
//! });
//! });
//! }
//! ```
//!
//! # Subclassing
//!
//! A type can register itself as a [subclass](glib::subclass) of [Object] by
//! implementing the [ObjectImpl] trait.
//!
//! # See also
//!
//! C API docs for:
//!
//! - [Initialization](https://pipewire.pages.freedesktop.org/wireplumber/c_api/wp_api.html)
//! - [Core](https://pipewire.pages.freedesktop.org/wireplumber/c_api/core_api.html)
//! - [Object](https://pipewire.pages.freedesktop.org/wireplumber/c_api/object_api.html)
#[cfg(feature = "v0_4_5")]
pub use crate::auto::Factory;
pub use {
self::{
features::ObjectFeatures,
subclass::{ObjectImpl, ObjectImplExt},
},
crate::auto::{traits::ObjectExt, Core, FeatureActivationTransition, InitFlags, Object},
};
mod core;
mod features;
mod subclass;