dev-sound: Only set media role when role based routing is enabled

This allows to already update the theme without breaking existing installations.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2025-10-24 13:43:39 +02:00
parent 96b00b6c61
commit 8090ccb0a9
2 changed files with 11 additions and 1 deletions
+6 -1
View File
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2020 Purism SPC
* 2025 Phosh.mobi e.V.
* SPDX-License-Identifier: GPL-3.0+
* Author: Guido Günther <agx@sigxcpu.org>
*
@@ -9,6 +10,8 @@
#define G_LOG_DOMAIN "fbd-dev-sound"
#include "fbd-config.h"
#include "fbd-dev-sound.h"
#include "fbd-feedback-sound.h"
@@ -205,7 +208,7 @@ fbd_dev_sound_play (FbdDevSound *self,
{
FbdAsyncData *data;
const char *filename;
const char *role;
const char *role = NULL;
g_return_val_if_fail (FBD_IS_DEV_SOUND (self), FALSE);
g_return_val_if_fail (GSOUND_IS_CONTEXT (self->ctx), FALSE);
@@ -215,7 +218,9 @@ fbd_dev_sound_play (FbdDevSound *self,
if (!g_hash_table_insert (self->playbacks, feedback, data))
g_warning ("Feedback %p already present", feedback);
#ifdef FBD_USE_MEDIA_ROLES
role = fbd_feedback_sound_get_media_role (feedback);
#endif
if (!role)
role = "event";
+5
View File
@@ -1,6 +1,11 @@
# Feedback daemon
if get_option('daemon')
config_h = configuration_data()
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
config_h.set('FBD_USE_MEDIA_ROLES', get_option('media-roles'))
configure_file(output: 'fbd-config.h', configuration: config_h)
fbd_enum_headers = files('fbd-event.h', 'fbd-feedback-led.h', 'fbd-feedback-vibra.h')
fbd_enum_sources = gnome.mkenums_simple('fbd-enums', sources: fbd_enum_headers)