annotate src/wavpack/ui.cxx @ 1333:c4260daee9bf

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