Skip to content

Commit

Permalink
Simplify channel name lookup.
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed Jun 26, 2024
1 parent 4662740 commit e446b3d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/backend/pwchannelobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ impl PwChannelObject {
let t_audiochannel =
wp::spa::SpaIdTable::from_name("Spa:Enum:AudioChannel").expect("audio channel type");
let channel = node_object.format().unwrap().positions[index as usize];
let channelname = t_audiochannel
.values()
.into_iter()
.find(|x| x.number() == channel)
.and_then(|x| x.short_name())
.unwrap();

let channelname = t_audiochannel.find_value(channel).expect("channel short name").short_name();

glib::Object::builder()
.property("index", index)
Expand Down

0 comments on commit e446b3d

Please sign in to comment.