annotate src/xs_fileinfo.c @ 660:b0743dc9165d

Change tabs to 4 spaces, everywhere.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 02 Apr 2008 22:10:05 +0300
parents acaba070cf49
children 0fef72dce601
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 XMMS-SID - SIDPlay input plugin for X MultiMedia System (XMMS)
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 File information window
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
324
dd201740a720 Changed copyright text.
Matti Hamalainen <ccr@tnsp.org>
parents: 301
diff changeset
6 Programmed and designed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
422
d2e6682d3ef8 Copyright year update
Matti Hamalainen <ccr@tnsp.org>
parents: 412
diff changeset
7 (C) Copyright 1999-2007 Tecnic Software productions (TNSP)
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 This program is free software; you can redistribute it and/or modify
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 the Free Software Foundation; either version 2 of the License, or
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 (at your option) any later version.
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 This program is distributed in the hope that it will be useful,
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 GNU General Public License for more details.
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
412
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 399
diff changeset
19 You should have received a copy of the GNU General Public License along
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 399
diff changeset
20 with this program; if not, write to the Free Software Foundation, Inc.,
7f694e5a1493 Updated GNU GPL (new FSF address) and some cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 399
diff changeset
21 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 */
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #include <gdk/gdkkeysyms.h>
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #include <gtk/gtk.h>
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
290
b6bcd62394f3 Include correct headers, typecast returnvalue to gint
Matti Hamalainen <ccr@tnsp.org>
parents: 282
diff changeset
26 #include "xs_fileinfo.h"
526
fa95d942f226 Header cleanup; Moved some types from xmms-sid.h to xs_player.h; Renamed few functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 492
diff changeset
27 #include "xs_player.h"
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
28 #include "xs_support.h"
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 #include "xs_config.h"
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 #include "xs_interface.h"
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 #include "xs_glade.h"
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 615
diff changeset
32 #include "xs_slsup.h"
462
1d55247ad0cc Moved again. :D
Matti Hamalainen <ccr@tnsp.org>
parents: 430
diff changeset
33
1d55247ad0cc Moved again. :D
Matti Hamalainen <ccr@tnsp.org>
parents: 430
diff changeset
34
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
35 static GtkWidget *xs_fileinfowin = NULL;
657
acaba070cf49 Lots of cosmetic code cleanups; synced the de-gettextification from Audacious-SID, I suppose it makes some sense ...
Matti Hamalainen <ccr@tnsp.org>
parents: 649
diff changeset
36 static stil_node_t *xs_fileinfostil = NULL;
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
37 XS_MUTEX(xs_fileinfowin);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
39 #define LUW(x) lookup_widget(xs_fileinfowin, x)
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 615
diff changeset
42 #ifndef AUDACIOUS_PLUGIN
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
43 void xs_fileinfo_update(void)
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
44 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
45 XS_MUTEX_LOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
46 XS_MUTEX_LOCK(xs_fileinfowin);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
47
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
48 /* Check if control window exists, we are currently playing and have a tune */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
49 if (xs_fileinfowin) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
50 gboolean isEnabled;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
51 GtkAdjustment *tmpAdj;
492
1775b3f16cd9 Move variables to better block.
Matti Hamalainen <ccr@tnsp.org>
parents: 473
diff changeset
52
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
53 if (xs_status.tuneInfo && xs_status.isPlaying && (xs_status.tuneInfo->nsubTunes > 1)) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
54 tmpAdj = gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")));
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
55
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
56 tmpAdj->value = xs_status.currSong;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
57 tmpAdj->lower = 1;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
58 tmpAdj->upper = xs_status.tuneInfo->nsubTunes;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
59 XS_MUTEX_UNLOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
60 XS_MUTEX_UNLOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
61 gtk_adjustment_value_changed(tmpAdj);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
62 XS_MUTEX_LOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
63 XS_MUTEX_LOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
64 isEnabled = TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
65 } else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
66 isEnabled = FALSE;
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
67
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
68 /* Enable or disable subtune-control in fileinfo window */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
69 gtk_widget_set_sensitive(LUW("fileinfo_subctrl_prev"), isEnabled);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
70 gtk_widget_set_sensitive(LUW("fileinfo_subctrl_adj"), isEnabled);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
71 gtk_widget_set_sensitive(LUW("fileinfo_subctrl_next"), isEnabled);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
72 }
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
73
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
74 XS_MUTEX_UNLOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
75 XS_MUTEX_UNLOCK(xs_fileinfowin);
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
76 }
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
77
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
78
424
faf12767a6f1 Preparing for internationalization.
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
79 static void xs_fileinfo_setsong(void)
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 222
diff changeset
80 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
81 gint n;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
82
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
83 XS_MUTEX_LOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
84 XS_MUTEX_LOCK(xs_fileinfowin);
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
85
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
86 if (xs_status.tuneInfo && xs_status.isPlaying) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
87 n = (gint) gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj")))->value;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
88 if ((n >= 1) && (n <= xs_status.tuneInfo->nsubTunes))
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
89 xs_status.currSong = n;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
90 }
234
6f9764fbd693 Make the slider in fileinfo window's subtune selector work as expected.
Matti Hamalainen <ccr@tnsp.org>
parents: 232
diff changeset
91
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
92 XS_MUTEX_UNLOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
93 XS_MUTEX_UNLOCK(xs_status);
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 222
diff changeset
94 }
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 615
diff changeset
95 #endif /* AUDACIOUS_PLUGIN */
230
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 222
diff changeset
96
608f31f6c095 Raw cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 222
diff changeset
97
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 void xs_fileinfo_ok(void)
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
100 XS_MUTEX_LOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
101 if (xs_fileinfowin) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
102 gtk_widget_destroy(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
103 xs_fileinfowin = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
104 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
105 XS_MUTEX_UNLOCK(xs_fileinfowin);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 }
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
109 gboolean xs_fileinfo_delete(GtkWidget * widget, GdkEvent * event, gpointer user_data)
282
0d2d379a83c0 Fixed nasty crash when closing fileinfo-window from window's closebutton -
Matti Hamalainen <ccr@tnsp.org>
parents: 239
diff changeset
110 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
111 (void) widget;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
112 (void) event;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
113 (void) user_data;
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
114
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
115 XSDEBUG("delete_event\n");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
116 xs_fileinfo_ok();
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
117 return FALSE;
282
0d2d379a83c0 Fixed nasty crash when closing fileinfo-window from window's closebutton -
Matti Hamalainen <ccr@tnsp.org>
parents: 239
diff changeset
118 }
0d2d379a83c0 Fixed nasty crash when closing fileinfo-window from window's closebutton -
Matti Hamalainen <ccr@tnsp.org>
parents: 239
diff changeset
119
0d2d379a83c0 Fixed nasty crash when closing fileinfo-window from window's closebutton -
Matti Hamalainen <ccr@tnsp.org>
parents: 239
diff changeset
120
424
faf12767a6f1 Preparing for internationalization.
Matti Hamalainen <ccr@tnsp.org>
parents: 422
diff changeset
121 static void xs_fileinfo_subtune(GtkWidget * widget, void *data)
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
123 stil_subnode_t *tmpNode;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
124 GtkWidget *tmpText;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
125 gchar *subName, *subAuthor, *subInfo;
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
127 (void) widget;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
128 (void) data;
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
130 /* Freeze text-widget and delete the old text */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
131 tmpText = LUW("fileinfo_sub_info");
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
132 #ifndef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
133 gtk_text_freeze(GTK_TEXT(tmpText));
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
134 gtk_text_set_point(GTK_TEXT(tmpText), 0);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
135 gtk_text_forward_delete(GTK_TEXT(tmpText), gtk_text_get_length(GTK_TEXT(tmpText)));
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
136 #endif
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
138 /* Get subtune information */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
139 tmpNode = (stil_subnode_t *) data;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
140 if (!tmpNode && xs_fileinfostil)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
141 tmpNode = xs_fileinfostil->subTunes[0];
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
142
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
143 if (tmpNode) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
144 subName = tmpNode->name;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
145 subAuthor = tmpNode->author;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
146 subInfo = tmpNode->info;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
147 } else {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
148 subName = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
149 subAuthor = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
150 subInfo = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
151 }
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
153 /* Get and set subtune information */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
154 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_name")), subName ? subName : "");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
155 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_sub_author")), subAuthor ? subAuthor : "");
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
156
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
157 #ifdef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
158 gtk_text_buffer_set_text(GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(tmpText))),
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
159 subInfo ? subInfo : "", -1);
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
160 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
161 gtk_text_insert(GTK_TEXT(tmpText), NULL, NULL, NULL,
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
162 subInfo ? subInfo : "", -1);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
164 /* Un-freeze the widget */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
165 gtk_text_thaw(GTK_TEXT(tmpText));
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
166 #endif
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 }
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169
359
b1a858b8cb1a Re-indentation all (non-generated) code.
Matti Hamalainen <ccr@tnsp.org>
parents: 341
diff changeset
170 void xs_fileinfo(gchar * pcFilename)
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 {
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
172 GtkWidget *tmpMenuItem, *tmpMenu, *tmpOptionMenu;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
173 xs_tuneinfo_t *tmpInfo;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
174 stil_subnode_t *tmpNode;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
175 gchar tmpStr[256], *tmpFilename;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
176 gint n;
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
178 /* Current implementation leaves old fileinfo window untouched if
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
179 * no information can be found for the new file. Hmm...
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
180 */
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
181 #ifdef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
182 xs_get_trackinfo(pcFilename, &tmpFilename, &n);
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
183 #else
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
184 tmpFilename = pcFilename;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
185 #endif
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
186
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
187 /* Get new tune information */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
188 XS_MUTEX_LOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
189 XS_MUTEX_LOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
190 if ((tmpInfo = xs_status.sidPlayer->plrGetSIDInfo(tmpFilename)) == NULL) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
191 XS_MUTEX_UNLOCK(xs_fileinfowin);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
192 XS_MUTEX_UNLOCK(xs_status);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
193 return;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
194 }
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
195 XS_MUTEX_UNLOCK(xs_status);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
197 xs_fileinfostil = xs_stil_get(tmpFilename);
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
198
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
199 #ifdef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
200 g_free(tmpFilename);
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
201 #endif
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
203 /* Check if there already is an open fileinfo window */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
204 if (xs_fileinfowin)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
205 gdk_window_raise(xs_fileinfowin->window);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
206 else {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
207 xs_fileinfowin = create_xs_fileinfowin();
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
208 #ifndef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
209 XS_SIGNAL_CONNECT(gtk_range_get_adjustment(GTK_RANGE(LUW("fileinfo_subctrl_adj"))),
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
210 "value_changed", xs_fileinfo_setsong, NULL);
625
547f4d35f56a Unify xs_fileinfo with Aud-SID.
Matti Hamalainen <ccr@tnsp.org>
parents: 622
diff changeset
211 #endif
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
212 }
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
214 /* Delete current items */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
215 tmpOptionMenu = LUW("fileinfo_sub_tune");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
216 tmpMenu = gtk_option_menu_get_menu(GTK_OPTION_MENU(tmpOptionMenu));
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
217 gtk_widget_destroy(tmpMenu);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
218 gtk_option_menu_remove_menu(GTK_OPTION_MENU(tmpOptionMenu));
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
219 tmpMenu = gtk_menu_new();
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
222 /* Set the generic song information */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
223 tmpFilename = XS_CS_FILENAME(pcFilename);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
224 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_filename")), tmpFilename);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
225 g_free(tmpFilename);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
226 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_songname")), tmpInfo->sidName);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
227 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_composer")), tmpInfo->sidComposer);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
228 gtk_entry_set_text(GTK_ENTRY(LUW("fileinfo_copyright")), tmpInfo->sidCopyright);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
231 /* Main tune - the pseudo tune */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
232 tmpMenuItem = gtk_menu_item_new_with_label(_("General info"));
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
233 gtk_widget_show(tmpMenuItem);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
234 gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
235 if (xs_fileinfostil)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
236 tmpNode = xs_fileinfostil->subTunes[0];
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
237 else
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
238 tmpNode = NULL;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
239 XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
240
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
241 /* Other menu items */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
242 for (n = 1; n <= tmpInfo->nsubTunes; n++) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
243 if (xs_fileinfostil && n <= xs_fileinfostil->nsubTunes && xs_fileinfostil->subTunes[n]) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
244 gboolean isSet = FALSE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
245 tmpNode = xs_fileinfostil->subTunes[n];
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
246
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
247 g_snprintf(tmpStr, sizeof(tmpStr), _("Tune #%i: "), n);
430
d787dae8c043 Bugfixes.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
248
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
249 if (tmpNode->name) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
250 xs_pnstrcat(tmpStr, sizeof(tmpStr), tmpNode->name);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
251 isSet = TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
252 }
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
253
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
254 if (tmpNode->title) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
255 xs_pnstrcat(tmpStr, sizeof(tmpStr),
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
256 isSet ? " [*]" : tmpNode->title);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
257 isSet = TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
258 }
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
259
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
260 if (tmpNode->info) {
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
261 xs_pnstrcat(tmpStr, sizeof(tmpStr), " [!]");
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
262 isSet = TRUE;
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
263 }
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
264
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
265 if (!isSet)
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
266 xs_pnstrcat(tmpStr, sizeof(tmpStr), "---");
636
ea06356d792b Show tags ("[!]" and "[*]") in fileinfo selector, if there is additional information for the subtune;
Matti Hamalainen <ccr@tnsp.org>
parents: 626
diff changeset
267
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
268 tmpMenuItem = gtk_menu_item_new_with_label(tmpStr);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
269 gtk_widget_show(tmpMenuItem);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
270 gtk_menu_append(GTK_MENU(tmpMenu), tmpMenuItem);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
271 XS_SIGNAL_CONNECT(tmpMenuItem, "activate", xs_fileinfo_subtune, tmpNode);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
272 }
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
273
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
274 }
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
275
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
276 gtk_option_menu_set_menu(GTK_OPTION_MENU(tmpOptionMenu), tmpMenu);
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
277 gtk_widget_show(tmpOptionMenu);
614
52a6c114e505 Sub-tune info selector fixed in file information dialog.
Matti Hamalainen <ccr@tnsp.org>
parents: 612
diff changeset
278
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
279 /* Set the subtune information */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
280 xs_fileinfo_subtune(tmpOptionMenu, NULL);
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
281
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
282 /* Free temporary tuneinfo */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
283 xs_tuneinfo_free(tmpInfo);
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
284
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
285 /* Show the window */
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
286 gtk_widget_show(xs_fileinfowin);
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
287
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
288 XS_MUTEX_UNLOCK(xs_fileinfowin);
232
e613873c3379 Thread locking now final. All parts, including GTK GUI, should be(?)
Matti Hamalainen <ccr@tnsp.org>
parents: 230
diff changeset
289
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 615
diff changeset
290 #ifndef AUDACIOUS_PLUGIN
660
b0743dc9165d Change tabs to 4 spaces, everywhere.
Matti Hamalainen <ccr@tnsp.org>
parents: 657
diff changeset
291 xs_fileinfo_update();
622
d7389ea52113 Move SLDB and STIL utility functions to xs_slsup.[ch] and amend some changes between XMMS-SID and Aud-SID via a macro mess.
Matti Hamalainen <ccr@tnsp.org>
parents: 615
diff changeset
292 #endif
222
dcf88b73e4c1 Added fileinfo-dialog module.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
293 }