libgnome-volume-control/gvc-mixer-card-private.h
Jonas Dreßler 10a3c0a766 mixer-control: Support adding and removing card-ports after card was added
With pipewire, card ports are added or removed after the card is visible to us.
This is intended from the pipewire side, as audio routing is dynamic and can
change at any time.

This is the case for Bluetooth devices, where there are multiple ports for
the different profiles available. In case a profile becomes available or
goes unavailable (likely this can happen on connection issues on the Bluetooth
link), the ports will change.

Support this scenario by updating the ports list on card changes, adding new
ports (and creating new respective ui-devices) and removing ports (and removing
the respective ui-devices).

Now that we can add ports after creating the card, this likely means we can
remove handling for portless cards. At least Bluetooth devices nowadays have
ports, but they get them later.
2024-03-12 14:38:27 +01:00

42 lines
1.5 KiB
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008-2009 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifndef __GVC_MIXER_CARD_PRIVATE_H
#define __GVC_MIXER_CARD_PRIVATE_H
#include <pulse/pulseaudio.h>
#include "gvc-mixer-card.h"
G_BEGIN_DECLS
GvcMixerCard * gvc_mixer_card_new (pa_context *context,
guint index);
pa_context * gvc_mixer_card_get_pa_context (GvcMixerCard *card);
void gvc_mixer_card_add_port (GvcMixerCard *card,
GvcMixerCardPort *port);
void gvc_mixer_card_remove_port (GvcMixerCard *card,
GvcMixerCardPort *port);
G_END_DECLS
#endif /* __GVC_MIXER_CARD_PRIVATE_H */