Skip to content

Commit

Permalink
wip: AudioObject for Sink
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Apr 1, 2024
1 parent b632092 commit 1b9e1cd
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "re_set-lib"
version = "3.1.8"
version = "3.1.9"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
34 changes: 34 additions & 0 deletions src/audio/audio_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,40 @@ impl From<&SinkInfo<'_>> for Sink {
}
}

impl AudioObject for Sink {
fn alias(&self) -> String {
self.alias.clone()
}

fn name(&self) -> String {
self.name.clone()
}

fn volume(&self) -> Vec<u32> {
self.volume.clone()
}

fn index(&self) -> u32 {
self.index
}

fn channels(&self) -> u16 {
self.channels
}

fn muted(&self) -> bool {
self.muted
}

fn toggle_muted(&mut self) {
self.muted = !self.muted;
}

fn active(&self) -> i32 {
self.active
}
}

#[derive(Debug, Clone, Default)]
pub struct InputStream {
pub index: u32,
Expand Down

0 comments on commit 1b9e1cd

Please sign in to comment.