annotate src/wavpack/ui.cxx @ 3052:95b34f46a231

Comment out MPEG2/MPEG4 determination using the variable id. It is not used anywhere. Code analysis run, unique ID 6nYoHM.
author Tony Vroon <chainsaw@gentoo.org>
date Sat, 18 Apr 2009 19:06:20 +0100
parents 13a0e4377c20
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2233
0de647993c2a - make use of AUDDBG
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
1 // #define AUD_DEBUG 1
0de647993c2a - make use of AUDDBG
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
2
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
3 #include <assert.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
4 #include <string.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
5 #include <stdio.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
6 #include <stdlib.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
7 #include <pthread.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
8 #include <unistd.h>
294
60b7388105ba [svn] - i hate the world.
nenolod
parents: 284
diff changeset
9 extern "C" {
284
72f0de06bb56 [svn] - wavpack/wputils.h is deprecated, wavpack/wavpack.h should be used instead.
nenolod
parents: 246
diff changeset
10 #include <wavpack/wavpack.h>
2971
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2941
diff changeset
11 #include <audlegacy/plugin.h>
3134a0987162 - changed include path from audacious to audlegacy.
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2941
diff changeset
12 #include <audlegacy/i18n.h>
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
13 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
14 #include <glib.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
15 #include <gtk/gtk.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
16 #include <math.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
17 #include "tags.h"
434
7385182ae4b8 [svn] - add missing config.h inclusion for wavpack, null and metronom plugin
giacomo
parents: 294
diff changeset
18 #include "../../config.h"
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
19 #ifndef M_LN10
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
20 #define M_LN10 2.3025850929940456840179914546843642
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
21 #endif
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
22
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
23 void load_tag(ape_tag *tag, WavpackContext *ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
24 gboolean clipPreventionEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
25 gboolean dynBitrateEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
26 gboolean replaygainEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
27 gboolean albumReplaygainEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
28 gboolean openedAudio;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
29 static GtkWidget *window = NULL;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
30 static GtkWidget *title_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
31 static GtkWidget *album_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
32 static GtkWidget *performer_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
33 static GtkWidget *tracknumber_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
34 static GtkWidget *date_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
35 static GtkWidget *genre_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
36 static GtkWidget *user_comment_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
37 static char *filename;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
38
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
39 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
40 wv_about_box()
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
41 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
42 static GtkWidget *about_window;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
43
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
44 if (about_window)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
45 gdk_window_raise(about_window->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
46
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
47 about_window =
1677
f6f5603a0954 xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents: 1436
diff changeset
48 audacious_info_dialog(g_strdup_printf
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
49 (_("Wavpack Decoder Plugin %s"), VERSION),
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
50 (_("Copyright (c) 2006 William Pitcock <nenolod -at- nenolod.net>\n\n"
246
366acb77c853 [svn] - i rewrote most of this!
nenolod
parents: 113
diff changeset
51 "Some of the plugin code was by Miles Egan\n"
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
52 "Visit the Wavpack site at http://www.wavpack.com/\n")),
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
53 (_("Ok")), FALSE, NULL, NULL);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
54 g_signal_connect(G_OBJECT(about_window), "destroy",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
55 G_CALLBACK(gtk_widget_destroyed), &about_window);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
56 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
57
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
58 static void
1044
b1128efde471 [svn] - get rid of all warnings gcc 4.2.0 emits with my build configuration.
yaz
parents: 458
diff changeset
59 label_set_text(GtkWidget * label, const char *str, ...)
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
60 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
61 va_list args;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
62 gchar *tempstr;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
63
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
64 va_start(args, str);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
65 tempstr = g_strdup_vprintf(str, args);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
66 va_end(args);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
67
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
68 gtk_label_set_text(GTK_LABEL(label), tempstr);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
69 g_free(tempstr);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
70 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
71
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
72 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
73 remove_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
74 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
75 DeleteTag(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
76 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
77 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
78 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
79
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
80 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
81 save_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
82 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
83 ape_tag Tag;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
84
458
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
85 strncpy(Tag.title, gtk_entry_get_text(GTK_ENTRY(title_entry)), MAX_LEN);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
86 strncpy(Tag.artist, gtk_entry_get_text(GTK_ENTRY(performer_entry)), MAX_LEN);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
87 strncpy(Tag.album, gtk_entry_get_text(GTK_ENTRY(album_entry)), MAX_LEN);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
88 strncpy(Tag.comment, gtk_entry_get_text(GTK_ENTRY(user_comment_entry)), MAX_LEN);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
89 strncpy(Tag.track, gtk_entry_get_text(GTK_ENTRY(tracknumber_entry)), MAX_LEN2);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
90 strncpy(Tag.year, gtk_entry_get_text(GTK_ENTRY(date_entry)), MAX_LEN2);
89453f4a4278 [svn] Fixed possible buffer overflow.
js
parents: 434
diff changeset
91 strncpy(Tag.genre, gtk_entry_get_text(GTK_ENTRY(genre_entry)), MAX_LEN);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
92 WriteAPE2Tag(filename, &Tag);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
93 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
94 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
95 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
96
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
97 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
98 close_window(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
99 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
100 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
101 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
102 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
103
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
104 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
105 wv_file_info_box(char *fn)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
106 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
107 gchar *tmp;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
108 gint time, minutes, seconds;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
109 ape_tag tag;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
110
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
111 assert(fn != NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
112 char error_buff[4096]; // TODO: fixme!
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
113 WavpackContext *ctx = WavpackOpenFileInput(fn, error_buff, OPEN_TAGS | OPEN_WVC, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
114 if (ctx == NULL) {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
115 printf("wavpack: Error opening file: \"%s: %s\"\n", fn, error_buff);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
116 return;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
117 }
2233
0de647993c2a - make use of AUDDBG
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
118 #ifdef AUD_DEBUG
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
119 int sample_rate = WavpackGetSampleRate(ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
120 int num_channels = WavpackGetNumChannels(ctx);
2233
0de647993c2a - make use of AUDDBG
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
121 #endif
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
122 load_tag(&tag, ctx);
2233
0de647993c2a - make use of AUDDBG
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents: 2124
diff changeset
123 AUDDBG("opened %s at %d rate with %d channels\n", fn, sample_rate, num_channels);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
124
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
125 filename = g_strdup(fn);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
126 static GtkWidget *info_frame, *info_box, *bitrate_label, *rate_label;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
127 static GtkWidget *version_label, *bits_per_sample_label;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
128 static GtkWidget *channel_label, *length_label, *filesize_label;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
129 static GtkWidget *peakTitle_label, *peakAlbum_label, *gainTitle_label;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
130 static GtkWidget *gainAlbum_label, *filename_entry, *tag_frame;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
131
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
132 if (!window) {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
133 GtkWidget *hbox, *label, *filename_hbox, *vbox, *left_vbox;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
134 GtkWidget *table, *bbox, *cancel_button;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
135 GtkWidget *save_button, *remove_button;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
136
111
5745352e0c88 [svn] - hey, this compiles now. neat :P
nenolod
parents: 109
diff changeset
137 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
138 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
139 g_signal_connect(G_OBJECT(window), "destroy",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
140 G_CALLBACK(gtk_widget_destroyed), &window);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
141 gtk_container_set_border_width(GTK_CONTAINER(window), 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
142
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
143 vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
144 gtk_container_add(GTK_CONTAINER(window), vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
145
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
146 filename_hbox = gtk_hbox_new(FALSE, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
147 gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
148
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
149 label = gtk_label_new(_("Filename:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
150 gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
151 filename_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
152 gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
153 gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
154 TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
155
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
156 hbox = gtk_hbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
157 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
158
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
159 left_vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
160 gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
161
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
162 tag_frame = gtk_frame_new(_("Ape2 Tag"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
163 gtk_box_pack_start(GTK_BOX(left_vbox), tag_frame, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
164
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
165 table = gtk_table_new(5, 5, FALSE);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
166 gtk_container_set_border_width(GTK_CONTAINER(table), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
167 gtk_container_add(GTK_CONTAINER(tag_frame), table);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
168
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
169 label = gtk_label_new(_("Title:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
170 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
171 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
172 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
173
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
174 title_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
175 gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
176 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
177 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
178 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
179 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
180
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
181 label = gtk_label_new(_("Artist:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
182 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
183 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
184 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
185
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
186 performer_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
187 gtk_table_attach(GTK_TABLE(table), performer_entry, 1, 4, 1, 2,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
188 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
189 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
190 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
191 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
192
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
193 label = gtk_label_new(_("Album:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
194 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
195 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
196 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
197
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
198 album_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
199 gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
200 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
201 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
202 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
203 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
204
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
205 label = gtk_label_new(_("Comment:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
206 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
207 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
208 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
209
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
210 user_comment_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
211 gtk_table_attach(GTK_TABLE(table), user_comment_entry, 1, 4, 3,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
212 4,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
213 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
214 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
215 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
216 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
217
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
218 label = gtk_label_new(_("Year:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
219 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
220 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
221 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
222
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
223 date_entry = gtk_entry_new();
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
224 gtk_widget_set_size_request(date_entry, 60, -1);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
225 gtk_table_attach(GTK_TABLE(table), date_entry, 1, 2, 4, 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
226 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
227 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
228 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
229 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
230
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
231 label = gtk_label_new(_("Track number:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
232 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
233 gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
234 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
235
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
236 tracknumber_entry = gtk_entry_new();
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
237 gtk_entry_set_max_length(GTK_ENTRY(tracknumber_entry), 4);
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
238 gtk_widget_set_size_request(tracknumber_entry, 20, -1);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
239 gtk_table_attach(GTK_TABLE(table), tracknumber_entry, 3, 4, 4,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
240 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
241 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
242 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
243 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
244 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
245
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
246 label = gtk_label_new(_("Genre:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
247 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
248 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
249 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
250
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
251 genre_entry = gtk_entry_new();
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
252 gtk_widget_set_size_request(genre_entry, 20, -1);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
253 gtk_table_attach(GTK_TABLE(table), genre_entry, 1, 4, 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
254 6,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
255 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
256 GTK_SHRINK),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
257 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
258 GTK_SHRINK), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
259
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
260 bbox = gtk_hbutton_box_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
261 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
262 gtk_box_set_spacing(GTK_BOX(bbox), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
263 gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
264
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
265 save_button = gtk_button_new_with_label(_("Save"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
266 g_signal_connect(G_OBJECT(save_button), "clicked",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
267 G_CALLBACK(save_cb), NULL);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
268 GTK_WIDGET_SET_FLAGS(save_button, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
269 gtk_box_pack_start(GTK_BOX(bbox), save_button, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
270
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
271 remove_button = gtk_button_new_with_label(_("Remove Tag"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
272 g_signal_connect_swapped(G_OBJECT(remove_button), "clicked",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
273 G_CALLBACK(remove_cb), NULL);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
274 GTK_WIDGET_SET_FLAGS(remove_button, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
275 gtk_box_pack_start(GTK_BOX(bbox), remove_button, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
276
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
277 cancel_button = gtk_button_new_with_label(_("Cancel"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
278 g_signal_connect_swapped(G_OBJECT(cancel_button), "clicked",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
279 G_CALLBACK(close_window), NULL);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
280 GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
281 gtk_box_pack_start(GTK_BOX(bbox), cancel_button, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
282 gtk_widget_grab_default(cancel_button);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
283
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
284 info_frame = gtk_frame_new(_("Wavpack Info:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
285 gtk_box_pack_start(GTK_BOX(hbox), info_frame, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
286
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
287 info_box = gtk_vbox_new(FALSE, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
288 gtk_container_add(GTK_CONTAINER(info_frame), info_box);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
289 gtk_container_set_border_width(GTK_CONTAINER(info_box), 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
290 gtk_box_set_spacing(GTK_BOX(info_box), 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
291
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
292 version_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
293 gtk_misc_set_alignment(GTK_MISC(version_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
294 gtk_label_set_justify(GTK_LABEL(version_label),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
295 GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
296 gtk_box_pack_start(GTK_BOX(info_box), version_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
297 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
298
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
299 bits_per_sample_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
300 gtk_misc_set_alignment(GTK_MISC(bits_per_sample_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
301 gtk_label_set_justify(GTK_LABEL(bits_per_sample_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
302 gtk_box_pack_start(GTK_BOX(info_box), bits_per_sample_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
303
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
304 bitrate_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
305 gtk_misc_set_alignment(GTK_MISC(bitrate_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
306 gtk_label_set_justify(GTK_LABEL(bitrate_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
307 gtk_box_pack_start(GTK_BOX(info_box), bitrate_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
308
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
309 rate_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
310 gtk_misc_set_alignment(GTK_MISC(rate_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
311 gtk_label_set_justify(GTK_LABEL(rate_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
312 gtk_box_pack_start(GTK_BOX(info_box), rate_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
313
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
314 channel_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
315 gtk_misc_set_alignment(GTK_MISC(channel_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
316 gtk_label_set_justify(GTK_LABEL(channel_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
317 gtk_box_pack_start(GTK_BOX(info_box), channel_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
318
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
319 length_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
320 gtk_misc_set_alignment(GTK_MISC(length_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
321 gtk_label_set_justify(GTK_LABEL(length_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
322 gtk_box_pack_start(GTK_BOX(info_box), length_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
323
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
324 filesize_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
325 gtk_misc_set_alignment(GTK_MISC(filesize_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
326 gtk_label_set_justify(GTK_LABEL(filesize_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
327 gtk_box_pack_start(GTK_BOX(info_box), filesize_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
328 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
329
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
330 peakTitle_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
331 gtk_misc_set_alignment(GTK_MISC(peakTitle_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
332 gtk_label_set_justify(GTK_LABEL(peakTitle_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
333 gtk_box_pack_start(GTK_BOX(info_box), peakTitle_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
334 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
335
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
336 peakAlbum_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
337 gtk_misc_set_alignment(GTK_MISC(peakAlbum_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
338 gtk_label_set_justify(GTK_LABEL(peakAlbum_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
339 gtk_box_pack_start(GTK_BOX(info_box), peakAlbum_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
340 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
341
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
342 gainTitle_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
343 gtk_misc_set_alignment(GTK_MISC(gainTitle_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
344 gtk_label_set_justify(GTK_LABEL(gainTitle_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
345 gtk_box_pack_start(GTK_BOX(info_box), gainTitle_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
346 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
347
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
348 gainAlbum_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
349 gtk_misc_set_alignment(GTK_MISC(gainAlbum_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
350 gtk_label_set_justify(GTK_LABEL(gainAlbum_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
351 gtk_box_pack_start(GTK_BOX(info_box), gainAlbum_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
352 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
353
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
354 gtk_widget_show_all(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
355 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
356 else
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
357 gdk_window_raise(window->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
358
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
359 gtk_widget_set_sensitive(tag_frame, TRUE);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
360
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
361 gtk_label_set_text(GTK_LABEL(version_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
362 gtk_label_set_text(GTK_LABEL(bits_per_sample_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
363 gtk_label_set_text(GTK_LABEL(bitrate_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
364 gtk_label_set_text(GTK_LABEL(rate_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
365 gtk_label_set_text(GTK_LABEL(channel_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
366 gtk_label_set_text(GTK_LABEL(length_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
367 gtk_label_set_text(GTK_LABEL(filesize_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
368 gtk_label_set_text(GTK_LABEL(peakTitle_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
369 gtk_label_set_text(GTK_LABEL(peakAlbum_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
370 gtk_label_set_text(GTK_LABEL(gainTitle_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
371 gtk_label_set_text(GTK_LABEL(gainAlbum_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
372
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
373 time = WavpackGetNumSamples(ctx) / WavpackGetSampleRate(ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
374 minutes = time / 60;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
375 seconds = time % 60;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
376
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
377 label_set_text(version_label, _("version %d"), WavpackGetVersion(ctx));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
378 label_set_text(bitrate_label, _("average bitrate: %6.1f kbps"), WavpackGetAverageBitrate(ctx, 0) / 1000);
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
379 label_set_text(rate_label, _("samplerate: %d Hz"), WavpackGetSampleRate(ctx));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
380 label_set_text(bits_per_sample_label, _("bits per sample: %d"), WavpackGetBitsPerSample(ctx));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
381 label_set_text(channel_label, _("channels: %d"), WavpackGetNumChannels(ctx));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
382 label_set_text(length_label, _("length: %d:%.2d"), minutes, seconds);
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
383 label_set_text(filesize_label, _("file size: %d Bytes"), WavpackGetFileSize(ctx));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
384 /*
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
385 label_set_text(peakTitle_label, _("Title Peak: %5u"), 100);
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
386 label_set_text(peakAlbum_label, _("Album Peak: %5u"), 100);
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
387 label_set_text(gainTitle_label, _("Title Gain: %-+5.2f dB"), 100.0);
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
388 label_set_text(gainAlbum_label, _("Album Gain: %-+5.2f dB"), 100.0);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
389 */
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
390 label_set_text(peakTitle_label, _("Title Peak: ?"));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
391 label_set_text(peakAlbum_label, _("Album Peak: ?"));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
392 label_set_text(gainTitle_label, _("Title Gain: ?"));
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
393 label_set_text(gainAlbum_label, _("Album Gain: ?"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
394
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
395 gtk_entry_set_text(GTK_ENTRY(title_entry), tag.title);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
396 gtk_entry_set_text(GTK_ENTRY(performer_entry), tag.artist);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
397 gtk_entry_set_text(GTK_ENTRY(album_entry), tag.album);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
398 gtk_entry_set_text(GTK_ENTRY(user_comment_entry), tag.comment);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
399 gtk_entry_set_text(GTK_ENTRY(genre_entry), tag.genre);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
400 gtk_entry_set_text(GTK_ENTRY(tracknumber_entry), tag.track);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
401 gtk_entry_set_text(GTK_ENTRY(date_entry), tag.year);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
402 gtk_entry_set_text(GTK_ENTRY(filename_entry), fn);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
403 gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
404
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
405 tmp = g_strdup_printf(_("File Info - %s"), g_basename(fn));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
406 gtk_window_set_title(GTK_WINDOW(window), tmp);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
407 g_free(tmp);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
408 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
409
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
410 static GtkWidget *wv_configurewin = NULL;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
411 static GtkWidget *vbox, *notebook;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
412 static GtkWidget *rg_switch, *rg_clip_switch, *rg_track_gain, *rg_dyn_bitrate;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
413
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
414 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
415 wv_configurewin_ok(GtkWidget * widget, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
416 {
2523
769e17da93dd Replaced s/ConfigDb/mcs_handle_t/g, as per changes in the core.
Matti Hamalainen <ccr@tnsp.org>
parents: 2499
diff changeset
417 mcs_handle_t *cfg;
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
418 GtkToggleButton *tb;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
419
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
420 tb = GTK_TOGGLE_BUTTON(rg_switch);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
421 replaygainEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
422 tb = GTK_TOGGLE_BUTTON(rg_clip_switch);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
423 clipPreventionEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
424 tb = GTK_TOGGLE_BUTTON(rg_dyn_bitrate);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
425 dynBitrateEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
426 tb = GTK_TOGGLE_BUTTON(rg_track_gain);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
427 albumReplaygainEnabled = !gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
428
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
429 cfg = aud_cfg_db_open();
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
430
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
431 aud_cfg_db_set_bool(cfg, "wavpack", "clip_prevention",
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
432 clipPreventionEnabled);
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
433 aud_cfg_db_set_bool(cfg, "wavpack", "album_replaygain",
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
434 albumReplaygainEnabled);
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
435 aud_cfg_db_set_bool(cfg, "wavpack", "dyn_bitrate", dynBitrateEnabled);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
436 aud_cfg_db_set_bool(cfg, "wavpack", "replaygain", replaygainEnabled);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1677
diff changeset
437 aud_cfg_db_close(cfg);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
438 gtk_widget_destroy(wv_configurewin);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
439 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
440
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
441 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
442 rg_switch_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
443 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
444 gtk_widget_set_sensitive(GTK_WIDGET(data),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
445 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
446 (w)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
447 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
448
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
449 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
450 wv_configure(void)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
451 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
452
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
453 GtkWidget *rg_frame, *rg_vbox;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
454 GtkWidget *bbox, *ok, *cancel;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
455 GtkWidget *rg_type_frame, *rg_type_vbox, *rg_album_gain;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
456
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
457 if (wv_configurewin != NULL) {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
458 gdk_window_raise(wv_configurewin->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
459 return;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
460 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
461
111
5745352e0c88 [svn] - hey, this compiles now. neat :P
nenolod
parents: 109
diff changeset
462 wv_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
463 g_signal_connect(G_OBJECT(wv_configurewin), "destroy",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
464 G_CALLBACK(gtk_widget_destroyed),
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
465 &wv_configurewin);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
466 gtk_window_set_title(GTK_WINDOW(wv_configurewin),
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
467 _("Wavpack Configuration"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
468 gtk_window_set_resizable(GTK_WINDOW(wv_configurewin), FALSE);
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
469 gtk_container_set_border_width(GTK_CONTAINER(wv_configurewin), 10);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
470
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
471 vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
472 gtk_container_add(GTK_CONTAINER(wv_configurewin), vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
473
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
474 notebook = gtk_notebook_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
475 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
476
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
477
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
478 /* Plugin Settings */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
479
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
480 rg_frame = gtk_frame_new(_("General Plugin Settings:"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
481 gtk_container_set_border_width(GTK_CONTAINER(rg_frame), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
482
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
483 rg_vbox = gtk_vbox_new(FALSE, 10);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
484 gtk_container_set_border_width(GTK_CONTAINER(rg_vbox), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
485 gtk_container_add(GTK_CONTAINER(rg_frame), rg_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
486
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
487 rg_dyn_bitrate =
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
488 gtk_check_button_new_with_label(_("Enable Dynamic Bitrate Display"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
489 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_dyn_bitrate),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
490 dynBitrateEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
491 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_dyn_bitrate, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
492
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
493 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), rg_frame,
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
494 gtk_label_new(_("Plugin")));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
495
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
496 /* Replay Gain.. */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
497
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
498 rg_frame = gtk_frame_new(_("ReplayGain Settings:"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
499 gtk_container_set_border_width(GTK_CONTAINER(rg_frame), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
500
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
501 rg_vbox = gtk_vbox_new(FALSE, 10);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
502 gtk_container_set_border_width(GTK_CONTAINER(rg_vbox), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
503 gtk_container_add(GTK_CONTAINER(rg_frame), rg_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
504
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
505 rg_clip_switch =
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
506 gtk_check_button_new_with_label(_("Enable Clipping Prevention"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
507 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_clip_switch),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
508 clipPreventionEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
509 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_clip_switch, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
510
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
511 rg_switch = gtk_check_button_new_with_label(_("Enable ReplayGain"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
512 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_switch),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
513 replaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
514 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_switch, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
515
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
516 rg_type_frame = gtk_frame_new(_("ReplayGain Type:"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
517 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_type_frame, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
518
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
519 g_signal_connect(G_OBJECT(rg_switch), "toggled",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
520 G_CALLBACK(rg_switch_cb), rg_type_frame);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
521
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
522 rg_type_vbox = gtk_vbox_new(FALSE, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
523 gtk_container_set_border_width(GTK_CONTAINER(rg_type_vbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
524 gtk_container_add(GTK_CONTAINER(rg_type_frame), rg_type_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
525
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
526 rg_track_gain =
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
527 gtk_radio_button_new_with_label(NULL, _("use Track Gain/Peak"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
528 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_track_gain),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
529 !albumReplaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
530 gtk_box_pack_start(GTK_BOX(rg_type_vbox), rg_track_gain, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
531
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
532 rg_album_gain =
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
533 gtk_radio_button_new_with_label(gtk_radio_button_get_group
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
534 (GTK_RADIO_BUTTON(rg_track_gain)),
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
535 _("use Album Gain/Peak"));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
536 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_album_gain),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
537 albumReplaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
538 gtk_box_pack_start(GTK_BOX(rg_type_vbox), rg_album_gain, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
539
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
540 gtk_widget_set_sensitive(rg_type_frame, replaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
541
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
542 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), rg_frame,
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
543 gtk_label_new(_("ReplayGain")));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
544
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
545 /* Buttons */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
546
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
547 bbox = gtk_hbutton_box_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
548 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
549 gtk_box_set_spacing(GTK_BOX(bbox), 5);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
550 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
551
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
552 ok = gtk_button_new_with_label(_("Ok"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
553 g_signal_connect(G_OBJECT(ok), "clicked",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
554 G_CALLBACK(wv_configurewin_ok), NULL);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
555 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
556 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
557 gtk_widget_grab_default(ok);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
558
1325
a33da9237bed Several "i18n" improvements.
Stany HENRY <StrassBoy@gmail.com>
parents: 1044
diff changeset
559 cancel = gtk_button_new_with_label(_("Cancel"));
3035
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
560 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
561 G_CALLBACK(gtk_widget_destroy),
13a0e4377c20 Don't use deprecated gtk functions
Tomasz Mon <desowin@gmail.com>
parents: 2971
diff changeset
562 G_OBJECT(wv_configurewin));
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
563 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
564 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
565
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
566 gtk_widget_show_all(wv_configurewin);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
567 }