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:
Conor Curran 2012-07-11 12:49:20 +01:00 committed by Bastien Nocera
parent e5e7080e4e
commit e32a02e2dd
2 changed files with 13 additions and 5 deletions

View file

@ -290,8 +290,14 @@ gvc_mixer_card_get_ports (GvcMixerCard *card)
return card->priv->ports;
}
static int
sort_profiles (GvcMixerCardProfile *a,
/**
* gvc_mixer_card_profile_compare:
*
* 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)
@ -301,7 +307,6 @@ sort_profiles (GvcMixerCardProfile *a,
return -1;
}
/**
* gvc_mixer_card_set_profiles:
* @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 (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;
}

View file

@ -81,6 +81,9 @@ gboolean gvc_mixer_card_change_profile (GvcMixerCard *card,
const char *profile);
GIcon * gvc_mixer_card_get_gicon (GvcMixerCard *card);
int gvc_mixer_card_profile_compare (GvcMixerCardProfile *a,
GvcMixerCardProfile *b);
/* private */
gboolean gvc_mixer_card_set_name (GvcMixerCard *card,
const char *name);