annotate src/wavpack/ui.cxx @ 294:60b7388105ba trunk

[svn] - i hate the world.
author nenolod
date Wed, 22 Nov 2006 15:29:31 -0800
parents 72f0de06bb56
children 7385182ae4b8
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>
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 <iconv.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
17 #include <math.h>
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
18 #include "tags.h"
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 #define DBG(format, args...) fprintf(stderr, format, ## args)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
24
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
25 void load_tag(ape_tag *tag, WavpackContext *ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
26 gboolean clipPreventionEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
27 gboolean dynBitrateEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
28 gboolean replaygainEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
29 gboolean albumReplaygainEnabled;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
30 gboolean openedAudio;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
31 static GtkWidget *window = NULL;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
32 static GtkWidget *title_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
33 static GtkWidget *album_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
34 static GtkWidget *performer_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
35 static GtkWidget *tracknumber_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
36 static GtkWidget *date_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
37 static GtkWidget *genre_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
38 static GtkWidget *user_comment_entry;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
39 static char *filename;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
40
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
41 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
42 wv_about_box()
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
43 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
44 static GtkWidget *about_window;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
45
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
46 if (about_window)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
47 gdk_window_raise(about_window->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
48
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
49 about_window =
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
50 xmms_show_message(g_strdup_printf
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
51 ("Wavpack Decoder Plugin %s", VERSION),
246
366acb77c853 [svn] - i rewrote most of this!
nenolod
parents: 113
diff changeset
52 ("Copyright (c) 2006 William Pitcock <nenolod -at- nenolod.net>\n\n"
366acb77c853 [svn] - i rewrote most of this!
nenolod
parents: 113
diff changeset
53 "Some of the plugin code was by Miles Egan\n"
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
54 "Visit the Wavpack site at http://www.wavpack.com/\n"),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
55 ("Ok"), FALSE, NULL, NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
56 gtk_signal_connect(GTK_OBJECT(about_window), "destroy",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
57 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &about_window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
58 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
59
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
60 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
61 label_set_text(GtkWidget * label, char *str, ...)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
62 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
63 va_list args;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
64 gchar *tempstr;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
65
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
66 va_start(args, str);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
67 tempstr = g_strdup_vprintf(str, args);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
68 va_end(args);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
69
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
70 gtk_label_set_text(GTK_LABEL(label), tempstr);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
71 g_free(tempstr);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
72 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
73
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
74 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
75 remove_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
76 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
77 DeleteTag(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
78 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
79 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
80 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
81
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
82 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
83 save_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
84 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
85 ape_tag Tag;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
86
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
87 strcpy(Tag.title, gtk_entry_get_text(GTK_ENTRY(title_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
88 strcpy(Tag.artist, gtk_entry_get_text(GTK_ENTRY(performer_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
89 strcpy(Tag.album, gtk_entry_get_text(GTK_ENTRY(album_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
90 strcpy(Tag.comment, gtk_entry_get_text(GTK_ENTRY(user_comment_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
91 strcpy(Tag.track, gtk_entry_get_text(GTK_ENTRY(tracknumber_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
92 strcpy(Tag.year, gtk_entry_get_text(GTK_ENTRY(date_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
93 strcpy(Tag.genre, gtk_entry_get_text(GTK_ENTRY(genre_entry)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
94 WriteAPE2Tag(filename, &Tag);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
95 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
96 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
97 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
98
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
99 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
100 close_window(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
101 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
102 g_free(filename);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
103 gtk_widget_destroy(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
104 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
105
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
106 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
107 wv_file_info_box(char *fn)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
108 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
109 gchar *tmp;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
110 gint time, minutes, seconds;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
111 ape_tag tag;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
112
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
113 assert(fn != NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
114 char error_buff[4096]; // TODO: fixme!
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
115 WavpackContext *ctx = WavpackOpenFileInput(fn, error_buff, OPEN_TAGS | OPEN_WVC, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
116 if (ctx == NULL) {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
117 printf("wavpack: Error opening file: \"%s: %s\"\n", fn, error_buff);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
118 return;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
119 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
120 int sample_rate = WavpackGetSampleRate(ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
121 int num_channels = WavpackGetNumChannels(ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
122 load_tag(&tag, ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
123 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
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);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
138 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
139 gtk_signal_connect(GTK_OBJECT(window), "destroy",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
140 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &window);
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
149 label = gtk_label_new("Filename:");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
162 tag_frame = gtk_frame_new("Ape2 Tag");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
169 label = gtk_label_new("Title:");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
181 label = gtk_label_new("Artist:");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
193 label = gtk_label_new("Album:");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
205 label = gtk_label_new("Comment:");
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
218 label = gtk_label_new("Year:");
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();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
224 gtk_widget_set_usize(date_entry, 60, -1);
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
113
daba9f15ca01 [svn] - fix a pango warning
nenolod
parents: 111
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
236 tracknumber_entry = gtk_entry_new_with_max_length(4);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
237 gtk_widget_set_usize(tracknumber_entry, 20, -1);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
238 gtk_table_attach(GTK_TABLE(table), tracknumber_entry, 3, 4, 4,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
239 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
240 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
241 GTK_SHRINK),
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), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
244
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
245 label = gtk_label_new("Genre:");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
246 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
247 gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
248 GTK_FILL, GTK_FILL, 5, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
249
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
250 genre_entry = gtk_entry_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
251 gtk_widget_set_usize(genre_entry, 20, -1);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
252 gtk_table_attach(GTK_TABLE(table), genre_entry, 1, 4, 5,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
253 6,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
254 (GtkAttachOptions) (GTK_FILL | GTK_EXPAND |
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
255 GTK_SHRINK),
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), 0, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
258
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
259 bbox = gtk_hbutton_box_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
260 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
261 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
262 gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
263
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
264 save_button = gtk_button_new_with_label("Save");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
265 gtk_signal_connect(GTK_OBJECT(save_button), "clicked",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
266 GTK_SIGNAL_FUNC(save_cb), NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
267 GTK_WIDGET_SET_FLAGS(save_button, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
268 gtk_box_pack_start(GTK_BOX(bbox), save_button, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
269
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
270 remove_button = gtk_button_new_with_label("Remove Tag");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
271 gtk_signal_connect_object(GTK_OBJECT(remove_button),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
272 "clicked",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
273 GTK_SIGNAL_FUNC(remove_cb), NULL);
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
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
277 cancel_button = gtk_button_new_with_label("Cancel");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
278 gtk_signal_connect_object(GTK_OBJECT(cancel_button),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
279 "clicked",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
280 GTK_SIGNAL_FUNC(close_window), NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
281 GTK_WIDGET_SET_FLAGS(cancel_button, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
282 gtk_box_pack_start(GTK_BOX(bbox), cancel_button, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
283 gtk_widget_grab_default(cancel_button);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
284
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
285 info_frame = gtk_frame_new("Wavpack Info:");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
286 gtk_box_pack_start(GTK_BOX(hbox), info_frame, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
287
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
288 info_box = gtk_vbox_new(FALSE, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
289 gtk_container_add(GTK_CONTAINER(info_frame), info_box);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
290 gtk_container_set_border_width(GTK_CONTAINER(info_box), 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
291 gtk_box_set_spacing(GTK_BOX(info_box), 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
292
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
293 version_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
294 gtk_misc_set_alignment(GTK_MISC(version_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
295 gtk_label_set_justify(GTK_LABEL(version_label),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
296 GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
297 gtk_box_pack_start(GTK_BOX(info_box), version_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
298 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
299
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
300 bits_per_sample_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
301 gtk_misc_set_alignment(GTK_MISC(bits_per_sample_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
302 gtk_label_set_justify(GTK_LABEL(bits_per_sample_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
303 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
304
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
305 bitrate_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
306 gtk_misc_set_alignment(GTK_MISC(bitrate_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
307 gtk_label_set_justify(GTK_LABEL(bitrate_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
308 gtk_box_pack_start(GTK_BOX(info_box), bitrate_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
309
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
310 rate_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
311 gtk_misc_set_alignment(GTK_MISC(rate_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
312 gtk_label_set_justify(GTK_LABEL(rate_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
313 gtk_box_pack_start(GTK_BOX(info_box), rate_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
314
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
315 channel_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
316 gtk_misc_set_alignment(GTK_MISC(channel_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
317 gtk_label_set_justify(GTK_LABEL(channel_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
318 gtk_box_pack_start(GTK_BOX(info_box), channel_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
319
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
320 length_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
321 gtk_misc_set_alignment(GTK_MISC(length_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
322 gtk_label_set_justify(GTK_LABEL(length_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
323 gtk_box_pack_start(GTK_BOX(info_box), length_label, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
324
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
325 filesize_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
326 gtk_misc_set_alignment(GTK_MISC(filesize_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
327 gtk_label_set_justify(GTK_LABEL(filesize_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
328 gtk_box_pack_start(GTK_BOX(info_box), filesize_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
329 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
330
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
331 peakTitle_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
332 gtk_misc_set_alignment(GTK_MISC(peakTitle_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
333 gtk_label_set_justify(GTK_LABEL(peakTitle_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
334 gtk_box_pack_start(GTK_BOX(info_box), peakTitle_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
335 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
336
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
337 peakAlbum_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
338 gtk_misc_set_alignment(GTK_MISC(peakAlbum_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
339 gtk_label_set_justify(GTK_LABEL(peakAlbum_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
340 gtk_box_pack_start(GTK_BOX(info_box), peakAlbum_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
341 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
342
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
343 gainTitle_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
344 gtk_misc_set_alignment(GTK_MISC(gainTitle_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
345 gtk_label_set_justify(GTK_LABEL(gainTitle_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
346 gtk_box_pack_start(GTK_BOX(info_box), gainTitle_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
347 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
348
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
349 gainAlbum_label = gtk_label_new("");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
350 gtk_misc_set_alignment(GTK_MISC(gainAlbum_label), 0, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
351 gtk_label_set_justify(GTK_LABEL(gainAlbum_label), GTK_JUSTIFY_LEFT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
352 gtk_box_pack_start(GTK_BOX(info_box), gainAlbum_label, FALSE,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
353 FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
354
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
355 gtk_widget_show_all(window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
356 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
357 else
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
358 gdk_window_raise(window->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
359
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
360 gtk_widget_set_sensitive(tag_frame, TRUE);
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_label_set_text(GTK_LABEL(version_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
363 gtk_label_set_text(GTK_LABEL(bits_per_sample_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
364 gtk_label_set_text(GTK_LABEL(bitrate_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
365 gtk_label_set_text(GTK_LABEL(rate_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
366 gtk_label_set_text(GTK_LABEL(channel_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
367 gtk_label_set_text(GTK_LABEL(length_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
368 gtk_label_set_text(GTK_LABEL(filesize_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
369 gtk_label_set_text(GTK_LABEL(peakTitle_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
370 gtk_label_set_text(GTK_LABEL(peakAlbum_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
371 gtk_label_set_text(GTK_LABEL(gainTitle_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
372 gtk_label_set_text(GTK_LABEL(gainAlbum_label), "");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
373
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
374 time = WavpackGetNumSamples(ctx) / WavpackGetSampleRate(ctx);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
375 minutes = time / 60;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
376 seconds = time % 60;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
377
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
378 label_set_text(version_label, "version %d", WavpackGetVersion(ctx));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
379 label_set_text(bitrate_label, "average bitrate: %6.1f kbps", WavpackGetAverageBitrate(ctx, 0) / 1000);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
380 label_set_text(rate_label, "samplerate: %d Hz", WavpackGetSampleRate(ctx));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
381 label_set_text(bits_per_sample_label, "bits per sample: %d", WavpackGetBitsPerSample(ctx));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
382 label_set_text(channel_label, "channels: %d", WavpackGetNumChannels(ctx));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
383 label_set_text(length_label, "length: %d:%.2d", minutes, seconds);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
384 label_set_text(filesize_label, "file size: %d Bytes", WavpackGetFileSize(ctx));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
385 /*
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
386 label_set_text(peakTitle_label, "Title Peak: %5u", 100);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
387 label_set_text(peakAlbum_label, "Album Peak: %5u", 100);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
388 label_set_text(gainTitle_label, "Title Gain: %-+5.2f dB", 100.0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
389 label_set_text(gainAlbum_label, "Album Gain: %-+5.2f dB", 100.0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
390 */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
391 label_set_text(peakTitle_label, "Title Peak: ?");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
392 label_set_text(peakAlbum_label, "Album Peak: ?");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
393 label_set_text(gainTitle_label, "Title Gain: ?");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
394 label_set_text(gainAlbum_label, "Album Gain: ?");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
395
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
396 gtk_entry_set_text(GTK_ENTRY(title_entry), tag.title);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
397 gtk_entry_set_text(GTK_ENTRY(performer_entry), tag.artist);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
398 gtk_entry_set_text(GTK_ENTRY(album_entry), tag.album);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
399 gtk_entry_set_text(GTK_ENTRY(user_comment_entry), tag.comment);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
400 gtk_entry_set_text(GTK_ENTRY(genre_entry), tag.genre);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
401 gtk_entry_set_text(GTK_ENTRY(tracknumber_entry), tag.track);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
402 gtk_entry_set_text(GTK_ENTRY(date_entry), tag.year);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
403 gtk_entry_set_text(GTK_ENTRY(filename_entry), fn);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
404 gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
405
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
406 tmp = g_strdup_printf("File Info - %s", g_basename(fn));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
407 gtk_window_set_title(GTK_WINDOW(window), tmp);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
408 g_free(tmp);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
409 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
410
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
411 static GtkWidget *wv_configurewin = NULL;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
412 static GtkWidget *vbox, *notebook;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
413 static GtkWidget *rg_switch, *rg_clip_switch, *rg_track_gain, *rg_dyn_bitrate;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
414
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
415 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
416 wv_configurewin_ok(GtkWidget * widget, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
417 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
418 ConfigDb *cfg;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
419 GtkToggleButton *tb;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
420
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
421 tb = GTK_TOGGLE_BUTTON(rg_switch);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
422 replaygainEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
423 tb = GTK_TOGGLE_BUTTON(rg_clip_switch);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
424 clipPreventionEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
425 tb = GTK_TOGGLE_BUTTON(rg_dyn_bitrate);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
426 dynBitrateEnabled = gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
427 tb = GTK_TOGGLE_BUTTON(rg_track_gain);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
428 albumReplaygainEnabled = !gtk_toggle_button_get_active(tb);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
429
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
430 cfg = bmp_cfg_db_open();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
431
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
432 bmp_cfg_db_set_bool(cfg, "wavpack", "clip_prevention",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
433 clipPreventionEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
434 bmp_cfg_db_set_bool(cfg, "wavpack", "album_replaygain",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
435 albumReplaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
436 bmp_cfg_db_set_bool(cfg, "wavpack", "dyn_bitrate", dynBitrateEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
437 bmp_cfg_db_set_bool(cfg, "wavpack", "replaygain", replaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
438 bmp_cfg_db_close(cfg);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
439 gtk_widget_destroy(wv_configurewin);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
440 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
441
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
442 static void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
443 rg_switch_cb(GtkWidget * w, gpointer data)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
444 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
445 gtk_widget_set_sensitive(GTK_WIDGET(data),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
446 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
447 (w)));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
448 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
449
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
450 void
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
451 wv_configure(void)
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
452 {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
453
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
454 GtkWidget *rg_frame, *rg_vbox;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
455 GtkWidget *bbox, *ok, *cancel;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
456 GtkWidget *rg_type_frame, *rg_type_vbox, *rg_album_gain;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
457
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
458 if (wv_configurewin != NULL) {
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
459 gdk_window_raise(wv_configurewin->window);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
460 return;
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
461 }
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
462
111
5745352e0c88 [svn] - hey, this compiles now. neat :P
nenolod
parents: 109
diff changeset
463 wv_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
109
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
464 gtk_signal_connect(GTK_OBJECT(wv_configurewin), "destroy",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
465 GTK_SIGNAL_FUNC(gtk_widget_destroyed),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
466 &wv_configurewin);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
467 gtk_window_set_title(GTK_WINDOW(wv_configurewin),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
468 "Musepack Configuration");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
469 gtk_window_set_policy(GTK_WINDOW(wv_configurewin), FALSE, FALSE, FALSE);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
470 gtk_container_border_width(GTK_CONTAINER(wv_configurewin), 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
471
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
472 vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
473 gtk_container_add(GTK_CONTAINER(wv_configurewin), vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
474
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
475 notebook = gtk_notebook_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
476 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
477
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
478
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
479 /* Plugin Settings */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
480
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
481 rg_frame = gtk_frame_new("General Plugin Settings:");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
482 gtk_container_border_width(GTK_CONTAINER(rg_frame), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
483
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
484 rg_vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
485 gtk_container_border_width(GTK_CONTAINER(rg_vbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
486 gtk_container_add(GTK_CONTAINER(rg_frame), rg_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
487
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
488 rg_dyn_bitrate =
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
489 gtk_check_button_new_with_label("Enable Dynamic Bitrate Display");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
490 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_dyn_bitrate),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
491 dynBitrateEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
492 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
493
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
494 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), rg_frame,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
495 gtk_label_new("Plugin"));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
496
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
497 /* Replay Gain.. */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
498
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
499 rg_frame = gtk_frame_new("ReplayGain Settings:");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
500 gtk_container_border_width(GTK_CONTAINER(rg_frame), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
501
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
502 rg_vbox = gtk_vbox_new(FALSE, 10);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
503 gtk_container_border_width(GTK_CONTAINER(rg_vbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
504 gtk_container_add(GTK_CONTAINER(rg_frame), rg_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
505
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
506 rg_clip_switch =
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
507 gtk_check_button_new_with_label("Enable Clipping Prevention");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
508 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_clip_switch),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
509 clipPreventionEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
510 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
511
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
512 rg_switch = gtk_check_button_new_with_label("Enable ReplayGain");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
513 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_switch),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
514 replaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
515 gtk_box_pack_start(GTK_BOX(rg_vbox), rg_switch, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
516
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
517 rg_type_frame = gtk_frame_new("ReplayGain Type:");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
518 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
519
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
520 gtk_signal_connect(GTK_OBJECT(rg_switch), "toggled",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
521 GTK_SIGNAL_FUNC(rg_switch_cb), rg_type_frame);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
522
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
523 rg_type_vbox = gtk_vbox_new(FALSE, 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
524 gtk_container_set_border_width(GTK_CONTAINER(rg_type_vbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
525 gtk_container_add(GTK_CONTAINER(rg_type_frame), rg_type_vbox);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
526
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
527 rg_track_gain =
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
528 gtk_radio_button_new_with_label(NULL, "use Track Gain/Peak");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
529 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_track_gain),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
530 !albumReplaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
531 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
532
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
533 rg_album_gain =
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
534 gtk_radio_button_new_with_label(gtk_radio_button_group
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
535 (GTK_RADIO_BUTTON(rg_track_gain)),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
536 "use Album Gain/Peak");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
537 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rg_album_gain),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
538 albumReplaygainEnabled);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
539 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
540
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
541 gtk_widget_set_sensitive(rg_type_frame, replaygainEnabled);
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_notebook_append_page(GTK_NOTEBOOK(notebook), rg_frame,
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
544 gtk_label_new("ReplayGain"));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
545
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
546 /* Buttons */
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
547
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
548 bbox = gtk_hbutton_box_new();
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
549 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
550 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
551 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
552
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
553 ok = gtk_button_new_with_label("Ok");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
554 gtk_signal_connect(GTK_OBJECT(ok), "clicked",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
555 GTK_SIGNAL_FUNC(wv_configurewin_ok), NULL);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
556 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
557 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
558 gtk_widget_grab_default(ok);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
559
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
560 cancel = gtk_button_new_with_label("Cancel");
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
561 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked",
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
562 GTK_SIGNAL_FUNC(gtk_widget_destroy),
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
563 GTK_OBJECT(wv_configurewin));
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
564 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
565 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
566
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
567 gtk_widget_show_all(wv_configurewin);
38ce41606f10 [svn] - wavpack input plugin -- under construction
nenolod
parents:
diff changeset
568 }