Merge branch 'fix/wireplumber-11'

This commit is contained in:
kotontrion
2024-09-18 20:31:22 +02:00
12 changed files with 82 additions and 22 deletions

View File

@@ -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")} />

View File

@@ -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",

View File

@@ -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())

View File

@@ -1,4 +1,17 @@
astal_auth_inc = include_directories('.')
astal_auth_headers = files('astal-auth.h')
install_headers('astal-auth.h')
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 = config
install_headers(astal_auth_headers)

View File

@@ -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())

View File

@@ -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)

View File

@@ -1,4 +0,0 @@
#include "astal/wireplumber/audio.h"
#include "astal/wireplumber/endpoint.h"
#include "astal/wireplumber/wp.h"

View File

@@ -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

View File

@@ -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);

View File

@@ -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')

View File

@@ -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"

View File

@@ -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);