sound: Make sort_profiles public
And rename it to gvc_mixer_card_profile_compare() https://bugzilla.gnome.org/show_bug.cgi?id=674831
This commit is contained in:
parent
e5e7080e4e
commit
e32a02e2dd
2 changed files with 13 additions and 5 deletions
|
@ -290,9 +290,15 @@ gvc_mixer_card_get_ports (GvcMixerCard *card)
|
||||||
return card->priv->ports;
|
return card->priv->ports;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
/**
|
||||||
sort_profiles (GvcMixerCardProfile *a,
|
* gvc_mixer_card_profile_compare:
|
||||||
GvcMixerCardProfile *b)
|
*
|
||||||
|
* Return value: 1 if @a has a higher priority, -1 if @b has a higher
|
||||||
|
* priority, 0 if @a and @b have the same priority.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
gvc_mixer_card_profile_compare (GvcMixerCardProfile *a,
|
||||||
|
GvcMixerCardProfile *b)
|
||||||
{
|
{
|
||||||
if (a->priority == b->priority)
|
if (a->priority == b->priority)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -301,7 +307,6 @@ sort_profiles (GvcMixerCardProfile *a,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gvc_mixer_card_set_profiles:
|
* gvc_mixer_card_set_profiles:
|
||||||
* @profiles: (transfer full) (element-type GvcMixerCardProfile):
|
* @profiles: (transfer full) (element-type GvcMixerCardProfile):
|
||||||
|
@ -313,7 +318,7 @@ gvc_mixer_card_set_profiles (GvcMixerCard *card,
|
||||||
g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
|
g_return_val_if_fail (GVC_IS_MIXER_CARD (card), FALSE);
|
||||||
g_return_val_if_fail (card->priv->profiles == NULL, FALSE);
|
g_return_val_if_fail (card->priv->profiles == NULL, FALSE);
|
||||||
|
|
||||||
card->priv->profiles = g_list_sort (profiles, (GCompareFunc) sort_profiles);
|
card->priv->profiles = g_list_sort (profiles, (GCompareFunc) gvc_mixer_card_profile_compare);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,9 @@ gboolean gvc_mixer_card_change_profile (GvcMixerCard *card,
|
||||||
const char *profile);
|
const char *profile);
|
||||||
GIcon * gvc_mixer_card_get_gicon (GvcMixerCard *card);
|
GIcon * gvc_mixer_card_get_gicon (GvcMixerCard *card);
|
||||||
|
|
||||||
|
int gvc_mixer_card_profile_compare (GvcMixerCardProfile *a,
|
||||||
|
GvcMixerCardProfile *b);
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
gboolean gvc_mixer_card_set_name (GvcMixerCard *card,
|
gboolean gvc_mixer_card_set_name (GvcMixerCard *card,
|
||||||
const char *name);
|
const char *name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue