annotate libaudacious/titlestring.c @ 1804:e0e46bce806e trunk

[svn] - mainwinEQButtonX, mainwinEQButtonY, mainwinPLButtonX, mainwinPLButtonY, mainwinAboutX, mainwinAboutY, mainwinShuffleX, mainwinShuffleY, mainwinRepeatX, mainwinRepeatY.
author nenolod
date Wed, 04 Oct 2006 21:46:00 -0700
parents fda280358660
children 90cc014f8fdc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 /*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 * Copyright (C) 2001, Espen Skoglund <esk@ira.uka.de>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 * Copyright (C) 2001, Haavard Kvaalen <havardk@xmms.org>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 * modify it under the terms of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 * as published by the Free Software Foundation; either version 2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 * of the License, or (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * along with this program; if not, write to the Free Software
1458
f12d7e208b43 [svn] Update FSF address in copyright notices. Update autotools templates.
chainsaw
parents: 1350
diff changeset
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
1459
705d4c089fce [svn] Fix postal code.
chainsaw
parents: 1458
diff changeset
18 * 02110-1301, USA.
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 #ifdef HAVE_CONFIG_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 # include "config.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25
751
6636d328fa38 [svn] more progress
nenolod
parents: 0
diff changeset
26 #define GETTEXT_PACKAGE PACKAGE_NAME
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 #include <glib/gi18n-lib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 #include <stdio.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 #include <string.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 #include "titlestring.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 #define CHECK(input, field) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 (((gchar *) &input->field - (gchar *) input) < input->__size)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39 #define VS(input, field) (CHECK(input, field) ? input->field : NULL)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 #define VI(input, field) (CHECK(input, field) ? input->field : 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43 BmpTitleInput *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 bmp_title_input_new()
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 BmpTitleInput *input;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 input = g_new0(BmpTitleInput, 1);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48 input->__size = XMMS_TITLEINPUT_SIZE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 input->__version = XMMS_TITLEINPUT_VERSION;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 return input;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54 bmp_title_input_free(BmpTitleInput * input)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 {
1350
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
56 if (input == NULL)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 return;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58
1350
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
59 if (input->performer != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
60 g_free(input->performer);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
61
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
62 if (input->album_name != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
63 g_free(input->album_name);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
64
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
65 if (input->track_name != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
66 g_free(input->track_name);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
67
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
68 if (input->date != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
69 g_free(input->date);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
70
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
71 if (input->genre != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
72 g_free(input->genre);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
73
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
74 if (input->comment != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
75 g_free(input->comment);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
76
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
77 if (input->file_name != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
78 g_free(input->file_name);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
79
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
80 if (input->file_path != NULL)
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
81 g_free(input->file_path);
ca5d03c4b3f1 [svn] - extra sanity checking keeps the double-free away
nenolod
parents: 751
diff changeset
82
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 g_free(input);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 gchar *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 xmms_get_titlestring(const gchar * fmt, TitleInput * input)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 GString *outstr;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 const gchar *string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 gchar c, convert[16];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 gint numdigits, numpr, val, i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 gint f_left, f_space, f_zero, someflag, width, precision;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 gboolean did_output = FALSE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 gchar digits[] = "0123456789";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 #define PUTCH(ch) g_string_append_c(outstr, ch)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 #define LEFTPAD(num) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 G_STMT_START { \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101 gint cnt = (num); \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 if ( ! f_left && cnt > 0 ) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 while ( cnt-- > 0 ) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 PUTCH(f_zero ? '0' : ' '); \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 } G_STMT_END;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 #define RIGHTPAD(num) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 G_STMT_START { \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 gint cnt = (num); \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 if ( f_left && cnt > 0 ) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 while ( cnt-- > 0 ) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 PUTCH( ' ' ); \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113 } G_STMT_END;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114
1658
fda280358660 [svn] avoid segfaults
lu_zero
parents: 1594
diff changeset
115 if (fmt == NULL || input == NULL)
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 return NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117 outstr = g_string_new("");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 for (;;) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 /* Copy characters until we encounter '%'. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 while ((c = *fmt++) != '%') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 if (c == '\0')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123 goto Done;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 g_string_append_c(outstr, c);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 f_left = f_space = f_zero = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 someflag = 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 /* Parse flags. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 while (someflag) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 switch (*fmt) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 case '-':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135 f_left = 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 fmt++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 case ' ':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139 f_space = 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 fmt++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 case '0':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 f_zero = 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 fmt++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 default:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 someflag = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153 /* Parse field width. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 if ((c = *fmt) >= '0' && c <= '9') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 width = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 while ((c = *fmt++) >= '0' && c <= '9') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 width *= 10;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 width += c - '0';
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 fmt--;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 width = -1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 /* Parse precision. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 if (*fmt == '.') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 if ((c = *++fmt) >= '0' && c <= '9') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 precision = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 while ((c = *fmt++) >= '0' && c <= '9') {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 precision *= 10;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172 precision += c - '0';
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 fmt--;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 precision = -1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 precision = -1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 /* Parse format conversion. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184 switch (c = *fmt++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 case '}': /* close optional, just ignore */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 continue;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 case '{':{ /* optional entry: %{n:...%} */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 char n = *fmt++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 if (!((n == 'a' && VS(input, album_name)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 (n == 'c' && VS(input, comment)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 (n == 'd' && VS(input, date)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 (n == 'e' && VS(input, file_ext)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 (n == 'f' && VS(input, file_name)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 (n == 'F' && VS(input, file_path)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 (n == 'g' && VS(input, genre)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 (n == 'n' && VI(input, track_number)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 (n == 'p' && VS(input, performer)) ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 (n == 't' && VS(input, track_name)))) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 int nl = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201 char c;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 while ((c = *fmt++)) /* until end of string */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 if (c == '}') /* if end of opt */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 if (!nl)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 break; /* if outmost indent level */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207 --nl; /* else reduce indent */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208 else if (c == '{')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 ++nl; /* increase indent */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 ++fmt;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216 case 'a':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 string = VS(input, album_name);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 case 'c':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220 string = VS(input, comment);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 case 'd':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223 string = VS(input, date);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 case 'e':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 string = VS(input, file_ext);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228 case 'f':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 string = VS(input, file_name);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231 case 'F':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232 string = VS(input, file_path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 case 'g':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 string = VS(input, genre);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
236 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
237 case 'n':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
238 val = VI(input, track_number);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
239 goto Print_number;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
240 case 'p':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
241 string = VS(input, performer);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
242 goto Print_string;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
243 case 't':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
244 string = VS(input, track_name);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
245
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
246 Print_string:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 if (string == NULL)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
248 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
249 did_output = TRUE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
250
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
251 numpr = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
252 if (width > 0) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
253 /* Calculate printed size. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
254 numpr = strlen(string);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
255 if (precision >= 0 && precision < numpr)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
256 numpr = precision;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
257
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
258 LEFTPAD(width - numpr);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
259 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
260
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
261 /* Insert string. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
262 if (precision >= 0) {
1594
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
263 glong offset_max = precision, offset;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
264 gchar *uptr = NULL;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
265 const gchar *tmpstring = string;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
266 while (precision > 0) {
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
267 offset = offset_max - precision;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
268 uptr = g_utf8_offset_to_pointer(tmpstring, offset);
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
269 if (*uptr == '\0')
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
270 break;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
271 g_string_append_unichar(outstr, g_utf8_get_char(uptr));
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
272 precision--;
44f67f556b60 [svn] - precision in title format is regarded as character count, not byte count.
yaz
parents: 1459
diff changeset
273 }
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
274 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
275 else {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
276 while ((c = *string++) != '\0')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
277 PUTCH(c);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
278 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
279
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
280 RIGHTPAD(width - numpr);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
281 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
282
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
283 case 'y':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
284 val = VI(input, year);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
285
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
286 Print_number:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
287 if (val == 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
288 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
289 if (c != 'N')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
290 did_output = TRUE;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
291
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
292 /* Create reversed number string. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
293 numdigits = 0;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
294 do {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
295 convert[numdigits++] = digits[val % 10];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
296 val /= 10;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
297 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
298 while (val > 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
299
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
300 numpr = numdigits > precision ? numdigits : precision;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
301
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
302 /* Insert left padding. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
303 if (!f_left && width > numpr) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
304 if (f_zero)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
305 numpr = width;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
306 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
307 for (i = width - numpr; i-- > 0;)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
308 PUTCH(' ');
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
309 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
311 /* Insert zero padding. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
312 for (i = numpr - numdigits; i-- > 0;)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
313 PUTCH('0');
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
314
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
315 /* Insert number. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
316 while (numdigits > 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
317 PUTCH(convert[--numdigits]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
318
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
319 RIGHTPAD(width - numpr);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
320 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
321
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
322 case '%':
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
323 PUTCH('%');
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
324 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
325
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
326 default:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
327 PUTCH('%');
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
328 PUTCH(c);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
329 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
330 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
331 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
332
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
333 Done:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
334 if (did_output)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
335 return g_string_free(outstr, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
336 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
337 return NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
338 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
339
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
340 struct _TagDescription {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
341 gchar tag;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
342 gchar *description;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
343 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
344
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
345 typedef struct _TagDescription TagDescription;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
346
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
347 static TagDescription tag_descriptions[] = {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
348 {'p', N_("Performer/Artist")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
349 {'a', N_("Album")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
350 {'g', N_("Genre")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
351 {'f', N_("File name")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
352 {'F', N_("File path")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
353 {'e', N_("File extension")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
354 {'t', N_("Track name")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
355 {'n', N_("Track number")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
356 {'d', N_("Date")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
357 {'y', N_("Year")},
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
358 {'c', N_("Comment")}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
359 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
360
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
361 gint tag_descriptions_length =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
362 sizeof(tag_descriptions) / sizeof(TagDescription);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
363
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
364 GtkWidget *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
365 xmms_titlestring_descriptions(gchar * tags, gint columns)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
366 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
367 GtkWidget *table, *label;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
368 gchar tag_str[5];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
369 gint num = strlen(tags);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
370 gint r = 0, c, i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
371
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
372 g_return_val_if_fail(tags != NULL, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
373 g_return_val_if_fail(columns <= num, NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
374
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
375 table = gtk_table_new((num + columns - 1) / columns, columns * 2, FALSE);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
376 gtk_table_set_row_spacings(GTK_TABLE(table), 2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
377 gtk_table_set_col_spacings(GTK_TABLE(table), 5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
378
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
379 for (c = 0; c < columns; c++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
380 for (r = 0; r < (num + columns - 1 - c) / columns; r++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
381 g_snprintf(tag_str, sizeof(tag_str), "%%%c:", *tags);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
382 label = gtk_label_new(tag_str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
383 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
384 gtk_table_attach(GTK_TABLE(table), label, 2 * c, 2 * c + 1, r,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
385 r + 1, GTK_FILL, GTK_FILL, 0, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
386 gtk_widget_show(label);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
387
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
388 for (i = 0; i < tag_descriptions_length; i++) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
389 if (*tags == tag_descriptions[i].tag) {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
390 label = gtk_label_new(_(tag_descriptions[i].description));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
391 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
392 gtk_table_attach(GTK_TABLE(table), label, 2 * c + 1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
393 2 * c + 2, r, r + 1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
394 GTK_EXPAND | GTK_FILL,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
395 GTK_EXPAND | GTK_FILL, 0, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
396 gtk_widget_show(label);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
397 break;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
398 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
399 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
400
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
401 if (i == tag_descriptions_length)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
402 g_warning("Invalid tag: %c", *tags);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
403
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
404 tags++;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
405 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
406
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
407 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
408
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
409 label = gtk_label_new(_("%{n:...%}: Display \"...\" only if element "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
410 "%n is present"));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
411 gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
412 gtk_table_attach(GTK_TABLE(table), label, 0, r + 1,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
413 r + 1, r + 2, GTK_FILL, GTK_FILL, 0, 0);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
414 gtk_widget_show(label);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
415
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
416 return table;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
417 }