Skip to content

Commit

Permalink
Merge pull request #88 from carlgreen/set_volume_range
Browse files Browse the repository at this point in the history
add set_playback_volume_range and set_capture_volume_range to Selem
  • Loading branch information
diwic committed Oct 18, 2022
2 parents 638dce0 + e909b44 commit 5c11d29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mixer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ impl<'a> Selem<'a> {
acheck!(snd_mixer_selem_set_playback_volume(self.handle, channel as i32, value as c_long)).map(|_| ())
}

pub fn set_playback_volume_range(&self, min: i64, max: i64) -> Result<()> {
acheck!(snd_mixer_selem_set_playback_volume_range(self.handle, min as c_long, max as c_long)).map(|_| ())
}

pub fn set_playback_volume_all(&self, value: i64) -> Result<()> {
acheck!(snd_mixer_selem_set_playback_volume_all(self.handle, value as c_long)).map(|_| ())
}
Expand All @@ -371,6 +375,10 @@ impl<'a> Selem<'a> {
acheck!(snd_mixer_selem_set_capture_volume(self.handle, channel as i32, value as c_long)).map(|_| ())
}

pub fn set_capture_volume_range(&self, min: i64, max: i64) -> Result<()> {
acheck!(snd_mixer_selem_set_capture_volume_range(self.handle, min as c_long, max as c_long)).map(|_| ())
}

pub fn set_playback_switch(&self, channel: SelemChannelId, value: i32) -> Result<()> {
acheck!(snd_mixer_selem_set_playback_switch(self.handle, channel as i32, value)).map(|_| ())
}
Expand Down

0 comments on commit 5c11d29

Please sign in to comment.