summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-09-18 20:31:22 +0200
committerkotontrion <[email protected]>2024-09-18 20:31:22 +0200
commit36adb5a19bf0414c7bd3703f4c6244c44fb8e68e (patch)
tree239fd47001dce18dcb7de58c3bafbe407bdf5f19
parentc37823ae42b38bed8aca06f78f3a4cb44eb41d5c (diff)
parent10b9cde328947d038029f2496f43da75138abb3d (diff)
Merge branch 'fix/wireplumber-11'
-rw-r--r--examples/js/simple-bar/widget/Bar.tsx2
-rw-r--r--examples/lua/simple-bar/widget/Bar.lua2
-rw-r--r--lib/auth/include/astal-auth.h.in (renamed from lib/auth/include/astal-auth.h)6
-rw-r--r--lib/auth/include/meson.build17
-rw-r--r--lib/river/include/astal-river.h.in (renamed from lib/river/include/astal-river.h)7
-rw-r--r--lib/river/include/meson.build19
-rw-r--r--lib/wireplumber/include/astal-wp.h4
-rw-r--r--lib/wireplumber/include/astal-wp.h.in14
-rw-r--r--lib/wireplumber/include/astal/wireplumber/wp.h2
-rw-r--r--lib/wireplumber/include/meson.build16
-rw-r--r--lib/wireplumber/src/endpoint.c9
-rw-r--r--lib/wireplumber/src/wireplumber.c4
12 files changed, 81 insertions, 21 deletions
diff --git a/examples/js/simple-bar/widget/Bar.tsx b/examples/js/simple-bar/widget/Bar.tsx
index 492ab1d..19e1133 100644
--- a/examples/js/simple-bar/widget/Bar.tsx
+++ b/examples/js/simple-bar/widget/Bar.tsx
@@ -39,7 +39,7 @@ function Wifi() {
}
function AudioSlider() {
- const speaker = Wp.get_default_wp()?.audio.defaultSpeaker!
+ const speaker = Wp.get_default()?.audio.defaultSpeaker!
return <box className="AudioSlider" css="min-width: 140px">
<icon icon={bind(speaker, "volumeIcon")} />
diff --git a/examples/lua/simple-bar/widget/Bar.lua b/examples/lua/simple-bar/widget/Bar.lua
index bf70cd5..56cb060 100644
--- a/examples/lua/simple-bar/widget/Bar.lua
+++ b/examples/lua/simple-bar/widget/Bar.lua
@@ -72,7 +72,7 @@ local function Wifi()
end
local function AudioSlider()
- local speaker = Wp.get_default_wp().audio.default_speaker
+ local speaker = Wp.get_default().audio.default_speaker
return Widget.Box({
class_name = "AudioSlider",
diff --git a/lib/auth/include/astal-auth.h b/lib/auth/include/astal-auth.h.in
index a3073ff..c8a0ece 100644
--- a/lib/auth/include/astal-auth.h
+++ b/lib/auth/include/astal-auth.h.in
@@ -4,6 +4,12 @@
#include <gio/gio.h>
#include <glib-object.h>
+
+#define ASTAL_AUTH_MAJOR_VERSION @MAJOR_VERSION@
+#define ASTAL_AUTH_MINOR_VERSION @MINOR_VERSION@
+#define ASTAL_AUTH_MICRO_VERSION @MICRO_VERSION@
+#define ASTAL_AUTH_VERSION "@VERSION@"
+
G_BEGIN_DECLS
#define ASTAL_AUTH_TYPE_PAM (astal_auth_pam_get_type())
diff --git a/lib/auth/include/meson.build b/lib/auth/include/meson.build
index 0575998..9c92caf 100644
--- a/lib/auth/include/meson.build
+++ b/lib/auth/include/meson.build
@@ -1,4 +1,17 @@
+
+config = configure_file(
+ input: 'astal-auth.h.in',
+ output: 'astal-auth.h',
+ configuration: {
+ 'VERSION': meson.project_version(),
+ 'MAJOR_VERSION': version_split[0],
+ 'MINOR_VERSION': version_split[1],
+ 'MICRO_VERSION': version_split[2],
+ },
+)
+
+
astal_auth_inc = include_directories('.')
-astal_auth_headers = files('astal-auth.h')
+astal_auth_headers = config
-install_headers('astal-auth.h')
+install_headers(astal_auth_headers)
diff --git a/lib/river/include/astal-river.h b/lib/river/include/astal-river.h.in
index 6bedd94..d2b769c 100644
--- a/lib/river/include/astal-river.h
+++ b/lib/river/include/astal-river.h.in
@@ -3,6 +3,13 @@
#include <glib-object.h>
+
+#define ASTAL_RIVER_MAJOR_VERSION @MAJOR_VERSION@
+#define ASTAL_RIVER_MINOR_VERSION @MINOR_VERSION@
+#define ASTAL_RIVER_MICRO_VERSION @MICRO_VERSION@
+#define ASTAL_RIVER_VERSION "@VERSION@"
+
+
G_BEGIN_DECLS
#define ASTAL_RIVER_TYPE_OUTPUT (astal_river_output_get_type())
diff --git a/lib/river/include/meson.build b/lib/river/include/meson.build
index 4b08a89..d91be23 100644
--- a/lib/river/include/meson.build
+++ b/lib/river/include/meson.build
@@ -1,6 +1,17 @@
-astal_river_inc = include_directories('.')
-astal_river_headers = files(
- 'astal-river.h',
+
+config = configure_file(
+ input: 'astal-river.h.in',
+ output: 'astal-river.h',
+ configuration: {
+ 'VERSION': meson.project_version(),
+ 'MAJOR_VERSION': version_split[0],
+ 'MINOR_VERSION': version_split[1],
+ 'MICRO_VERSION': version_split[2],
+ },
)
-install_headers('astal-river.h')
+
+astal_river_inc = include_directories('.')
+astal_river_headers = config
+
+install_headers(astal_river_headers)
diff --git a/lib/wireplumber/include/astal-wp.h b/lib/wireplumber/include/astal-wp.h
deleted file mode 100644
index 6c48211..0000000
--- a/lib/wireplumber/include/astal-wp.h
+++ /dev/null
@@ -1,4 +0,0 @@
-
-#include "astal/wireplumber/audio.h"
-#include "astal/wireplumber/endpoint.h"
-#include "astal/wireplumber/wp.h"
diff --git a/lib/wireplumber/include/astal-wp.h.in b/lib/wireplumber/include/astal-wp.h.in
new file mode 100644
index 0000000..7d9d997
--- /dev/null
+++ b/lib/wireplumber/include/astal-wp.h.in
@@ -0,0 +1,14 @@
+
+#ifndef WP_H
+#define WP_H
+
+#include "astal/wireplumber/audio.h"
+#include "astal/wireplumber/endpoint.h"
+#include "astal/wireplumber/wp.h"
+
+#define ASTAL_WP_MAJOR_VERSION @MAJOR_VERSION@
+#define ASTAL_WP_MINOR_VERSION @MINOR_VERSION@
+#define ASTAL_WP_MICRO_VERSION @MICRO_VERSION@
+#define ASTAL_WP_VERSION "@VERSION@"
+
+#endif // WP_H
diff --git a/lib/wireplumber/include/astal/wireplumber/wp.h b/lib/wireplumber/include/astal/wireplumber/wp.h
index 1ff341c..8d1ea83 100644
--- a/lib/wireplumber/include/astal/wireplumber/wp.h
+++ b/lib/wireplumber/include/astal/wireplumber/wp.h
@@ -22,7 +22,7 @@ typedef enum {
G_DECLARE_FINAL_TYPE(AstalWpWp, astal_wp_wp, ASTAL_WP, WP, GObject)
AstalWpWp* astal_wp_wp_get_default();
-AstalWpWp* astal_wp_get_default_wp();
+AstalWpWp* astal_wp_get_default();
AstalWpAudio* astal_wp_wp_get_audio(AstalWpWp* self);
AstalWpVideo* astal_wp_wp_get_video(AstalWpWp* self);
diff --git a/lib/wireplumber/include/meson.build b/lib/wireplumber/include/meson.build
index afe00eb..cae0d6e 100644
--- a/lib/wireplumber/include/meson.build
+++ b/lib/wireplumber/include/meson.build
@@ -1,8 +1,18 @@
-astal_wireplumber_inc = include_directories('.', 'astal/wireplumber', 'private')
-astal_wireplumber_headers = files(
- 'astal-wp.h',
+
+config = configure_file(
+ input: 'astal-wp.h.in',
+ output: 'astal-wp.h',
+ configuration: {
+ 'VERSION': meson.project_version(),
+ 'MAJOR_VERSION': version_split[0],
+ 'MINOR_VERSION': version_split[1],
+ 'MICRO_VERSION': version_split[2],
+ },
)
+astal_wireplumber_inc = include_directories('.', 'astal/wireplumber', 'private')
+astal_wireplumber_headers = config
+
install_headers(astal_wireplumber_headers)
subdir('astal/wireplumber')
diff --git a/lib/wireplumber/src/endpoint.c b/lib/wireplumber/src/endpoint.c
index 8d5411d..9ae62e2 100644
--- a/lib/wireplumber/src/endpoint.c
+++ b/lib/wireplumber/src/endpoint.c
@@ -345,6 +345,7 @@ static void astal_wp_endpoint_set_property(GObject *object, guint property_id, c
}
static void astal_wp_endpoint_update_properties(AstalWpEndpoint *self) {
+
AstalWpEndpointPrivate *priv = astal_wp_endpoint_get_instance_private(self);
if (priv->node == NULL) return;
self->id = wp_proxy_get_bound_id(WP_PROXY(priv->node));
@@ -379,9 +380,11 @@ static void astal_wp_endpoint_update_properties(AstalWpEndpoint *self) {
case ASTAL_WP_MEDIA_CLASS_AUDIO_MICROPHONE:
const gchar *dev =
wp_pipewire_object_get_property(WP_PIPEWIRE_OBJECT(priv->node), "device.id");
- guint device_id = g_ascii_strtoull(dev, NULL, 10);
- AstalWpDevice *device = astal_wp_wp_get_device(priv->wp, device_id);
- icon = astal_wp_device_get_icon(device);
+ if (dev != NULL) {
+ guint device_id = g_ascii_strtoull(dev, NULL, 10);
+ AstalWpDevice *device = astal_wp_wp_get_device(priv->wp, device_id);
+ icon = astal_wp_device_get_icon(device);
+ }
if (icon == NULL) {
icon = self->type == ASTAL_WP_MEDIA_CLASS_AUDIO_SPEAKER
? "audio-card-symbolic"
diff --git a/lib/wireplumber/src/wireplumber.c b/lib/wireplumber/src/wireplumber.c
index cc3aa82..6babed1 100644
--- a/lib/wireplumber/src/wireplumber.c
+++ b/lib/wireplumber/src/wireplumber.c
@@ -352,13 +352,13 @@ AstalWpWp *astal_wp_wp_get_default() {
}
/**
- * astal_wp_get_default_wp
+ * astal_wp_get_default
*
* gets the default wireplumber object.
*
* Returns: (nullable) (transfer none): gets the default wireplumber object.
*/
-AstalWpWp *astal_wp_get_default_wp() { return astal_wp_wp_get_default(); }
+AstalWpWp *astal_wp_get_default() { return astal_wp_wp_get_default(); }
static void astal_wp_wp_dispose(GObject *object) {
AstalWpWp *self = ASTAL_WP_WP(object);