pipewire: add pipewire client
This commit is contained in:
parent
2512470231
commit
2568b7b1f5
19 changed files with 4573 additions and 2 deletions
48
src/pipewire/pw_ifs/pw_registry.rs
Normal file
48
src/pipewire/pw_ifs/pw_registry.rs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
use {
|
||||
crate::pipewire::{
|
||||
pw_con::PwCon,
|
||||
pw_object::{PwObject, PwObjectData},
|
||||
pw_parser::{PwParser, PwParserError},
|
||||
},
|
||||
std::rc::Rc,
|
||||
thiserror::Error,
|
||||
};
|
||||
|
||||
pub const PW_REGISTRY_VERSION: i32 = 3;
|
||||
|
||||
pw_opcodes! {
|
||||
PwRegistryEvents;
|
||||
|
||||
Global = 0,
|
||||
GlobalRemove = 1,
|
||||
}
|
||||
|
||||
pub struct PwRegistry {
|
||||
pub data: PwObjectData,
|
||||
pub con: Rc<PwCon>,
|
||||
}
|
||||
|
||||
impl PwRegistry {
|
||||
fn handle_global(&self, _p: PwParser<'_>) -> Result<(), PwRegistryError> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_global_remove(&self, _p: PwParser<'_>) -> Result<(), PwRegistryError> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pw_object_base! {
|
||||
PwRegistry, "registry", PwRegistryEvents;
|
||||
|
||||
Global => handle_global,
|
||||
GlobalRemove => handle_global_remove,
|
||||
}
|
||||
|
||||
impl PwObject for PwRegistry {}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum PwRegistryError {
|
||||
#[error(transparent)]
|
||||
PwParserError(#[from] PwParserError),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue