Crate pipewire_wrapper

source ·
Expand description

Docs Build

Overview

The crate structure is close to the PipeWire API structure, so PipeWire Documentation can be used to clarify some aspects of the bindings.

Examples

use pipewire_wrapper::core_api::main_loop::MainLoop;
use std::time::Duration;
let main_loop = MainLoop::default();

let callback = |_expirations| {
    main_loop.quit().unwrap();
};
let timer = main_loop.get_loop().add_timer(Box::new(callback)).unwrap();
main_loop
    .get_loop()
    .update_timer(&timer, Duration::from_secs(1), Duration::ZERO, false)
    .unwrap();
main_loop.run().unwrap();

More examples can be found in examples folder.

Modules

Macros

Constants

Type Definitions

  • Result type used in the library

Attribute Macros

  • Implement SpaInterface and Proxied traits.
  • Add an *Info and *Builder structures after the enum definition. For each enum variant will be added optional struct fields with value and flags.
  • Implement Wrapper trait for structure with the ref_: Proxy<'c> field. Macros parameter will be used as target type to cast underlying proxy.
  • Implement SpaInterface

Derive Macros

  • Implement RawWrapper trait. #[raw] attribute must be added before field with wrapped raw value.
  • Implement Wrapper trait. #[raw_wrapper] attribute must be added before field with NonNull<impl RawWrapper> pointer to *Ref struct, that implements RawWrapper