--- xmms-1.0.1/xmms/defskin/text.xpm.flb Fri Jul 30 01:03:14 1999 +++ xmms-1.0.1/xmms/defskin/text.xpm Sun May 7 01:28:09 2000 @@ -1,31 +1,36 @@ /* XPM */ -static char *skin_text[] = { -/* columns rows colors chars-per-pixel */ -"155 18 7 1", -" c #0a121a", -". c #0a1a2b", -"X c #082a48", -"o c #115794", -"O c #1a7ed7", -"+ c #1a84e1", -"@ c #2499ff", -/* pixels */ -"X@@X @@@X X@@X @@@X @@@@ @@@@ X@@X @ @ @@@ @@@ @ @ @ @ @ @ @ X@@X @@@X X@@X @@@X X@@X @@@ @ @ @ @ @ @ @ @ @ @ @@@@ @ @ o@@o ", -"@oo@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @oo@ @@X@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ o@ @ @ o@ @o ", -"@ @ @@@X @ @ @ @ @ @ @ @ @ @ @@o @ @@@@ @X@@ @ @ @ @ @ @ @ @ X@ @ @ @ @ @ @ @ o++o @ @ X@X @ @@ @ ", -"@@@@ @ @ @ @ @ @@@o @@@o @ @@ @@@@ @ @ @ @X @ @oo@ @ @ @ @ @@@X @oX@ @@@X @X @ @ @ @ @ @oo@ @ @ X@@@ X@X @ @@@@ ", -"@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ o+ @ @ @ @ @ @ @ @ @X@@ @ @ @ @ @ @ @ +oo+ @@@@ @ @ @ @o o@ @ ", -"@ @ @@@X X@@X @@@X @@@@ @ X@@@ @ @ @@@ X@@X @ @ @@@@ @ @ @ @ X@@X @ X@@@ @ @ X@@X @ X@@@ X++X @ @ @ @ @@X @@@@ o@@o ", -"X@@X X@ X@@X X@@X @ @@@@ X@@X @@@@ X@@X X@@X X@ @X @ @ @ @@ @@ @ o@o ++ @ @@ ", -"@ @ @@ @ @ @ @ @@ @ @ @ o@ @ @ @ @ @@ +o o+ @ @ @ @ @ @ @ @ @ @ @ ++ @ @@@ o@+ @@@@ ", -"@@ @ @ @ @X @ @ @@@X @@@ @ o@@o @ @ @ @ @ @@@@@ @ @ @ @ @ @ o@ @ @@ @@ ", -"@ @@ @ @ @ @ @ @ @ @ +o @ @ X@@@ @ @ @@@@ @ @ @ @ @ @ @o+@ @ @@@ @@ @@@@ ", -"@ @ @ @ @ @ @@@@ @ @ @ @ @ @ @ @ @@ +o o+ @ @ @ @ @ @ @ @ ++ @ +@o @@ ", -"X@@X @ @@@@ X@@X @ X@@X X@@X @ X@@X @@X @ @ @@@ X@ @X @ @@@@@ @@ @@ @@ o@o@ ++ @ @ ", -"o++o @ @ @ @ @@ ", -"@ @ X@@X @ @ XX ", -"o@@o @ @ X@@X @ o++o ", -"@ @ @ @ @ @ o@ o@@o ", -"@@@@ @ @ @@@@ XOOX ", -"@ @ X@@X @ @ o@ .. " -}; +static char * skin_text[] = { +"155 24 9 1", +" c None", +". c #082A48", +"+ c #2499FF", +"@ c #0A121A", +"# c #115794", +"$ c #1A84E1", +"% c #1A7ED7", +"& c #0A1A2B", +"* c #218CEA", +".++.@+++.@.++.@+++.@++++@++++@.++.@+@@+@@+++@@+++@+@@+@+@@@@+@@+@+@@+@.++.@+++.@.++.@+++.@.++.@@+++@+@@+@+@@+@+@@+@+@@+@+@@+@++++@@+@+@@@#++#@@@@@@@@@@@@@@", +"+##+@+@@+@+@@+@+@@+@+@@@@+@@@@+@@+@+@@+@@@+@@@@@+@+@+@@+@@@@+##+@++.+@+@@+@+@@+@+@@+@+@@+@+@@+@@@+@@+@@+@+@@+@+@@+@+@@+@+@@+@@@#+@@+@+@@#+@@+#@@@@@@@@@@@@@", +"+@@+@+++.@+@@@@+@@+@+@@@@+@@@@+@@@@+@@+@@@+@@@@@+@++#@@+@@@@++++@+.++@+@@+@+@@+@+@@+@+@@+@.+@@@@@+@@+@@+@+@@+@+@@+@#$$#@+@@+@@.+.@@@@@@@+@++@+@@@@@@@@@@@@@", +"++++@+@@+@+@@@@+@@+@+++#@+++#@+@++@++++@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@**@*@@++@@@***@@**@@@****@@@*@"}; --- xmms-1.0.1/xmms/main.c.flb Sun May 7 01:28:09 2000 +++ xmms-1.0.1/xmms/main.c Sun May 7 01:28:09 2000 @@ -2977,6 +2977,9 @@ parse_cmd_line(argc, argv, TRUE); exit(0); } +#ifndef NO_FLB_FIX + gtk_set_locale(); +#endif gtk_init(&argc, &argv); /* Initialize the xmms dga stuff, this needs to come before we --- xmms-1.0.1/xmms/textbox.c.flb Thu Jan 13 01:59:06 2000 +++ xmms-1.0.1/xmms/textbox.c Sun May 7 01:28:09 2000 @@ -213,6 +213,27 @@ x = 5 * (tb->tb_text[i] - '0'); y = 6; } +#ifndef NO_FLB_FIX + else if (tb->tb_text[i] >= 'à' && tb->tb_text[i] <= 'þ') + { + gint width, height; + gdk_window_get_size(get_skin_pixmap(tb->tb_skin_index), + &width,&height); + if (height>18) { + x = 5 * (tb->tb_text[i] - 'à'); + if ( x < 0 ) x = 5 * ('U' - 'A'); + y = 18; + } else { + x = 5 * (tb->tb_text[i] - 'à' - 1); + y = 0; + } + } + else if (tb->tb_text[i] == 'ÿ') + { + x = 130; + y = 0; + } +#endif else { switch (tb->tb_text[i]) --- xmms-1.0.1/Input/mpg123/mpg123.h.flb Thu Jan 27 23:30:37 2000 +++ xmms-1.0.1/Input/mpg123/mpg123.h Sun May 7 01:28:09 2000 @@ -150,6 +150,9 @@ gboolean cast_title_streaming; gchar *id3_format; gboolean use_id3; +#ifndef NO_FLB_FIX + gboolean id3_in_cp1251; +#endif gboolean detect_by_content; } MPG123Config; --- xmms-1.0.1/Input/mpg123/configure.c.flb Sun Sep 26 11:27:25 1999 +++ xmms-1.0.1/Input/mpg123/configure.c Sun May 7 01:28:09 2000 @@ -34,7 +34,7 @@ static GtkWidget *streaming_save_dirbrowser; static GtkWidget *streaming_cast_frame, *streaming_cast_title; static GtkWidget *title_frame, *title_id3_vbox, *title_id3_use, *title_id3_box, - *title_id3_entry, *title_id3_label; + *title_id3_entry, *title_id3_label, *title_id3_cp1251; static GtkWidget *title_id3_desc_box, *title_id3_desc_label1, *title_id3_desc_label2; static GtkWidget *bbox, *ok, *cancel; @@ -100,6 +100,7 @@ mpg123_cfg.use_id3 = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_id3_use)); g_free(mpg123_cfg.id3_format); mpg123_cfg.id3_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_id3_entry))); + mpg123_cfg.id3_in_cp1251 = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_id3_cp1251)); filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL); cfg = xmms_cfg_open_file(filename); @@ -128,6 +129,7 @@ xmms_cfg_write_boolean(cfg, "MPG123", "cast_title_streaming", mpg123_cfg.cast_title_streaming); xmms_cfg_write_boolean(cfg, "MPG123", "use_id3", mpg123_cfg.use_id3); xmms_cfg_write_string(cfg, "MPG123", "id3_format", mpg123_cfg.id3_format); + xmms_cfg_write_boolean(cfg, "MPG123", "id3_in_cp1251", mpg123_cfg.id3_in_cp1251); xmms_cfg_write_boolean(cfg, "MPG123", "detect_by_content", mpg123_cfg.detect_by_content); xmms_cfg_write_file(cfg, filename); xmms_cfg_free(cfg); @@ -191,6 +193,7 @@ gtk_widget_set_sensitive(title_id3_box, use_id3); gtk_widget_set_sensitive(title_id3_desc_box, use_id3); + gtk_widget_set_sensitive(title_id3_cp1251, use_id3); } static void configure_destroy(GtkWidget * w, gpointer data) @@ -558,6 +561,12 @@ gtk_box_pack_start(GTK_BOX(title_id3_desc_box), title_id3_desc_label2, TRUE, TRUE, 0); gtk_widget_show(title_id3_desc_label2); gtk_widget_show(title_id3_desc_box); + + title_id3_cp1251 = gtk_check_button_new_with_label("ID3 tags in windows-1251 encoding"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3_cp1251), mpg123_cfg.id3_in_cp1251); + gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_cp1251, FALSE, FALSE, 0); + gtk_widget_show(title_id3_cp1251); + gtk_widget_show(title_id3_vbox); gtk_widget_show(title_frame); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, gtk_label_new("Title")); --- xmms-1.0.1/Input/mpg123/mpg123.c.flb Thu Jan 27 23:30:37 2000 +++ xmms-1.0.1/Input/mpg123/mpg123.c Sun May 7 01:28:09 2000 @@ -5,6 +5,7 @@ #include #include #include +#include static long outscale = 32768; @@ -161,6 +162,7 @@ xmms_cfg_read_boolean(cfg, "MPG123", "use_id3", &mpg123_cfg.use_id3); if (!xmms_cfg_read_string(cfg, "MPG123", "id3_format", &mpg123_cfg.id3_format)) mpg123_cfg.id3_format = g_strdup("%1 - %2"); + xmms_cfg_read_boolean(cfg, "MPG123", "id3_in_cp1251", &mpg123_cfg.id3_in_cp1251); xmms_cfg_read_boolean(cfg, "MPG123", "detect_by_content", &mpg123_cfg.detect_by_content); xmms_cfg_free(cfg); @@ -614,6 +616,26 @@ */ ret = eval_id3_format(mpg123_cfg.id3_format, tag, filename); + if (mpg123_cfg.id3_in_cp1251) { + iconv_t cd; + size_t inlen, outlen, num; + gchar *out, *outptr; + const gchar *inptr; + cd = iconv_open("KOI8-R","CP1251"); + if ( cd != (iconv_t)-1 ) { + inptr = ret; + outlen = inlen = strlen(ret); + outptr = out = g_malloc(inlen+1); + num = iconv(cd,&inptr,&inlen,&outptr,&outlen); + iconv_close(cd); + if (num!=-1) { + *outptr = 0; + g_free(ret); + ret = out; + } else + g_free(out); + } + } } if (!ret) --- xmms-1.0.1/Input/mpg123/fileinfo.c.flb Mon Aug 30 22:36:29 1999 +++ xmms-1.0.1/Input/mpg123/fileinfo.c Sun May 7 18:25:09 2000 @@ -3,6 +3,7 @@ #include #include #include "mpg123.h" +#include static GtkWidget *window = NULL, *hbox, *vbox, *id3_frame, *table, *mpeg_frame, *mpeg_box; static GtkWidget *title_label, *title_entry; @@ -11,6 +12,7 @@ static GtkWidget *year_label, *year_entry; static GtkWidget *comment_label, *comment_entry; static GtkWidget *genre_label, *genre_combo; +static GtkWidget *cbbox, *cp1251tokoi8, *koi8tocp1251; static GtkWidget *bbox, *save, *remove_id3, *cancel; static GtkWidget *mpeg_level, *mpeg_bitrate, *mpeg_samplerate, *mpeg_flags; static GtkWidget *mpeg_fileinfo; @@ -43,6 +45,29 @@ gtk_widget_show(dialog); } +static gchar* convert_cp(const gchar *in, const gchar* to, const gchar* from) +{ + iconv_t cd; + size_t inlen, outlen, num; + gchar *outptr, *out; + const gchar *inptr; + + cd = iconv_open(to,from); + if ( cd != (iconv_t)-1 ) { + inptr = in; + outlen = inlen = strlen(in); + outptr = out = g_malloc(inlen+1); + num = iconv(cd,&inptr,&inlen,&outptr,&outlen); + iconv_close(cd); + if (num!=-1) + *outptr = 0; + else + out = strcpy(out,in); + } else + out = g_strdup(in); + return out; +} + static void set_entry_tag(GtkEntry * entry, gchar * tag, gint length) { gint stripped_len; @@ -50,6 +75,12 @@ stripped_len = mpg123_strip_spaces(tag, length); text = g_strdup_printf("%-*.*s", stripped_len, stripped_len, tag); + if (mpg123_cfg.id3_in_cp1251) { + gchar* out; + out = convert_cp(text,"KOI8-R","CP1251"); + g_free(text); + text = out; + } gtk_entry_set_text(entry, text); g_free(text); } @@ -59,6 +90,14 @@ gchar *text; text = gtk_entry_get_text(entry); + if (mpg123_cfg.id3_in_cp1251) { + gchar *out; + out = convert_cp(text,"CP1251","KOI8-R"); + memset(tag, ' ', length); + memcpy(tag, out, strlen(out) > length ? length : strlen(out)); + g_free(out); + return; + } memset(tag, ' ', length); memcpy(tag, text, strlen(text) > length ? length : strlen(text)); } @@ -139,6 +178,33 @@ gtk_widget_destroy(window); } +static void convert_entry(const gchar* to, const gchar* from) +{ + gchar* temp; + temp = convert_cp(gtk_entry_get_text(GTK_ENTRY(title_entry)),to,from); + gtk_entry_set_text(GTK_ENTRY(title_entry),temp); + g_free(temp); + temp = convert_cp(gtk_entry_get_text(GTK_ENTRY(artist_entry)),to,from); + gtk_entry_set_text(GTK_ENTRY(artist_entry),temp); + g_free(temp); + temp = convert_cp(gtk_entry_get_text(GTK_ENTRY(album_entry)),to,from); + gtk_entry_set_text(GTK_ENTRY(album_entry),temp); + g_free(temp); + temp = convert_cp(gtk_entry_get_text(GTK_ENTRY(comment_entry)),to,from); + gtk_entry_set_text(GTK_ENTRY(comment_entry),temp); + g_free(temp); +} + +static void convert_to_koi(GtkWidget * w, gpointer data) +{ + convert_entry("KOI8-R","CP1251"); +} + +static void convert_to_cp1251(GtkWidget * w, gpointer data) +{ + convert_entry("CP1251","KOI8-R"); +} + void mpg123_file_info_box(char *filename) { gint i; @@ -168,7 +234,7 @@ id3_frame = gtk_frame_new("ID3 Tag:"); gtk_box_pack_start(GTK_BOX(vbox), id3_frame, FALSE, FALSE, 0); - table = gtk_table_new(4, 5, FALSE); + table = gtk_table_new(4, 6, FALSE); gtk_container_set_border_width(GTK_CONTAINER(table), 5); gtk_container_add(GTK_CONTAINER(id3_frame), table); @@ -237,6 +303,22 @@ gtk_table_attach(GTK_TABLE(table), genre_combo, 3, 4, 4, 5, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); gtk_widget_show(genre_combo); + cbbox = gtk_hbutton_box_new(); + gtk_button_box_set_layout(GTK_BUTTON_BOX(cbbox), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(cbbox), 5); + gtk_table_attach(GTK_TABLE(table), cbbox, 1, 4, 5, 6, GTK_FILL, GTK_FILL, 5, 5); + + cp1251tokoi8 = gtk_button_new_with_label("cp1251->koi8"); + gtk_signal_connect(GTK_OBJECT(cp1251tokoi8), "clicked", GTK_SIGNAL_FUNC(convert_to_koi), NULL); + gtk_box_pack_start(GTK_BOX(cbbox), cp1251tokoi8, TRUE, TRUE, 0); + gtk_widget_show(cp1251tokoi8); + + koi8tocp1251 = gtk_button_new_with_label("koi8->cp1251"); + gtk_signal_connect(GTK_OBJECT(koi8tocp1251), "clicked", GTK_SIGNAL_FUNC(convert_to_cp1251), NULL); + gtk_box_pack_start(GTK_BOX(cbbox), koi8tocp1251, TRUE, TRUE, 0); + gtk_widget_show(koi8tocp1251); + + gtk_widget_show(cbbox); gtk_widget_show(id3_frame); gtk_widget_show(table); --- xmms-1.0.1/Input/cdaudio/cdaudio.c.flb Thu Jan 27 23:30:36 2000 +++ xmms-1.0.1/Input/cdaudio/cdaudio.c Sun May 7 01:28:09 2000 @@ -33,6 +33,8 @@ static void get_song_info(char *filename, char **title, int *length); static void get_volume(int *l, int *r); static void set_volume(int l, int r); + +guint32 cdaudio_cached_id = 0; void cdda_fileinfo(gchar *filename); InputPlugin cdda_ip = @@ -59,7 +61,7 @@ NULL, /* set_info, filled in by xmms */ NULL, /* set_info_text, filled in by xmms */ get_song_info, - NULL, /* cdda_fileinfo, */ /* file_info_box */ + cdda_fileinfo, /* file_info_box */ NULL /* output plugin handle */ }; @@ -238,7 +240,6 @@ static char * cdda_get_title(cdda_disc_toc_t *toc, gint track) { - static guint32 cached_id; static cdinfo_t cdinfo; static pthread_mutex_t title_mutex = PTHREAD_MUTEX_INITIALIZER; guint32 disc_id; @@ -253,10 +254,10 @@ */ pthread_mutex_lock(&title_mutex); - if (!(disc_id == cached_id && cdinfo.is_valid)) + if (!(disc_id == cdaudio_cached_id && cdinfo.is_valid)) { cdda_cdinfo_flush(&cdinfo); - cached_id = disc_id; + cdaudio_cached_id = disc_id; if (!cdda_cdinfo_read_file(disc_id, &cdinfo)) { --- xmms-1.0.1/Input/cdaudio/fileinfo.c.flb Sun May 7 01:28:09 2000 +++ xmms-1.0.1/Input/cdaudio/fileinfo.c Sun May 7 01:28:09 2000 @@ -0,0 +1,180 @@ + +#include +#include +#include +#include "cdaudio.h" + +static GtkWidget *window = NULL, *vbox, *frame, *table; +static GtkWidget *title_label, *title_entry; +static GtkWidget *artist_label, *artist_entry; +static GtkWidget *album_label, *album_entry; +static GtkWidget *cdartist_label, *cdartist_entry; +static GtkWidget *bbox, *save, *cancel; + +extern guint32 cdaudio_cached_id; +static cdda_disc_toc_t filebox_toc; +static cdinfo_t filebox_cd; +static guint32 filebox_disc_id; +static int filebox_track = 0; + +static void save_cb(GtkWidget * w, gpointer data) +{ + gchar* tmp; + + g_free(filebox_cd.artname); + g_free(filebox_cd.albname); + if (filebox_cd.tracks[filebox_track].num!=-1) { + g_free(filebox_cd.tracks[filebox_track].title); + g_free(filebox_cd.tracks[filebox_track].artist); + filebox_cd.tracks[filebox_track].title = NULL; + filebox_cd.tracks[filebox_track].artist = NULL; + } + + tmp = g_strchomp(g_strdup(gtk_entry_get_text(GTK_ENTRY(title_entry)))); + if (strlen(tmp)) + filebox_cd.tracks[filebox_track].title = tmp; + tmp = g_strchomp(g_strdup(gtk_entry_get_text(GTK_ENTRY(artist_entry)))); + if (strlen(tmp)) + filebox_cd.tracks[filebox_track].artist = tmp; + filebox_cd.tracks[filebox_track].num = filebox_track; + filebox_cd.albname = + g_strchomp(g_strdup(gtk_entry_get_text(GTK_ENTRY(album_entry)))); + filebox_cd.artname = + g_strchomp(g_strdup(gtk_entry_get_text(GTK_ENTRY(cdartist_entry)))); + + cdaudio_cached_id = 0; + + cdda_cdinfo_write_file(filebox_disc_id,&filebox_cd); + + gtk_widget_destroy(window); +} + +void cdda_fileinfo(char *filename) +{ + gint i, len; + gint fd; + gchar *tmp, *name, *title; + + if (!window) + { + window = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &window); + gtk_container_set_border_width(GTK_CONTAINER(window), 10); + + vbox = gtk_vbox_new(FALSE, 10); + gtk_container_add(GTK_CONTAINER(window), vbox); + + frame = gtk_frame_new("CD Track Info:"); + gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0); + + table = gtk_table_new(4, 4, FALSE); + gtk_container_set_border_width(GTK_CONTAINER(table), 5); + gtk_container_add(GTK_CONTAINER(frame), table); + + title_label = gtk_label_new("Track Title:"); + gtk_misc_set_alignment(GTK_MISC(title_label), 1, 0.5); + gtk_table_attach(GTK_TABLE(table), title_label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 5, 5); + gtk_widget_show(title_label); + + title_entry = gtk_entry_new_with_max_length(99); + gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); + gtk_widget_show(title_entry); + + artist_label = gtk_label_new("Artist:"); + gtk_misc_set_alignment(GTK_MISC(artist_label), 1, 0.5); + gtk_table_attach(GTK_TABLE(table), artist_label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 5, 5); + gtk_widget_show(artist_label); + + artist_entry = gtk_entry_new_with_max_length(99); + gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); + gtk_widget_show(artist_entry); + + album_label = gtk_label_new("CD Album Name:"); + gtk_misc_set_alignment(GTK_MISC(album_label), 1, 0.5); + gtk_table_attach(GTK_TABLE(table), album_label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 5, 5); + gtk_widget_show(album_label); + + album_entry = gtk_entry_new_with_max_length(99); + gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); + gtk_widget_show(album_entry); + + cdartist_label = gtk_label_new("CD Artist:"); + gtk_misc_set_alignment(GTK_MISC(cdartist_label), 1, 0.5); + gtk_table_attach(GTK_TABLE(table), cdartist_label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 5, 5); + gtk_widget_show(cdartist_label); + + cdartist_entry = gtk_entry_new_with_max_length(99); + gtk_table_attach(GTK_TABLE(table), cdartist_entry, 1, 4, 3, 4, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); + gtk_widget_show(cdartist_entry); + + gtk_widget_show(table); + gtk_widget_show(frame); + + bbox = gtk_hbutton_box_new(); + gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); + gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); + + save = gtk_button_new_with_label("Save"); + gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(save_cb), NULL); + GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT); + gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0); + gtk_widget_show(save); + gtk_widget_grab_default(save); + + cancel = gtk_button_new_with_label("Cancel"); + gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window)); + GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); + gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); + gtk_widget_show(cancel); + + gtk_widget_show(bbox); + gtk_widget_show(vbox); + gtk_widget_show(window); + } + + name = strrchr(filename, '/'); + if (name) + name++; + else + name = filename; + + if (!sscanf(name, "Track %d.cda", &filebox_track)) + return; + + if (!cdda_get_toc(&filebox_toc)) + return; + if ( filebox_track < filebox_toc.first_track || + filebox_track > filebox_toc.last_track || + filebox_toc.track[filebox_track].flags.data_track) + return; + filebox_disc_id = cdda_cddb_compute_discid(&filebox_toc); + + cdda_cdinfo_flush(&filebox_cd); + cdda_cdinfo_read_file(filebox_disc_id, &filebox_cd); + + title = g_strdup_printf("File Info - %s", name); + gtk_window_set_title(GTK_WINDOW(window), title); + g_free(title); + + if (filebox_cd.tracks[filebox_track].num!=-1) { + gtk_entry_set_text(GTK_ENTRY(title_entry), + filebox_cd.tracks[filebox_track].title); + gtk_entry_set_text(GTK_ENTRY(artist_entry), + filebox_cd.tracks[filebox_track].artist); + } else { + title = g_strdup(name); + if (tmp = strrchr(title, '.')) + *tmp = '\0'; + gtk_entry_set_text(GTK_ENTRY(title_entry), title); + g_free(title); + gtk_entry_set_text(GTK_ENTRY(artist_entry), ""); + } + if (filebox_cd.albname) { + gtk_entry_set_text(GTK_ENTRY(album_entry), filebox_cd.albname); + gtk_entry_set_text(GTK_ENTRY(cdartist_entry), filebox_cd.artname); + } else { + gtk_entry_set_text(GTK_ENTRY(album_entry), ""); + gtk_entry_set_text(GTK_ENTRY(cdartist_entry), ""); + } +} --- xmms-1.0.1/Input/cdaudio/Makefile.am.flb Thu Jan 27 23:30:36 2000 +++ xmms-1.0.1/Input/cdaudio/Makefile.am Sun May 7 01:28:09 2000 @@ -13,7 +13,8 @@ http.h \ cdindex.c \ sha_func.c \ -sha.h +sha.h \ +fileinfo.c else @@ -23,7 +24,7 @@ endif -EXTRA_DIST = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h +EXTRA_DIST = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h fileinfo.c lib_LTLIBRARIES = $(cdaudioltlibs) --- xmms-1.0.1/Input/cdaudio/Makefile.in.flb Mon Jan 31 21:44:37 2000 +++ xmms-1.0.1/Input/cdaudio/Makefile.in Sun May 7 01:28:09 2000 @@ -128,10 +128,10 @@ @HAVE_CDROM_FALSE@cdaudioltlibs = @HAVE_CDROM_TRUE@cdaudioldflags = -module -avoid-version @HAVE_CDROM_FALSE@cdaudioldflags = -@HAVE_CDROM_TRUE@cdaudiosources = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h +@HAVE_CDROM_TRUE@cdaudiosources = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h fileinfo.c @HAVE_CDROM_FALSE@cdaudiosources = -EXTRA_DIST = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h +EXTRA_DIST = cdaudio.c configure.c cdaudio.h cdinfo.c cdinfo.h cddb.c cddb.h http.c http.h cdindex.c sha_func.c sha.h fileinfo.c lib_LTLIBRARIES = $(cdaudioltlibs) @@ -154,7 +154,7 @@ libcdaudio_la_DEPENDENCIES = @HAVE_CDROM_FALSE@libcdaudio_la_OBJECTS = @HAVE_CDROM_TRUE@libcdaudio_la_OBJECTS = cdaudio.lo configure.lo \ -@HAVE_CDROM_TRUE@cdinfo.lo cddb.lo http.lo cdindex.lo sha_func.lo +@HAVE_CDROM_TRUE@cdinfo.lo cddb.lo http.lo cdindex.lo sha_func.lo fileinfo.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)