Mercurial > audlegacy-plugins
comparison src/sid/xs_fileinfo.c @ 2507:251336bee085
Cosmetic cleanups, synchronized from XMMS-SID.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 02 Apr 2008 19:53:39 +0300 |
parents | e5401b6c4665 |
children | 1223e8510d8a |
comparison
equal
deleted
inserted
replaced
2506:28f3f1fc4001 | 2507:251336bee085 |
---|---|
31 #include "xs_glade.h" | 31 #include "xs_glade.h" |
32 #include "xs_slsup.h" | 32 #include "xs_slsup.h" |
33 | 33 |
34 | 34 |
35 static GtkWidget *xs_fileinfowin = NULL; | 35 static GtkWidget *xs_fileinfowin = NULL; |
36 static t_xs_stil_node *xs_fileinfostil = NULL; | 36 static stil_node_t *xs_fileinfostil = NULL; |
37 XS_MUTEX(xs_fileinfowin); | 37 XS_MUTEX(xs_fileinfowin); |
38 | 38 |
39 #define LUW(x) lookup_widget(xs_fileinfowin, x) | 39 #define LUW(x) lookup_widget(xs_fileinfowin, x) |
40 | 40 |
41 | 41 |
118 } | 118 } |
119 | 119 |
120 | 120 |
121 static void xs_fileinfo_subtune(GtkWidget * widget, void *data) | 121 static void xs_fileinfo_subtune(GtkWidget * widget, void *data) |
122 { | 122 { |
123 t_xs_stil_subnode *tmpNode; | 123 stil_subnode_t *tmpNode; |
124 GtkWidget *tmpText; | 124 GtkWidget *tmpText; |
125 gchar *subName, *subAuthor, *subInfo; | 125 gchar *subName, *subAuthor, *subInfo; |
126 | 126 |
127 (void) widget; | 127 (void) widget; |
128 (void) data; | 128 (void) data; |
134 gtk_text_set_point(GTK_TEXT(tmpText), 0); | 134 gtk_text_set_point(GTK_TEXT(tmpText), 0); |
135 gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText))); | 135 gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText))); |
136 #endif | 136 #endif |
137 | 137 |
138 /* Get subtune information */ | 138 /* Get subtune information */ |
139 tmpNode = (t_xs_stil_subnode *) data; | 139 tmpNode = (stil_subnode_t *) data; |
140 if (!tmpNode && xs_fileinfostil) | 140 if (!tmpNode && xs_fileinfostil) |
141 tmpNode = xs_fileinfostil->subTunes[0]; | 141 tmpNode = xs_fileinfostil->subTunes[0]; |
142 | 142 |
143 if (tmpNode) { | 143 if (tmpNode) { |
144 subName = tmpNode->pName; | 144 subName = tmpNode->name; |
145 subAuthor = tmpNode->pAuthor; | 145 subAuthor = tmpNode->author; |
146 subInfo = tmpNode->pInfo; | 146 subInfo = tmpNode->info; |
147 } else { | 147 } else { |
148 subName = NULL; | 148 subName = NULL; |
149 subAuthor = NULL; | 149 subAuthor = NULL; |
150 subInfo = NULL; | 150 subInfo = NULL; |
151 } | 151 } |
165 gtk_text_thaw(GTK_TEXT(tmpText)); | 165 gtk_text_thaw(GTK_TEXT(tmpText)); |
166 #endif | 166 #endif |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 void xs_fileinfo(gchar * pcFilename) | 170 void xs_fileinfo(gchar * filename) |
171 { | 171 { |
172 GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu; | 172 GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu; |
173 t_xs_tuneinfo *tmpInfo; | 173 xs_tuneinfo_t *tmpInfo; |
174 t_xs_stil_subnode *tmpNode; | 174 stil_subnode_t *tmpNode; |
175 gchar tmpStr[256], *tmpFilename; | 175 gchar tmpStr[256], *tmpFilename; |
176 gint n; | 176 gint n; |
177 | 177 |
178 /* Current implementation leaves old fileinfo window untouched if | 178 /* Current implementation leaves old fileinfo window untouched if |
179 * no information can be found for the new file. Hmm... | 179 * no information can be found for the new file. Hmm... |
180 */ | 180 */ |
181 #ifdef AUDACIOUS_PLUGIN | 181 #ifdef AUDACIOUS_PLUGIN |
182 xs_get_trackinfo(pcFilename, &tmpFilename, &n); | 182 xs_get_trackinfo(filename, &tmpFilename, &n); |
183 #else | 183 #else |
184 tmpFilename = pcFilename; | 184 tmpFilename = filename; |
185 #endif | 185 #endif |
186 | 186 |
187 /* Get new tune information */ | 187 /* Get new tune information */ |
188 XS_MUTEX_LOCK(xs_fileinfowin); | 188 XS_MUTEX_LOCK(xs_fileinfowin); |
189 XS_MUTEX_LOCK(xs_status); | 189 XS_MUTEX_LOCK(xs_status); |
218 gtk_option_menu_remove_menu(GTK_OPTION_MENU(tmpOptionMenu)); | 218 gtk_option_menu_remove_menu(GTK_OPTION_MENU(tmpOptionMenu)); |
219 tmpMenu = gtk_menu_new(); | 219 tmpMenu = gtk_menu_new(); |
220 | 220 |
221 | 221 |
222 /* Set the generic song information */ | 222 /* Set the generic song information */ |
223 tmpFilename = XS_CS_FILENAME(pcFilename); | 223 tmpFilename = XS_CS_FILENAME(filename); |
224 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename); | 224 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename); |
225 g_free(tmpFilename); | 225 g_free(tmpFilename); |
226 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName); | 226 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName); |
227 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer); | 227 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer); |
228 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright); | 228 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright); |
244 gboolean isSet = FALSE; | 244 gboolean isSet = FALSE; |
245 tmpNode = xs_fileinfostil->subTunes[n]; | 245 tmpNode = xs_fileinfostil->subTunes[n]; |
246 | 246 |
247 g_snprintf(tmpStr, sizeof(tmpStr), _("Tune #%i: "), n); | 247 g_snprintf(tmpStr, sizeof(tmpStr), _("Tune #%i: "), n); |
248 | 248 |
249 if (tmpNode->pName) { | 249 if (tmpNode->name) { |
250 xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->pName); | 250 xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->name); |
251 isSet = TRUE; | 251 isSet = TRUE; |
252 } | 252 } |
253 | 253 |
254 if (tmpNode->pTitle) { | 254 if (tmpNode->title) { |
255 xs_pnstrcat(tmpStr, sizeof(tmpStr), | 255 xs_pnstrcat(tmpStr, sizeof(tmpStr), |
256 isSet ? " [*]" : tmpNode->pTitle); | 256 isSet ? " [*]" : tmpNode->title); |
257 isSet = TRUE; | 257 isSet = TRUE; |
258 } | 258 } |
259 | 259 |
260 if (tmpNode->pInfo) { | 260 if (tmpNode->info) { |
261 xs_pnstrcat(tmpStr, sizeof(tmpStr), " [!]"); | 261 xs_pnstrcat(tmpStr, sizeof(tmpStr), " [!]"); |
262 isSet = TRUE; | 262 isSet = TRUE; |
263 } | 263 } |
264 | 264 |
265 if (!isSet) | 265 if (!isSet) |