Commit a03727fb authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

ext/alsa/gstalsamixertrack.c: Some const-ification.

Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_new):
Some const-ification.
parent 361979b8
2006-07-04 Tim-Philipp Müller <tim at centricular dot net>
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_new):
Some const-ification.
2006-07-04 Wim Taymans <wim@fluendo.com> 2006-07-04 Wim Taymans <wim@fluendo.com>
   
* gst/playback/gstplaybasebin.c: (is_stream), (gen_source_element): * gst/playback/gstplaybasebin.c: (is_stream), (gen_source_element):
......
...@@ -74,23 +74,23 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element, ...@@ -74,23 +74,23 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element,
{ {
gint i; gint i;
long min = 0, max = 0; long min = 0, max = 0;
struct const struct
{ {
gchar *orig, *trans; const gchar orig[12];
const gchar trans[12];
} alsa_track_labels[] = { } alsa_track_labels[] = {
{ {
"Master", _("Master")}, { "Master", N_("Master")}, {
"Bass", _("Bass")}, { "Bass", N_("Bass")}, {
"Treble", _("Treble")}, { "Treble", N_("Treble")}, {
"PCM", _("PCM")}, { "PCM", N_("PCM")}, {
"Synth", _("Synth")}, { "Synth", N_("Synth")}, {
"Line", _("Line-in")}, { "Line", N_("Line-in")}, {
"CD", _("CD")}, { "CD", N_("CD")}, {
"Mic", _("Microphone")}, { "Mic", N_("Microphone")}, {
"PC Speaker", _("PC Speaker")}, { "PC Speaker", N_("PC Speaker")}, {
"Playback", _("Playback")}, { "Playback", N_("Playback")}, {
"Capture", _("Capture")}, { "Capture", N_("Capture")}
NULL, NULL}
}; };
GstMixerTrack *track = g_object_new (GST_ALSA_MIXER_TRACK_TYPE, NULL); GstMixerTrack *track = g_object_new (GST_ALSA_MIXER_TRACK_TYPE, NULL);
...@@ -102,19 +102,18 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element, ...@@ -102,19 +102,18 @@ gst_alsa_mixer_track_new (snd_mixer_elem_t * element,
else else
track->label = g_strdup_printf ("%s %d", track->label = g_strdup_printf ("%s %d",
snd_mixer_selem_get_name (element), num + 1); snd_mixer_selem_get_name (element), num + 1);
i = 0;
while (alsa_track_labels[i].orig != NULL) { for (i = 0; i < G_N_ELEMENTS (alsa_track_labels); ++i) {
if (!g_utf8_collate (snd_mixer_selem_get_name (element), if (!g_utf8_collate (snd_mixer_selem_get_name (element),
alsa_track_labels[i].orig)) { alsa_track_labels[i].orig)) {
g_free (track->label); g_free (track->label);
if (num == 0) if (num == 0)
track->label = g_strdup (alsa_track_labels[i].trans); track->label = g_strdup (_(alsa_track_labels[i].trans));
else else
track->label = g_strdup_printf ("%s %d", track->label = g_strdup_printf ("%s %d",
alsa_track_labels[i].trans, num); _(alsa_track_labels[i].trans), num);
break; break;
} }
i++;
} }
track->num_channels = channels; track->num_channels = channels;
track->flags = flags; track->flags = flags;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment