annotate src/wavpack/ui.cxx @ 439:84029a5250c1 trunk

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