Skip to content

Commit

Permalink
Construct tuple variant directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
saivert committed May 11, 2024
1 parent f0863ad commit 6d53463
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/backend/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use gtk::{
subclass::prelude::*,
};
use once_cell::unsync::OnceCell;
use std::{cell::RefCell, str::FromStr};
use std::cell::RefCell;
use wireplumber as wp;
use wp::{
plugin::{PluginFeatures, *},
Expand All @@ -21,7 +21,6 @@ use wp::{
};

mod imp {

use super::*;

#[derive(Properties)]
Expand Down Expand Up @@ -143,8 +142,8 @@ mod imp {

wp_om.add_interest({
let interest = wp::registry::ObjectInterest::new(wp::pw::Node::static_type());
let variant =
glib::Variant::from_str("('Stream/Output/Audio', 'Stream/Input/Audio', 'Audio/Source', 'Audio/Sink')").expect("variant");
let variant = glib::Variant::tuple_from_iter(["Stream/Output/Audio", "Stream/Input/Audio", "Audio/Source", "Audio/Sink"].map(ToVariant::to_variant));

interest.add_constraint(
wp::registry::ConstraintType::PwGlobalProperty,
"media.class",
Expand Down

0 comments on commit 6d53463

Please sign in to comment.