Skip to content

Commit

Permalink
Remove unused metadata flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmedrano committed Sep 14, 2024
1 parent 12f2330 commit 5d57d24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
7 changes: 0 additions & 7 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,3 @@ Default: Yes
Load `libjack` at runtime as opposed to the standard dynamic linking. This is
preferred as it allows `pw-jack` to intercept the loading at runtime to provide
the Pipewire JACK server implementation.

## `metadata`

Default: No

Provides access to the metadata API. This is experimental. Details on the JACK
metadata API can be found at <https://jackaudio.org/metadata/>.
1 change: 0 additions & 1 deletion src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub trait PropertyChangeHandler: Send {
fn property_changed(&mut self, change: &PropertyChange);
}

#[allow(dead_code)] //dead if we haven't enabled metadata
pub(crate) unsafe extern "C" fn property_changed<P>(
subject: j::jack_uuid_t,
key: *const ::libc::c_char,
Expand Down
30 changes: 11 additions & 19 deletions src/tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ fn client_uuid_are_unique() {
assert_ne!(client1.uuid_string(), "");
assert_ne!(client2.uuid_string(), "");
assert_ne!(client1.uuid_string(), client2.uuid_string());
#[cfg(feature = "metadata")]
{
assert_ne!(client1.uuid(), 0);
assert_ne!(client2.uuid(), 0);
assert_ne!(client1.uuid(), client2.uuid());
}
assert_ne!(client1.uuid(), 0);
assert_ne!(client2.uuid(), 0);
assert_ne!(client1.uuid(), client2.uuid());
}

#[test]
Expand All @@ -67,17 +64,14 @@ fn uuid_can_map_to_client_name() {
client1.name_by_uuid_str(&client2.uuid_string()).unwrap(),
"uuid-client-2"
);
#[cfg(feature = "metadata")]
{
assert_eq!(
client1.name_by_uuid(client1.uuid()).unwrap(),
"uuid-client-1"
);
assert_eq!(
client1.name_by_uuid(client2.uuid()).unwrap(),
"uuid-client-2"
);
}
assert_eq!(
client1.name_by_uuid(client1.uuid()).unwrap(),
"uuid-client-1"
);
assert_eq!(
client1.name_by_uuid(client2.uuid()).unwrap(),
"uuid-client-2"
);
}

#[test]
Expand All @@ -86,10 +80,8 @@ fn nonexistant_uuid_to_client_name_returns_none() {
let (client2, _) =
crate::Client::new("dropped-client", crate::ClientOptions::NO_START_SERVER).unwrap();
let uuid_string = client2.uuid_string();
#[cfg(feature = "metadata")]
let uuid = client2.uuid();
drop(client2);
assert_eq!(client1.name_by_uuid_str(&uuid_string), None);
#[cfg(feature = "metadata")]
assert_eq!(client1.name_by_uuid(uuid), None);
}

0 comments on commit 5d57d24

Please sign in to comment.