From 407b686e8ccc2cb01eedc0c07d9596baa44a531e Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 20 Apr 2024 15:45:21 +0900 Subject: [PATCH 1/2] fix: make sure to match Audio class too --- src/Manager/DeviceManager.vala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Manager/DeviceManager.vala b/src/Manager/DeviceManager.vala index f3a0e28c..a6b972e7 100644 --- a/src/Manager/DeviceManager.vala +++ b/src/Manager/DeviceManager.vala @@ -23,6 +23,8 @@ public class Manager.DeviceManager : Object { return _instance; } + private const string CLASS_NAME_SOURCE = "Source/Audio"; + private const string CLASS_NAME_SINK = "Sink/Audio"; private Gst.DeviceMonitor monitor; private DeviceManager () { @@ -42,8 +44,8 @@ public class Manager.DeviceManager : Object { }); var caps = new Gst.Caps.empty_simple ("audio/x-raw"); - monitor.add_filter ("Source/Audio", caps); - monitor.add_filter ("Sink/Audio", caps); + monitor.add_filter (CLASS_NAME_SOURCE, caps); + monitor.add_filter (CLASS_NAME_SINK, caps); sources = new Gee.ArrayList (); sinks = new Gee.ArrayList (); @@ -76,7 +78,7 @@ public class Manager.DeviceManager : Object { continue; } - if (device.has_classes ("Source")) { + if (device.has_classes (CLASS_NAME_SOURCE)) { if (sources.contains (device)) { continue; } @@ -90,7 +92,7 @@ public class Manager.DeviceManager : Object { } } - if (device.has_classes ("Sink")) { + if (device.has_classes (CLASS_NAME_SOURCE)) { if (sinks.contains (device)) { continue; } From 7b43ff38375317de04ef92164aa7ca495d1e0847 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Sat, 20 Apr 2024 15:49:36 +0900 Subject: [PATCH 2/2] Fix typo --- src/Manager/DeviceManager.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager/DeviceManager.vala b/src/Manager/DeviceManager.vala index a6b972e7..958d274c 100644 --- a/src/Manager/DeviceManager.vala +++ b/src/Manager/DeviceManager.vala @@ -92,7 +92,7 @@ public class Manager.DeviceManager : Object { } } - if (device.has_classes (CLASS_NAME_SOURCE)) { + if (device.has_classes (CLASS_NAME_SINK)) { if (sinks.contains (device)) { continue; }