You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(315) |
Feb
(50) |
Mar
(36) |
Apr
(200) |
May
(65) |
Jun
(100) |
Jul
(110) |
Aug
(115) |
Sep
(52) |
Oct
(20) |
Nov
(27) |
Dec
(42) |
2005 |
Jan
(19) |
Feb
(11) |
Mar
(58) |
Apr
(3) |
May
(10) |
Jun
(38) |
Jul
(44) |
Aug
(106) |
Sep
(36) |
Oct
(35) |
Nov
|
Dec
|
From: <des...@us...> - 2003-12-26 20:16:11
|
Update of /cvsroot/beepmp/bmp/po In directory sc8-pr-cvs1:/tmp/cvs-serv11165/po Modified Files: bmp.pot fr.po Log Message: - added translatable strings for dirbrowser - plugged some more leaks in dirbrowser Index: bmp.pot =================================================================== RCS file: /cvsroot/beepmp/bmp/po/bmp.pot,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bmp.pot 24 Dec 2003 17:30:09 -0000 1.3 --- bmp.pot 26 Dec 2003 20:16:02 -0000 1.4 *************** *** 9,13 **** "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" ! "POT-Creation-Date: 2003-12-25 00:33+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" --- 9,13 ---- "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" ! "POT-Creation-Date: 2003-12-26 16:38+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" [...999 lines suppressed...] ! #: beep/skinwin.c:361 msgid "Skin Browser" msgstr "" ! #: beep/skinwin.c:388 msgid "Select random skin on play" msgstr "" ! #: beep/skinwin.c:409 msgid "(none)" msgstr "" ! #: beep/util.c:933 msgid "Play files" msgstr "" ! #: beep/util.c:935 msgid "Load files" msgstr "" Index: fr.po =================================================================== RCS file: /cvsroot/beepmp/bmp/po/fr.po,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fr.po 24 Dec 2003 17:30:09 -0000 1.2 --- fr.po 26 Dec 2003 20:16:04 -0000 1.3 *************** *** 8,12 **** "Project-Id-Version: bmp 0.9.6\n" "Report-Msgid-Bugs-To: \n" ! "POT-Creation-Date: 2003-12-25 00:33+0800\n" "PO-Revision-Date: 2003-12-25 01:34+0800\n" "Last-Translator: David Le Brun <da...@dy...>\n" --- 8,12 ---- "Project-Id-Version: bmp 0.9.6\n" "Report-Msgid-Bugs-To: \n" ! "POT-Creation-Date: 2003-12-26 16:38+0800\n" "PO-Revision-Date: 2003-12-25 01:34+0800\n" [...1016 lines suppressed...] ! #: beep/skinwin.c:361 #, fuzzy msgid "Skin Browser" msgstr "/Gestionnaire de thèmes" ! #: beep/skinwin.c:388 msgid "Select random skin on play" msgstr "Choisir aléatoirement une skin lors de la lecture" ! #: beep/skinwin.c:409 msgid "(none)" msgstr "(aucun)" ! #: beep/util.c:933 msgid "Play files" msgstr "Jouer les fichiers" ! #: beep/util.c:935 msgid "Load files" msgstr "Charger les fichiers" |
From: <des...@us...> - 2003-12-26 20:04:31
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv9396 Modified Files: dirbrowser.c prefswin.c Log Message: - plugged most memory leaks in dirbrowser - cleanups Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dirbrowser.c 26 Dec 2003 08:30:15 -0000 1.17 --- dirbrowser.c 26 Dec 2003 20:04:28 -0000 1.18 *************** *** 25,47 **** #include <gdk/gdkx.h> - #include <sys/stat.h> - #include <unistd.h> - #include <dirent.h> - - #define FILENAME_COL 3 - - static GtkTreePath *current; - static GtkItemFactory *bmp_db_popup; - - static GtkWidget *progressbar_db; - static gboolean click_play = FALSE; ! static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); ! static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); ! static void bmp_db_set_icon(GtkWidget * win); --- 25,31 ---- #include <gdk/gdkx.h> ! #define FILENAME_COL 3 *************** *** 64,72 **** }; ! GtkAccelGroup *db_accel; ! GtkItemFactoryEntry bmp_db_menu_entries[] = { {N_("/_Enqueue"), "<alt>e", bmp_db_menu_callback, DIRBROWSER_ENQUEUE, "<StockItem>", GTK_STOCK_ADD}, --- 48,63 ---- }; + typedef struct { ! gchar *name; ! gchar *path_real; ! GdkPixbuf *image; + } db_node; ! static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); ! ! static GtkItemFactoryEntry bmp_db_menu_entries[] = { {N_("/_Enqueue"), "<alt>e", bmp_db_menu_callback, DIRBROWSER_ENQUEUE, "<StockItem>", GTK_STOCK_ADD}, *************** *** 94,123 **** }; ! static const int bmp_db_menu_entries_num = sizeof(bmp_db_menu_entries) / sizeof(bmp_db_menu_entries[0]); ! typedef struct { ! ! gchar *name; ! gchar *path_real; ! GdkPixbuf *image; ! ! } db_node; ! ! GPtrArray *nodes; ! guint ctr_array = 0; ! static gchar *bmp_db_sanify_tag(gchar * value); static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths); /* The function adds a track to the model, specified by artist, album * and finally track. It creates artist and album nodes on the fly as * needed. Think of it as a "mkdir -p". */ ! ! static void bmp_db_mdb_add_track(gchar * arg_artist_p, ! gchar * arg_album_p, gchar * arg_track_p, ! guint arg_tracknum, gchar * arg_path, GtkTreeModel * model_sort) { --- 85,117 ---- }; ! static const gint bmp_db_menu_entries_num = sizeof(bmp_db_menu_entries) / sizeof(bmp_db_menu_entries[0]); + static GtkTreePath *current; + static GtkItemFactory *bmp_db_popup; + static GtkAccelGroup *db_accel; ! static GtkWidget *progressbar_db; ! static gboolean click_play = FALSE; + static GPtrArray *nodes; + static guint ctr_array = 0; ! static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); ! static void bmp_db_set_icon(GtkWidget * win); ! static gchar *bmp_db_sanify_tag(const gchar * value); static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths); + /* The function adds a track to the model, specified by artist, album * and finally track. It creates artist and album nodes on the fly as * needed. Think of it as a "mkdir -p". */ ! static void bmp_db_mdb_add_track(const gchar * arg_artist_p, ! const gchar * arg_album_p, ! const gchar * arg_track_p, ! guint arg_tracknum, ! const gchar * arg_path, GtkTreeModel * model_sort) { *************** *** 154,161 **** --- 148,158 ---- if (g_ascii_strcasecmp(value, arg_artist) == 0) { + g_free(value); found = TRUE; break; } + g_free(value); + valid = gtk_tree_model_iter_next(model, &iter); } *************** *** 190,193 **** --- 187,191 ---- g_free(value); + valid = gtk_tree_model_iter_next(model, &iter_albums); } *************** *** 223,226 **** --- 221,225 ---- g_free(value); + valid = gtk_tree_model_iter_next(model, &iter_tracks); } *************** *** 241,244 **** --- 240,247 ---- } + + g_free(arg_artist); + g_free(arg_album); + g_free(arg_track); } *************** *** 279,306 **** } ! static gchar *bmp_db_sanify_tag(gchar * value) { - - if (!value) - return "(unknown)"; - gchar *frag = NULL; gchar **branches; guint ctr = 0; gboolean bracket_open = FALSE; ! GString *chunk = g_string_new(NULL); ! branches = g_strsplit(g_strstrip(value), " ", 0); ! while (frag || (ctr == 0)) { ! if (ctr != 0) { g_string_append_c(chunk, ' '); - } frag = branches[ctr]; if (frag) { ! gchar *tmp = g_ascii_strdown(frag, -1); tmp[0] = g_ascii_toupper(tmp[0]); --- 282,314 ---- } ! static gchar *bmp_db_sanify_tag(const gchar * value) { gchar *frag = NULL; gchar **branches; + gchar *retval = NULL; + gchar *tmp; guint ctr = 0; gboolean bracket_open = FALSE; ! GString *chunk; ! if (!value) ! return g_strdup("(unknown)"); ! ! tmp = g_strstrip(g_strdup(value)); ! branches = g_strsplit(tmp, " ", 0); ! g_free(tmp); ! chunk = g_string_new(NULL); ! ! while (frag || !ctr) { ! ! if (ctr) g_string_append_c(chunk, ' '); frag = branches[ctr]; if (frag) { ! tmp = g_ascii_strdown(frag, -1); tmp[0] = g_ascii_toupper(tmp[0]); *************** *** 316,324 **** ctr++; - } ! /* FIXME: is chunk freed somewhere? */ ! return g_strstrip(chunk->str); } --- 324,333 ---- ctr++; } ! retval = g_strstrip(chunk->str); ! g_string_free(chunk, FALSE); ! ! return retval; } *************** *** 333,337 **** } ! static gchar *bmp_db_get_path_real(gchar * path, GtkTreeModel * model, GtkTreeIter * iter) { --- 342,346 ---- } ! static gchar *bmp_db_get_path_real(const gchar * path, GtkTreeModel * model, GtkTreeIter * iter) { *************** *** 350,354 **** ! static void bmp_db_create_dirtree(GtkTreeModel * model, gchar * from, GtkTreeIter parent_iter) { --- 359,363 ---- ! static void bmp_db_create_dirtree(GtkTreeModel * model, const gchar * root, GtkTreeIter parent_iter) { *************** *** 356,362 **** GList *dirs = NULL; GList *files = NULL; ! DIR *dir; ! struct dirent *dirent; ! struct stat statbuf; GtkTreeIter iter; --- 365,369 ---- GList *dirs = NULL; GList *files = NULL; ! GDir *dir; GtkTreeIter iter; *************** *** 364,372 **** GList *list = NULL; gboolean first = TRUE; ! gchar *from_real; ! from = g_locale_from_utf8(from, -1, NULL, NULL, NULL); ! from_real = bmp_db_get_path_real(from, model, &parent_iter); ! g_free(from); /* It's not really a waste creating both beforehand since we will --- 371,386 ---- GList *list = NULL; gboolean first = TRUE; ! gchar *root_utf8, *root_real; ! const gchar *dirent; ! root_utf8 = g_locale_from_utf8(root, -1, NULL, NULL, NULL); ! root_real = bmp_db_get_path_real(root, model, &parent_iter); ! ! if (!g_file_test(root_real, G_FILE_TEST_IS_DIR)) ! { ! g_free(root_utf8); ! g_free(root_real); ! return; ! } /* It's not really a waste creating both beforehand since we will *************** *** 389,397 **** ! stat(from_real, &statbuf); ! if ((statbuf.st_mode & S_IFDIR) != S_IFDIR) ! return; ! ! if ((list = input_scan_dir(from_real)) != NULL) { /* We enter a directory that has been "hijacked" by an * input-plugin. This is used by the CDDA plugin */ --- 403,407 ---- ! if ((list = input_scan_dir(root_real)) != NULL) { /* We enter a directory that has been "hijacked" by an * input-plugin. This is used by the CDDA plugin */ *************** *** 400,422 **** files = list; } else { ! if ((dir = opendir(from_real)) != NULL) { ! while ((dirent = readdir(dir)) != NULL) { ! char *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent->d_name[0] == '.') continue; name_real = ! g_build_filename(from_real, dirent->d_name, NULL); ! stat(name_real, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { dirs = g_list_append(dirs, ! g_locale_to_utf8(dirent->d_name, -1, NULL, NULL, NULL)); } } ! closedir(dir); } --- 410,432 ---- files = list; } else { ! if ((dir = g_dir_open(root_real, 0, NULL)) != NULL) { ! while ((dirent = g_dir_read_name(dir)) != NULL) { ! gchar *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent[0] == '.') continue; + name_real = ! g_build_filename(root_real, dirent, NULL); ! if (g_file_test(name_real, G_FILE_TEST_IS_DIR)) { dirs = g_list_append(dirs, ! g_locale_to_utf8(dirent, -1, NULL, NULL, NULL)); } } ! g_dir_close(dir); } *************** *** 481,488 **** db_node *node; gchar *filename; ! FILE *file; ! gchar *buffer, **lines, **frags; ! struct stat stats; ! guint i; GdkPixbuf *buf; --- 491,498 ---- db_node *node; gchar *filename; ! gsize filesize; ! gchar *buffer; ! gchar **lines, **current_line; ! gchar **frags; GdkPixbuf *buf; *************** *** 499,531 **** g_build_filename(g_get_home_dir(), BMP_RCPATH, "dbrc", NULL); ! if (!(file = fopen(filename, "r"))) { ! /* Seems the file doesn't exist so give at least the root filesystem */ ! if (!(file = fopen(filename, "w"))) { ! /* Ok now we really give up */ ! return NULL; ! } ! fprintf(file, "/:/\n"); ! /* not so cool */ ! fclose(file); ! file = fopen(filename, "r"); } ! lstat(filename, &stats); ! buffer = g_malloc(stats.st_size + 1); ! if (fread(buffer, 1, stats.st_size, file) != stats.st_size) { ! g_free(buffer); ! fclose(file); return NULL; } ! fclose(file); ! buffer[stats.st_size] = '\0'; lines = g_strsplit(buffer, "\n", 0); g_free(buffer); ! i = 0; ! while (lines[i]) { ! if (strlen(lines[i])) { ! ! frags = g_strsplit(lines[i], ":", 0); node = g_malloc0(sizeof(db_node)); --- 509,531 ---- g_build_filename(g_get_home_dir(), BMP_RCPATH, "dbrc", NULL); ! if (!g_file_test(filename, G_FILE_TEST_EXISTS)) ! { ! g_free(filename); ! return NULL; } ! if (!g_file_get_contents(filename, &buffer, &filesize, NULL)) ! { ! g_free(filename); return NULL; } ! lines = g_strsplit(buffer, "\n", 0); g_free(buffer); ! current_line = lines; ! while (*current_line) { ! if (strlen(*current_line)) { ! frags = g_strsplit(*current_line, ":", 0); node = g_malloc0(sizeof(db_node)); *************** *** 541,547 **** bmp_db_create_dirtree(GTK_TREE_MODEL(model), /* starting at */ "/", iter); g_strfreev(frags); } ! i++; } --- 541,548 ---- bmp_db_create_dirtree(GTK_TREE_MODEL(model), /* starting at */ "/", iter); + g_strfreev(frags); } ! current_line++; } *************** *** 670,673 **** --- 671,675 ---- gchar *path; gchar *path_real; + gchar *tmp; GtkTreeModel *model; *************** *** 677,681 **** model = gtk_tree_view_get_model(treeview); - /* FIXME: paths is not freed */ paths = bmp_db_get_paths_from_selection(treeview); --- 679,682 ---- *************** *** 686,697 **** gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, -1); ! path = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); ! /* FIXME: path is not freed */ ! path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); ! /* FIXME: paths_f is not freed */ paths_f = g_list_append(paths_f, path_real); --- 687,699 ---- gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, -1); ! tmp = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); ! path = g_locale_from_utf8(tmp, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); ! g_free(tmp); ! g_free(path); ! paths_f = g_list_append(paths_f, path_real); *************** *** 699,702 **** --- 701,707 ---- } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); + GtkWidget *store = GTK_WIDGET(bmp_db_return_filestore_model_fresh(paths_f)); *************** *** 704,707 **** --- 709,715 ---- gtk_tree_view_set_model(user_data, GTK_TREE_MODEL(store)); gtk_widget_set_sensitive(user_data, TRUE); + + g_list_foreach(paths_f, (GFunc) g_free, NULL); + g_list_free(paths_f); } *************** *** 722,726 **** gint entry_type = -1; - struct stat statbuf; GtkTreeModel *model; --- 730,733 ---- *************** *** 731,743 **** &node_name, 4, &entry_type, -1); ! if ((node_name != NULL) && (entry_type == IS_TRACK)) { if (click_play) playlist_clear(); ! stat(node_name, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { playlist_add_url_string(node_name); - } if (click_play) --- 738,748 ---- &node_name, 4, &entry_type, -1); ! if (node_name && entry_type == IS_TRACK) { if (click_play) playlist_clear(); ! if (g_file_test(node_name, G_FILE_TEST_IS_REGULAR)) playlist_add_url_string(node_name); if (click_play) *************** *** 757,763 **** gtk_tree_model_get(GTK_TREE_MODEL(model), &iter_child, FILENAME_COL, &node_name, -1); ! if (node_name != NULL) { ! stat(node_name, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { playlist_add_url_string(node_name); } --- 762,767 ---- gtk_tree_model_get(GTK_TREE_MODEL(model), &iter_child, FILENAME_COL, &node_name, -1); ! if (node_name) { ! if (g_file_test(node_name, G_FILE_TEST_IS_REGULAR)) { playlist_add_url_string(node_name); } *************** *** 792,797 **** while (paths) { - struct stat statbuf; - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, --- 796,799 ---- *************** *** 803,808 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { playlist_add_dir(path_real); } else { --- 805,809 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path, G_FILE_TEST_IS_DIR)) { playlist_add_dir(path_real); } else { *************** *** 810,820 **** } paths = paths->next; } ! g_free(paths); ! bmp_db_clear_clicked(NULL, data); } --- 811,825 ---- } + g_free(path); + g_free(path_real); + paths = paths->next; } ! g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); ! g_list_free(paths); + bmp_db_clear_clicked(NULL, data); } *************** *** 822,826 **** { GList *paths = NULL; ! /* paths is not freed */ paths = bmp_db_get_paths_from_selection(GTK_TREE_VIEW(data)); while (paths) { --- 827,831 ---- { GList *paths = NULL; ! paths = bmp_db_get_paths_from_selection(GTK_TREE_VIEW(data)); while (paths) { *************** *** 829,832 **** --- 834,839 ---- } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); } *************** *** 858,863 **** gchar *path_real; - struct stat statbuf; - attrs = pango_attr_list_new(); attr = pango_attr_weight_new(PANGO_WEIGHT_BOLD); --- 865,868 ---- *************** *** 910,915 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path_real, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { db_node *node; --- 915,919 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path_real, G_FILE_TEST_IS_DIR)) { db_node *node; *************** *** 1036,1040 **** model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - /* paths is not freed */ paths = gtk_tree_selection_get_selected_rows(GTK_TREE_SELECTION(selection), --- 1040,1043 ---- *************** *** 1044,1052 **** while (paths) { ! ! char *node_name; ! char *path; ! char *path_real; ! struct stat statbuf; gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); --- 1047,1053 ---- while (paths) { ! gchar *node_name; ! gchar *path; ! gchar *path_real; gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); *************** *** 1058,1063 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { playlist_add_dir(path_real); } else { --- 1059,1063 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path, G_FILE_TEST_IS_DIR)) { playlist_add_dir(path_real); } else { *************** *** 1066,1072 **** paths = paths->next; - } bmp_db_clear_clicked(NULL, data); playlist_play(); --- 1066,1074 ---- paths = paths->next; } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); + bmp_db_clear_clicked(NULL, data); playlist_play(); *************** *** 1265,1282 **** ! static GList *bmp_db_return_files_from_path(gchar * path) { ! DIR *dir; ! struct dirent *dirent; ! struct stat statbuf; GList *list = NULL; GList *files = NULL; ! stat(path, &statbuf); ! if ((statbuf.st_mode & S_IFDIR) != S_IFDIR) { /* FIXME: Add action for no directory */ return NULL; - } if ((list = input_scan_dir(path)) != NULL) { --- 1267,1281 ---- ! static GList *bmp_db_return_files_from_path(const gchar * path) { ! GDir *dir; ! const gchar *dirent; GList *list = NULL; GList *files = NULL; ! if (!g_file_test(path, G_FILE_TEST_IS_DIR)) /* FIXME: Add action for no directory */ return NULL; if ((list = input_scan_dir(path)) != NULL) { *************** *** 1289,1313 **** files = list; } else { ! if ((dir = opendir(path)) != NULL) { ! while ((dirent = readdir(dir)) != NULL) { ! char *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent->d_name[0] == '.') { continue; ! } ! name_real = ! g_strdup(g_strconcat(path, "/", dirent->d_name, NULL)); ! stat(name_real, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { if (bmp_db_check_file(name_real)) { ! files = g_list_append(files, ! g_strdup(g_filename_to_utf8 ! (name_real, -1, ! NULL, NULL, ! NULL))); } } } ! closedir(dir); } --- 1288,1307 ---- files = list; } else { ! if ((dir = g_dir_open(path, 0, NULL)) != NULL) { ! while ((dirent = g_dir_read_name(dir)) != NULL) { ! gchar *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent[0] == '.') continue; ! ! name_real = g_build_filename(path, dirent, NULL); ! ! if (g_file_test(name_real, G_FILE_TEST_IS_REGULAR)) { if (bmp_db_check_file(name_real)) { ! files = g_list_append(files, g_filename_to_utf8(name_real, -1, NULL, NULL,NULL)); } } } ! g_dir_close(dir); } *************** *** 1317,1321 **** } - static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths) { --- 1311,1314 ---- *************** *** 1323,1327 **** GtkTreeStore *file_store; - file_store = gtk_tree_store_new(5, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT, --- 1316,1319 ---- *************** *** 1335,1366 **** NULL); - gdouble length_pl = g_list_length(paths); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_db), 0.0); ! int ctr = 0; while (paths) { ! gchar *path = paths->data; - ctr++; - GList *files = bmp_db_return_files_from_path(path); while (files) { - gchar *title; - gchar *artist; - gchar *album; - gchar *genre; - guint tracknumber; - input_return_tag_value_by_name(files->data, &artist, &title, &album, &genre, &tracknumber); ! if (title == NULL) { ! ! title = g_strdup(g_basename(files->data)); title[strlen(title) - 4] = 0; - } --- 1327,1351 ---- NULL); gdouble length_pl = g_list_length(paths); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_db), 0.0); ! gint ctr = 0; while (paths) { ! gchar *title; ! gchar *artist; ! gchar *album; ! gchar *genre; ! guint tracknumber; gchar *path = paths->data; GList *files = bmp_db_return_files_from_path(path); while (files) { input_return_tag_value_by_name(files->data, &artist, &title, &album, &genre, &tracknumber); ! if (!title) { ! title = g_path_get_basename(files->data); title[strlen(title) - 4] = 0; } *************** *** 1368,1371 **** --- 1353,1361 ---- files->data, sort_model); + g_free(artist); + g_free(title); + g_free(album); + g_free(genre); + files = files->next; } *************** *** 1377,1381 **** --- 1367,1373 ---- gtk_main_iteration(); }; + paths = paths->next; + ctr++; } *************** *** 1418,1422 **** GtkWidget *bmp_db_create(const gchar * current_path) { ! static GtkWidget *window; GtkWidget *vbox_right; GtkWidget *vbox_left; --- 1410,1414 ---- GtkWidget *bmp_db_create(const gchar * current_path) { ! static GtkWidget *window = NULL; GtkWidget *vbox_right; GtkWidget *vbox_left; *************** *** 1508,1517 **** /* FIXME: clean up variables, move them to start */ - /* FIXME: paths is not freed, and is resetted every iteration */ GList *paths = NULL; paths = g_list_append(paths, g_strdup(g_get_home_dir())); fstore = bmp_db_return_filestore_fresh(paths); gtk_container_add(GTK_CONTAINER(sw_right), fstore); GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); --- 1500,1511 ---- /* FIXME: clean up variables, move them to start */ GList *paths = NULL; paths = g_list_append(paths, g_strdup(g_get_home_dir())); + fstore = bmp_db_return_filestore_fresh(paths); gtk_container_add(GTK_CONTAINER(sw_right), fstore); + g_list_free(paths); + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); *************** *** 1527,1530 **** --- 1521,1525 ---- } + gtk_widget_realize(window); bmp_db_set_icon(window); Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** prefswin.c 26 Dec 2003 15:55:56 -0000 1.10 --- prefswin.c 26 Dec 2003 20:04:28 -0000 1.11 *************** *** 506,514 **** void prefswin_mainwin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel; gint response; gchar *fontname; ! if (fontsel != NULL) return; --- 506,514 ---- void prefswin_mainwin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel = NULL; gint response; gchar *fontname; ! if (fontsel) return; |
From: <des...@us...> - 2003-12-26 15:56:01
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv3847 Modified Files: equalizer.c main.c output.c prefswin.c Log Message: - replaced sprintf()s with snprintf()s Index: equalizer.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** equalizer.c 26 Dec 2003 08:30:15 -0000 1.11 --- equalizer.c 26 Dec 2003 15:55:56 -0000 1.12 *************** *** 1077,1081 **** for (i = 0; i < 10; i++) { gchar tmp[7]; ! sprintf(tmp, "Band%d", i); if (xmms_cfg_read_float(cfgfile, "Equalizer preset", tmp, &val)) eqslider_set_position(equalizerwin_bands[i], val); --- 1077,1081 ---- for (i = 0; i < 10; i++) { gchar tmp[7]; ! g_snprintf(tmp, sizeof(tmp), "Band%d", i); if (xmms_cfg_read_float(cfgfile, "Equalizer preset", tmp, &val)) eqslider_set_position(equalizerwin_bands[i], val); *************** *** 1298,1302 **** for (i = 0; i < 10; i++) { gchar tmp[7]; ! sprintf(tmp, "Band%d", i); xmms_cfg_write_float(cfgfile, "Equalizer preset", tmp, eqslider_get_position(equalizerwin_bands[i])); --- 1298,1302 ---- for (i = 0; i < 10; i++) { gchar tmp[7]; ! g_snprintf(tmp, sizeof(tmp), "Band%d", i); xmms_cfg_write_float(cfgfile, "Equalizer preset", tmp, eqslider_get_position(equalizerwin_bands[i])); Index: main.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/main.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** main.c 26 Dec 2003 08:30:15 -0000 1.28 --- main.c 26 Dec 2003 15:55:56 -0000 1.29 *************** *** 291,295 **** gchar eqtext[18]; ! g_sprintf(eqtext, "equalizer_band%d", i); xmms_cfg_read_float(cfgfile, "xmms", eqtext, &cfg.equalizer_bands[i]); --- 291,295 ---- gchar eqtext[18]; ! g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); xmms_cfg_read_float(cfgfile, "xmms", eqtext, &cfg.equalizer_bands[i]); *************** *** 336,340 **** gchar str[19], *temp; ! g_sprintf(str, "url_history%d", i); if (xmms_cfg_read_string(cfgfile, "xmms", str, &temp)) cfg.url_history = g_list_append(cfg.url_history, temp); --- 336,340 ---- gchar str[19], *temp; ! g_snprintf(str, sizeof(str), "url_history%d", i); if (xmms_cfg_read_string(cfgfile, "xmms", str, &temp)) cfg.url_history = g_list_append(cfg.url_history, temp); Index: output.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/output.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** output.c 26 Dec 2003 08:30:16 -0000 1.6 --- output.c 26 Dec 2003 15:55:56 -0000 1.7 *************** *** 54,58 **** pos = get_playlist_position(); time = input_get_time() / 1000; ! sprintf(timestr, "%u:%2.2u", time / 60, time % 60); params = sscanf(timestr, "%u:%u", &min, &sec); --- 54,59 ---- pos = get_playlist_position(); time = input_get_time() / 1000; ! g_snprintf(timestr, sizeof(timestr), "%u:%2.2u", ! time / 60, time % 60); params = sscanf(timestr, "%u:%u", &min, &sec); Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** prefswin.c 26 Dec 2003 15:47:45 -0000 1.9 --- prefswin.c 26 Dec 2003 15:55:56 -0000 1.10 *************** *** 430,434 **** save_config(); ! // FIXME: It's _very_ slow doing this again for say several hundred or thousand files... playlist_read_info_selection(); playlistwin_update_list(); --- 430,435 ---- save_config(); ! /* FIXME: It's _very_ slow doing this again for say several ! * hundred or thousand files... */ playlist_read_info_selection(); playlistwin_update_list(); *************** *** 442,446 **** void prefswin_ok_cb(GtkWidget * w, gpointer data) { ! // prefswin_apply_changes(); gtk_widget_hide(prefswin); } --- 443,447 ---- void prefswin_ok_cb(GtkWidget * w, gpointer data) { ! /* prefswin_apply_changes(); */ gtk_widget_hide(prefswin); } *************** *** 458,466 **** void prefswin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel; gint response; gchar *fontname; ! if (fontsel != NULL) return; --- 459,467 ---- void prefswin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel = NULL; gint response; gchar *fontname; ! if (fontsel) return; *************** *** 1713,1717 **** void __show_prefs_window(void) { ! char temp[10]; if (GTK_WIDGET_VISIBLE(prefswin)) { --- 1714,1718 ---- void __show_prefs_window(void) { ! gchar temp[10]; if (GTK_WIDGET_VISIBLE(prefswin)) { *************** *** 1727,1731 **** gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); ! sprintf(temp, "%u", cfg.pause_between_songs_time); gtk_entry_set_text(GTK_ENTRY(prefswin_options_pbs_entry), temp); gtk_spin_button_set_value(GTK_SPIN_BUTTON(prefswin_options_mouse_spin), --- 1728,1732 ---- gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); ! g_snprintf(temp, sizeof(temp), "%u", cfg.pause_between_songs_time); gtk_entry_set_text(GTK_ENTRY(prefswin_options_pbs_entry), temp); gtk_spin_button_set_value(GTK_SPIN_BUTTON(prefswin_options_mouse_spin), |
From: <des...@us...> - 2003-12-26 15:47:49
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv2771 Modified Files: playlist_list.c playlistwin.c prefswin.c util.c util.h Log Message: - cleanups Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** playlist_list.c 26 Dec 2003 05:53:31 -0000 1.16 --- playlist_list.c 26 Dec 2003 15:47:45 -0000 1.17 *************** *** 344,365 **** } - static void convert_title_text(gchar * text) - { - gchar *match, *tmp; - - if (cfg.convert_underscore) - while ((match = strchr(text, '_'))) - *match = ' '; - - if (cfg.convert_twenty) - while ((match = strstr(text, "%20"))) { - tmp = match + 3; - *match++ = ' '; - while (*tmp) - *match++ = *tmp++; - *match = '\0'; - } - } - static void playlist_list_draw(Widget * w) { --- 344,347 ---- Index: playlistwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlistwin.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** playlistwin.c 25 Dec 2003 23:26:13 -0000 1.11 --- playlistwin.c 26 Dec 2003 15:47:45 -0000 1.12 *************** *** 303,307 **** }; ! static const int playlist_menu_entries_num = sizeof(playlist_menu_entries) / sizeof(playlist_menu_entries[0]); --- 303,307 ---- }; ! static const gint playlist_menu_entries_num = sizeof(playlist_menu_entries) / sizeof(playlist_menu_entries[0]); *************** *** 310,314 **** static void playlistwin_update_info(void) { ! char *text, *sel_text, *tot_text; gulong selection, total; gboolean selection_more, total_more; --- 310,314 ---- static void playlistwin_update_info(void) { ! gchar *text, *sel_text, *tot_text; gulong selection, total; gboolean selection_more, total_more; *************** *** 351,356 **** void playlistwin_update_sinfo(void) { ! char *posstr, *timestr, *title, *info, *dots; ! int pos, time, max_len; pos = playlist_get_position(); --- 351,356 ---- void playlistwin_update_sinfo(void) { ! gchar *posstr, *timestr, *title, *info, *dots; ! gint pos, time, max_len; pos = playlist_get_position(); *************** *** 377,395 **** timestr = g_strdup(""); ! if (cfg.convert_underscore) { ! char *tmp; ! while ((tmp = strchr(title, '_')) != NULL) ! *tmp = ' '; ! } ! if (cfg.convert_twenty) { ! char *tmp, *tmp2; ! while ((tmp = strstr(title, "%20")) != NULL) { ! tmp2 = tmp + 3; ! *(tmp++) = ' '; ! while (*tmp2) ! *(tmp++) = *(tmp2++); ! *tmp = '\0'; ! } ! } if (strlen(title) > max_len) { --- 377,381 ---- timestr = g_strdup(""); ! convert_title_text(title); if (strlen(title) > max_len) { *************** *** 552,556 **** } ! void playlistwin_scroll(int num) { playlistwin_list->pl_first += num; --- 538,542 ---- } ! void playlistwin_scroll(gint num) { playlistwin_list->pl_first += num; *************** *** 684,688 **** } ! static void playlistwin_queue_resize(int width, int height) { if (playlistwin_resizeq.w == -1) --- 670,674 ---- } ! static void playlistwin_queue_resize(gint width, gint height) { if (playlistwin_resizeq.w == -1) *************** *** 725,729 **** } ! void playlistwin_add_dir_handler(gchar * dir) { g_free(cfg.filesel_path); --- 711,715 ---- } ! void playlistwin_add_dir_handler(const gchar * dir) { g_free(cfg.filesel_path); *************** *** 744,748 **** */ GList *list = playlist_get_selected(); ! if (list != NULL) { playlist_fileinfo(GPOINTER_TO_INT(list->data)); g_list_free(list); --- 730,734 ---- */ GList *list = playlist_get_selected(); ! if (list) { playlist_fileinfo(GPOINTER_TO_INT(list->data)); g_list_free(list); *************** *** 890,895 **** if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! char *ext; ! int error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) --- 876,881 ---- if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! gchar *ext; ! gboolean error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) *************** *** 900,904 **** error = TRUE; if (error) { ! char *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); --- 886,890 ---- error = TRUE; if (error) { ! gchar *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); *************** *** 916,920 **** if (!playlist_save(filename, pls)) ! // FIXME: Should be a seperate function without the file selection as a parameter playlistwin_save_playlist_error(filename, NULL); } --- 902,907 ---- if (!playlist_save(filename, pls)) ! /* FIXME: Should be a seperate function without the file ! * selection as a parameter */ playlistwin_save_playlist_error(filename, NULL); } *************** *** 938,943 **** if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! char *ext; ! int error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) --- 925,930 ---- if (playlistwin_save_type == PLAYLISTWIN_SAVE_EXTENSION) { ! gchar *ext; ! gboolean error = FALSE; if ((ext = strrchr(filename, '.')) != NULL && ext > slash) { if (!strcmp(ext, ".pls")) *************** *** 948,952 **** error = TRUE; if (error) { ! char *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); --- 935,939 ---- error = TRUE; if (error) { ! gchar *m; GtkWidget *w; m = g_strdup_printf(_("Unknown filetype for %s"), filename); *************** *** 977,995 **** void playlistwin_load_filesel_ok(GtkWidget * w, GtkWidget * filesel) { ! gchar *filename, *text, *tmp; if (util_filebrowser_is_dir(GTK_FILE_SELECTION(filesel))) return; ! filename = ! g_strdup(gtk_file_selection_get_filename ! (GTK_FILE_SELECTION(filesel))); ! text = g_strdup(filename); ! if ((tmp = strrchr(text, '/')) != NULL) *(tmp + 1) = '\0'; g_free(cfg.playlist_path); ! cfg.playlist_path = g_strdup(text); ! g_free(text); if (filename && *filename) { --- 964,979 ---- void playlistwin_load_filesel_ok(GtkWidget * w, GtkWidget * filesel) { ! gchar *filename, *tmp; if (util_filebrowser_is_dir(GTK_FILE_SELECTION(filesel))) return; ! filename = g_strdup(gtk_file_selection_get_filename ! (GTK_FILE_SELECTION(filesel))); ! if ((tmp = strrchr(filename, '/')) != NULL) *(tmp + 1) = '\0'; g_free(cfg.playlist_path); ! cfg.playlist_path = filename; if (filename && *filename) { *************** *** 1001,1004 **** --- 985,989 ---- playlist_set_current_name(filename); } + gtk_widget_destroy(GTK_WIDGET(filesel)); } *************** *** 1009,1013 **** GtkWidget *widget; - widget = gtk_item_factory_get_widget(playlist_menu, "/Remove Unavailable Files"); --- 994,997 ---- *************** *** 1499,1503 **** GList *node, *selected_list = data; gint deleted = 0, length; ! char *message = NULL; length = g_list_length(selected_list); --- 1483,1487 ---- GList *node, *selected_list = data; gint deleted = 0, length; ! gchar *message = NULL; length = g_list_length(selected_list); *************** *** 1508,1517 **** deleted++; else { - if (length == 1) - message = - g_strdup_printf(_("Failed to delete \"%s\": %s."), - (char *) selected_list->data, - strerror(errno)); - /* The unlink failed, we dont want to remove the file from the playlist either */ --- 1492,1495 ---- *************** *** 1527,1534 **** g_list_free(selected_list); ! if (length > 1 && deleted < length) message = g_strdup_printf(_("%d of %d files successfully deleted."), deleted, length); if (message) { --- 1505,1518 ---- g_list_free(selected_list); ! if (length == 1) ! message = ! g_strdup_printf(_("Failed to delete \"%s\": %s."), ! (gchar *) selected_list->data, ! g_strerror(errno)); ! else if (length > 1 && deleted < length) { message = g_strdup_printf(_("%d of %d files successfully deleted."), deleted, length); + } if (message) { *************** *** 2343,2347 **** hint_set_always(cfg.always_on_top); hint_set_sticky(cfg.sticky); ! // gtk_window_present(GTK_WINDOW(playlistwin)); gtk_widget_show(playlistwin); } --- 2327,2331 ---- hint_set_always(cfg.always_on_top); hint_set_sticky(cfg.sticky); ! /* gtk_window_present(GTK_WINDOW(playlistwin)); */ gtk_widget_show(playlistwin); } Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** prefswin.c 26 Dec 2003 09:31:29 -0000 1.8 --- prefswin.c 26 Dec 2003 15:47:45 -0000 1.9 *************** *** 1531,1535 **** } ! void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ --- 1531,1536 ---- } ! void gen_module_description(const gchar * file, const gchar * desc, ! gchar ** full_desc) { /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ Index: util.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** util.c 26 Dec 2003 06:47:05 -0000 1.13 --- util.c 26 Dec 2003 15:47:45 -0000 1.14 *************** *** 1136,1139 **** --- 1136,1157 ---- } + void convert_title_text(gchar * text) + { + gchar *match, *tmp; + + if (cfg.convert_underscore) + while ((match = strchr(text, '_'))) + *match = ' '; + + if (cfg.convert_twenty) + while ((match = strstr(text, "%20"))) { + tmp = match + 3; + *match++ = ' '; + while (*tmp) + *match++ = *tmp++; + *match = '\0'; + } + } + #if defined(USE_DMALLOC) Index: util.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** util.h 26 Dec 2003 08:30:16 -0000 1.9 --- util.h 26 Dec 2003 15:47:45 -0000 1.10 *************** *** 65,68 **** --- 65,70 ---- guint gint_count_digits(gint n); + void convert_title_text(gchar * text); + #if ENABLE_NLS gchar *util_menu_translate(const gchar * path, gpointer func_data); |
From: <des...@us...> - 2003-12-26 09:31:33
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv20471 Modified Files: plugin.h prefswin.c Log Message: - added typecast macros for plugin types - fixed memory leak in prefswin_font_browse_cb() Index: plugin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/plugin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** plugin.h 24 Dec 2003 14:03:17 -0000 1.5 --- plugin.h 26 Dec 2003 09:31:29 -0000 1.6 *************** *** 32,35 **** --- 32,36 ---- } AFormat; + #define OUTPUT_PLUGIN(x) ((OutputPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 59,62 **** --- 60,64 ---- } OutputPlugin; + #define EFFECT_PLUGIN(x) ((EffectPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 75,78 **** --- 77,81 ---- } InputVisType; + #define INPUT_PLUGIN(x) ((InputPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 116,119 **** --- 119,123 ---- int effects_enabled(void); + #define GENERAL_PLUGIN(x) ((GeneralPlugin *)(x)) typedef struct { void *handle; /* Filled in by xmms */ *************** *** 127,130 **** --- 131,135 ---- } GeneralPlugin; + #define VIS_PLUGIN(x) ((VisPlugin *)(x)) typedef struct _VisPlugin { void *handle; /* Filled in by xmms */ Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** prefswin.c 26 Dec 2003 08:30:16 -0000 1.7 --- prefswin.c 26 Dec 2003 09:31:29 -0000 1.8 *************** *** 477,481 **** response = gtk_dialog_run(GTK_DIALOG(fontsel)); ! g_message(g_strdup_printf("%d", response)); switch (response) { --- 477,481 ---- response = gtk_dialog_run(GTK_DIALOG(fontsel)); ! g_message("%d", response); switch (response) { *************** *** 652,656 **** sel = GPOINTER_TO_INT(clist->selection->data); ! selected = (InputPlugin *) (g_list_nth(get_input_list(), sel)->data); if (!gtk_toggle_button_get_active(w)) --- 652,656 ---- sel = GPOINTER_TO_INT(clist->selection->data); ! selected = INPUT_PLUGIN((g_list_nth(get_input_list(), sel)->data)); if (!gtk_toggle_button_get_active(w)) *************** *** 1380,1390 **** gtk_label_new(_("Options"))); ! /* ! * Fonts page */ prefswin_fonts_vbox = gtk_table_new(4, 4, TRUE); ! // This ain't exactly GnomeFontPicker, but we're not a GNOME app so no GNOME widgets for us label = gtk_label_new("Playlist Font:"); --- 1380,1391 ---- gtk_label_new(_("Options"))); ! /* ! * Fonts page */ prefswin_fonts_vbox = gtk_table_new(4, 4, TRUE); ! /* This ain't exactly GnomeFontPicker, but we're not a GNOME app ! * so no GNOME widgets for us */ label = gtk_label_new("Playlist Font:"); *************** *** 1474,1480 **** ! /* ! * Ok, Cancel & Apply ! */ prefswin_hbox = gtk_hbutton_box_new(); --- 1475,1479 ---- ! /* Ok, Cancel & Apply */ prefswin_hbox = gtk_hbutton_box_new(); *************** *** 1519,1523 **** selected_oplugin = GPOINTER_TO_INT(item); output = get_output_list(); ! cp = (OutputPlugin *) g_list_nth(output, GPOINTER_TO_INT(item))->data; if (cp->configure != NULL) --- 1518,1522 ---- selected_oplugin = GPOINTER_TO_INT(item); output = get_output_list(); ! cp = OUTPUT_PLUGIN(g_list_nth(output, GPOINTER_TO_INT(item))->data); if (cp->configure != NULL) *************** *** 1534,1539 **** void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { ! // (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); ! (*full_desc) = g_strdup_printf("%s", desc); } --- 1533,1538 ---- void gen_module_description(gchar * file, gchar * desc, gchar ** full_desc) { ! /* (*full_desc) = g_strdup_printf("%s [%s]", desc, g_basename(file)); */ ! (*full_desc) = g_strdup(desc); } *************** *** 1555,1559 **** menu = gtk_menu_new(); while (olist) { ! op = (OutputPlugin *) olist->data; if (olist->data == cp) --- 1554,1558 ---- menu = gtk_menu_new(); while (olist) { ! op = OUTPUT_PLUGIN(olist->data); if (olist->data == cp) *************** *** 1599,1603 **** while (glist) { ! ep = (EffectPlugin *) glist->data; gen_module_description(ep->filename, ep->description, &description); --- 1598,1602 ---- while (glist) { ! ep = EFFECT_PLUGIN(glist->data); gen_module_description(ep->filename, ep->description, &description); *************** *** 1628,1632 **** while (glist) { ! gp = (GeneralPlugin *) glist->data; gen_module_description(gp->filename, gp->description, &description); --- 1627,1631 ---- while (glist) { ! gp = GENERAL_PLUGIN(glist->data); gen_module_description(gp->filename, gp->description, &description); *************** *** 1657,1661 **** while (glist) { ! vp = (VisPlugin *) glist->data; gen_module_description(vp->filename, vp->description, &description); --- 1656,1660 ---- while (glist) { ! vp = VIS_PLUGIN(glist->data); gen_module_description(vp->filename, vp->description, &description); *************** *** 1684,1688 **** gtk_clist_clear(clist); while (ilist) { ! ip = (InputPlugin *) ilist->data; /* gen_module_description(ip->filename, ip->description, &description); --- 1683,1687 ---- gtk_clist_clear(clist); while (ilist) { ! ip = INPUT_PLUGIN(ilist->data); /* gen_module_description(ip->filename, ip->description, &description); |
From: <des...@us...> - 2003-12-26 09:22:59
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv19438 Modified Files: input.c mainwin.c playlist.c playlist.h textbox.c textbox.h Log Message: - fixed memory leaks in mainwin - added const constraints to string arguments Index: input.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/input.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** input.c 24 Dec 2003 14:03:14 -0000 1.15 --- input.c 26 Dec 2003 09:22:55 -0000 1.16 *************** *** 678,682 **** gchar *input_get_info_text(void) { ! return input_info_text; } --- 678,682 ---- gchar *input_get_info_text(void) { ! return g_strdup(input_info_text); } Index: mainwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/mainwin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mainwin.c 25 Dec 2003 23:26:13 -0000 1.9 --- mainwin.c 26 Dec 2003 09:22:55 -0000 1.10 *************** *** 672,678 **** text = g_strdup_printf("%s %s", PACKAGE, VERSION); ! /* memory leak after g_strdup_print() above! - Des */ ! text = g_locale_to_utf8(text, -1, NULL, NULL, NULL); ! /* mainwin_set_title(text); */ g_free(text); } --- 672,676 ---- text = g_strdup_printf("%s %s", PACKAGE, VERSION); ! /* mainwin_set_title(text); */ g_free(text); } *************** *** 701,709 **** rate /= 1000; if (rate < 1000) { ! g_sprintf(text, "%3d", rate); textbox_set_text(mainwin_rate_text, text); } else { rate /= 100; ! g_sprintf(text, "%2dH", rate); textbox_set_text(mainwin_rate_text, text); } --- 699,707 ---- rate /= 1000; if (rate < 1000) { ! g_snprintf(text, sizeof(text), "%3d", rate); textbox_set_text(mainwin_rate_text, text); } else { rate /= 100; ! g_snprintf(text, sizeof(text), "%2dH", rate); textbox_set_text(mainwin_rate_text, text); } *************** *** 711,715 **** textbox_set_text(mainwin_rate_text, "VBR"); ! g_sprintf(text, "%2d", freq / 1000); textbox_set_text(mainwin_freq_text, text); monostereo_set_num_channels(mainwin_monostereo, nch); --- 709,713 ---- textbox_set_text(mainwin_rate_text, "VBR"); ! g_snprintf(text, sizeof(text), "%2d", freq / 1000); textbox_set_text(mainwin_freq_text, text); monostereo_set_num_channels(mainwin_monostereo, nch); *************** *** 733,743 **** if ((tmp = playlist_get_info_text()) != NULL) { pthread_mutex_lock(&title_mutex); ! if (mainwin_title_text) ! g_free(mainwin_title_text); ! // Without the app name prefixed it's much easier to see what's going on ! mainwin_title_text = ! g_strdup_printf("%s", ! g_locale_to_utf8(tmp, -1, NULL, NULL, NULL)); pthread_mutex_unlock(&title_mutex); g_free(tmp); --- 731,739 ---- if ((tmp = playlist_get_info_text()) != NULL) { pthread_mutex_lock(&title_mutex); ! g_free(mainwin_title_text); ! /* Without the app name prefixed it's much easier to see ! * what's going on */ ! mainwin_title_text = g_locale_to_utf8(tmp, -1, NULL, NULL, NULL); pthread_mutex_unlock(&title_mutex); g_free(tmp); *************** *** 1057,1065 **** { guint min = 0, sec = 0, params, time; ! gchar *timestr; ! timestr = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); ! params = sscanf(timestr, "%u:%u", &min, &sec); if (params == 2) time = (min * 60) + sec; --- 1053,1061 ---- { guint min = 0, sec = 0, params, time; ! gchar *time_str; ! time_str = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry))); ! params = sscanf(time_str, "%u:%u", &min, &sec); if (params == 2) time = (min * 60) + sec; *************** *** 1074,1077 **** --- 1070,1075 ---- gtk_widget_destroy(mainwin_jtt); } + + g_free(time_str); } *************** *** 1081,1085 **** GtkWidget *time_entry, *label, *bbox, *jump, *cancel; guint len, tindex; ! gchar timestr[10]; if (!get_input_playing()) --- 1079,1083 ---- GtkWidget *time_entry, *label, *bbox, *jump, *cancel; guint len, tindex; ! gchar time_str[10]; if (!get_input_playing()) *************** *** 1127,1132 **** gtk_widget_show(label); len = playlist_get_current_length() / 1000; ! g_sprintf(timestr, "%u:%2.2u", len / 60, len % 60); ! label = gtk_label_new(timestr); gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 10); gtk_widget_show(label); --- 1125,1133 ---- gtk_widget_show(label); len = playlist_get_current_length() / 1000; ! ! g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", len / 60, len % 60); ! label = gtk_label_new(time_str); ! g_free(time_str); ! gtk_box_pack_start(GTK_BOX(hbox_total), label, FALSE, FALSE, 10); gtk_widget_show(label); *************** *** 1152,1159 **** tindex = input_get_time() / 1000; ! g_sprintf(timestr, "%u:%2.2u", tindex / 60, tindex % 60); ! gtk_entry_set_text(GTK_ENTRY(time_entry), timestr); ! gtk_entry_select_region(GTK_ENTRY(time_entry), 0, strlen(timestr)); gtk_window_set_modal(GTK_WINDOW(mainwin_jtt), 1); --- 1153,1161 ---- tindex = input_get_time() / 1000; ! g_snprintf(time_str, sizeof(time_str), "%u:%2.2u", tindex / 60, ! tindex % 60); ! gtk_entry_set_text(GTK_ENTRY(time_entry), time_str); ! gtk_entry_select_region(GTK_ENTRY(time_entry), 0, strlen(time_str)); gtk_window_set_modal(GTK_WINDOW(mainwin_jtt), 1); *************** *** 1179,1184 **** gtk_tree_model_get(model, &iter, 0, &pos, -1); ! // This *is* kinda retarded, yeah.. ! // FIXME: The whole column should be integer not text pos_guint = g_ascii_strtoull(pos, NULL, 10); --- 1181,1187 ---- gtk_tree_model_get(model, &iter, 0, &pos, -1); ! /* This *is* kinda retarded, yeah.. */ ! ! /* FIXME: The whole column should be integer not text */ pos_guint = g_ascii_strtoull(pos, NULL, 10); *************** *** 1306,1309 **** --- 1309,1313 ---- GList *playlist; gchar *desc_buf; + gchar *row_str; GtkTreeIter iter; GtkTreeSelection *selection; *************** *** 1335,1342 **** desc_buf = ((PlaylistEntry *) playlist->data)->filename; gtk_list_store_append(GTK_LIST_STORE(store), &iter); gtk_list_store_set(GTK_LIST_STORE(store), &iter, ! 0, g_strdup_printf("%d", row++), ! 1, desc_buf, -1); playlist = playlist->next; } --- 1339,1350 ---- desc_buf = ((PlaylistEntry *) playlist->data)->filename; + row_str = g_strdup_printf("%d", row++); + gtk_list_store_append(GTK_LIST_STORE(store), &iter); gtk_list_store_set(GTK_LIST_STORE(store), &iter, ! 0, row_str, 1, desc_buf, -1); ! ! g_free(row_str); ! playlist = playlist->next; } *************** *** 1353,1356 **** --- 1361,1365 ---- gint songnr = 0; + gchar *songnr_str; gchar *desc_buf; gchar **words; *************** *** 1366,1370 **** key = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); store = ! (GtkListStore *) gtk_tree_view_get_model(GTK_TREE_VIEW(userdata)); /* Chop the key string into ' '-separeted key words */ --- 1375,1379 ---- key = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); store = ! GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(userdata))); /* Chop the key string into ' '-separeted key words */ *************** *** 1378,1385 **** while (playlist) { ! char *title, *filename; ! title = ((PlaylistEntry *) playlist->data)->title; ! filename = ((PlaylistEntry *) playlist->data)->filename; if (title) --- 1387,1394 ---- while (playlist) { ! gchar *title, *filename; ! title = PLAYLIST_ENTRY(playlist->data)->title; ! filename = PLAYLIST_ENTRY(playlist->data)->filename; if (title) *************** *** 1390,1395 **** desc_buf = filename; ! // words[0] = NULL equiv nw = 0 ! // words[1] = NULL equiv nw = 1 if (words[0] == NULL) --- 1399,1404 ---- desc_buf = filename; ! /* words[0] = NULL equiv nw = 0 */ ! /* words[1] = NULL equiv nw = 1 */ if (words[0] == NULL) *************** *** 1397,1416 **** else { /* ! * FIXME: The search string should be adapted to the current display setting, ! * e.g. if the user has set it to "%p - %t" then build the match string like that too, ! * or even better, search for each of the tags seperatly. * ! * In any case the string to match should _never_ contain something the user can't actually ! * see in the playlist. */ ! /* I've moved the code to do lowercasing and stuff because IMO ! that should be up to the implementation of the match algorithm. */ ! /* Compare the key words to the string - if ! all the words match, add to the ListStore */ ! /* FIXME: This shouldn't be handled here, but rather in the playlist functions, ! which should return the filename instead of the title if title == NULL. */ if (!title) title = filename; --- 1406,1428 ---- else { /* ! * FIXME: The search string should be adapted to the ! * current display setting, e.g. if the user has set it to ! * "%p - %t" then build the match string like that too, or ! * even better, search for each of the tags seperatly. * ! * In any case the string to match should _never_ contain ! * something the user can't actually see in the playlist. */ ! /* I've moved the code to do lowercasing and stuff because ! IMO that should be up to the implementation of the ! match algorithm. */ ! /* Compare the key words to the string - if all the words ! match, add to the ListStore */ ! /* FIXME: This shouldn't be handled here, but rather in ! the playlist functions, which should return the ! filename instead of the title if title == NULL. */ if (!title) title = filename; *************** *** 1419,1427 **** if (match) { gtk_list_store_append(GTK_LIST_STORE(store), &iter); gtk_list_store_set(GTK_LIST_STORE(store), &iter, ! 0, g_strdup_printf("%d", songnr + 1), ! 1, desc_buf, -1); ! } --- 1431,1439 ---- if (match) { + songnr_str = g_strdup_printf("%d", songnr + 1); gtk_list_store_append(GTK_LIST_STORE(store), &iter); gtk_list_store_set(GTK_LIST_STORE(store), &iter, ! 0, songnr_str, 1, desc_buf, -1); ! g_free(songnr_str); } *************** *** 1435,1442 **** } - g_strfreev(words); PLAYLIST_UNLOCK(); - g_free(key); } --- 1447,1454 ---- } PLAYLIST_UNLOCK(); + g_strfreev(words); + g_free(key); } *************** *** 1447,1450 **** --- 1459,1463 ---- GList *playlist; gchar *desc_buf; + gchar *row_str; gint row; *************** *** 1461,1470 **** playlist = playlist_get(); - /* if (!playlist) - { - PLAYLIST_UNLOCK(); - return; - } - */ mainwin_jtf = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(mainwin_jtf), _("Jump to track")); --- 1474,1477 ---- *************** *** 1599,1606 **** desc_buf = ((PlaylistEntry *) playlist->data)->filename; gtk_list_store_append(GTK_LIST_STORE(jtf_store), &iter); gtk_list_store_set(GTK_LIST_STORE(jtf_store), &iter, ! 0, g_strdup_printf("%d", row++), ! 1, desc_buf, -1); playlist = playlist->next; --- 1606,1616 ---- desc_buf = ((PlaylistEntry *) playlist->data)->filename; + row_str = g_strdup_printf("%d", row++); + gtk_list_store_append(GTK_LIST_STORE(jtf_store), &iter); gtk_list_store_set(GTK_LIST_STORE(jtf_store), &iter, ! 0, row_str, 1, desc_buf, -1); ! ! g_free(row_str); playlist = playlist->next; *************** *** 1748,1755 **** ! void mainwin_add_dir_handler(gchar * dir) { ! if (cfg.filesel_path) ! g_free(cfg.filesel_path); cfg.filesel_path = g_strdup(dir); playlist_clear(); --- 1758,1764 ---- ! void mainwin_add_dir_handler(const gchar * dir) { ! g_free(cfg.filesel_path); cfg.filesel_path = g_strdup(dir); playlist_clear(); *************** *** 3208,3216 **** number_set_number(mainwin_sec_num, timeleft % 10); if (!mainwin_sposition->hs_pressed) { ! gchar temp[3]; ! g_sprintf(temp, "%2.2d", timeleft / 60); textbox_set_text(mainwin_stime_min, temp); ! g_sprintf(temp, "%2.2d", timeleft % 60); textbox_set_text(mainwin_stime_sec, temp); } --- 3217,3225 ---- number_set_number(mainwin_sec_num, timeleft % 10); if (!mainwin_sposition->hs_pressed) { ! gchar temp[5]; ! g_snprintf(temp, sizeof(temp), "%2.2d", timeleft / 60); textbox_set_text(mainwin_stime_min, temp); ! g_snprintf(temp, sizeof(temp), "%2.2d", timeleft % 60); textbox_set_text(mainwin_stime_sec, temp); } Index: playlist.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** playlist.c 26 Dec 2003 03:33:06 -0000 1.24 --- playlist.c 26 Dec 2003 09:22:55 -0000 1.25 *************** *** 464,468 **** } ! guint playlist_ins_dir(gchar * path, glong pos, gboolean background) { --- 464,468 ---- } ! guint playlist_ins_dir(const gchar * path, glong pos, gboolean background) { Index: playlist.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** playlist.h 26 Dec 2003 03:33:06 -0000 1.11 --- playlist.h 26 Dec 2003 09:22:55 -0000 1.12 *************** *** 38,42 **** /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(gchar * dir, glong pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) --- 38,42 ---- /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(const gchar * dir, glong pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) Index: textbox.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/textbox.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** textbox.c 26 Dec 2003 08:30:16 -0000 1.3 --- textbox.c 26 Dec 2003 09:22:55 -0000 1.4 *************** *** 150,158 **** } ! void textbox_set_text(TextBox * tb, gchar * text) { lock_widget(tb); ! gchar *utf8text; if (tb->tb_text) { if (!strcmp(text, tb->tb_text)) { --- 150,159 ---- } ! void textbox_set_text(TextBox * tb, const gchar * text) { + gchar *text_utf8; lock_widget(tb); ! if (tb->tb_text) { if (!strcmp(text, tb->tb_text)) { *************** *** 163,173 **** } ! utf8text = g_locale_to_utf8(text, -1, NULL, NULL, NULL); ! if (utf8text == NULL) ! utf8text = g_strdup(""); ! tb->tb_text = g_strdup(utf8text); unlock_widget(tb); draw_widget(tb); - } --- 164,174 ---- } ! text_utf8 = g_locale_to_utf8(text, -1, NULL, NULL, NULL); ! if (!text_utf8) ! text_utf8 = g_strdup(""); ! tb->tb_text = text_utf8; ! unlock_widget(tb); draw_widget(tb); } Index: textbox.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/textbox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** textbox.h 26 Dec 2003 08:30:16 -0000 1.5 --- textbox.h 26 Dec 2003 09:22:55 -0000 1.6 *************** *** 49,53 **** } TextBox; ! void textbox_set_text(TextBox * tb, gchar * text); void textbox_set_scroll(TextBox * tb, gboolean s); TextBox *create_textbox(GList ** wlist, GdkPixmap * parent, GdkGC * gc, --- 49,53 ---- } TextBox; ! void textbox_set_text(TextBox * tb, const gchar * text); void textbox_set_scroll(TextBox * tb, gboolean s); TextBox *create_textbox(GList ** wlist, GdkPixmap * parent, GdkGC * gc, |
From: <des...@us...> - 2003-12-26 08:48:08
|
Update of /cvsroot/beepmp/bmp In directory sc8-pr-cvs1:/tmp/cvs-serv15327 Modified Files: configure.in Log Message: - bump version up to 0.9.7 - turn off autopoint invocation for gen-auto-scripts by default Index: configure.in =================================================================== RCS file: /cvsroot/beepmp/bmp/configure.in,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** configure.in 24 Dec 2003 01:28:32 -0000 1.14 --- configure.in 26 Dec 2003 08:48:04 -0000 1.15 *************** *** 2,6 **** AC_INIT(beep/main.c) ! VERSION=0.9.6 PACKAGE=bmp AM_INIT_AUTOMAKE($PACKAGE, $VERSION) --- 2,6 ---- AC_INIT(beep/main.c) ! VERSION=0.9.7 PACKAGE=bmp AM_INIT_AUTOMAKE($PACKAGE, $VERSION) |
From: <des...@us...> - 2003-12-26 08:48:07
|
Update of /cvsroot/beepmp/bmp/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv15327/scripts Modified Files: gen-auto-scripts.sh Log Message: - bump version up to 0.9.7 - turn off autopoint invocation for gen-auto-scripts by default Index: gen-auto-scripts.sh =================================================================== RCS file: /cvsroot/beepmp/bmp/scripts/gen-auto-scripts.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gen-auto-scripts.sh 24 Dec 2003 03:34:23 -0000 1.9 --- gen-auto-scripts.sh 26 Dec 2003 08:48:04 -0000 1.10 *************** *** 19,22 **** --- 19,23 ---- echo " -n skip CVS changelog creation" echo " -i disable automake dependency tracking" + echo " -a run autopoint" echo " -h,--help show this help screen" echo *************** *** 31,34 **** --- 32,38 ---- dump_help_screen ;; + -a) + RUN_AUTOPOINT=yes + ;; -n) SKIP_CVS_CHANGELOG=yes *************** *** 108,112 **** # run autotools ! run_or_die $AUTOPOINT $AUTOPOINT_OPTIONS for dir in $DIRECTORIES ; do --- 112,118 ---- # run autotools ! if test "$RUN_AUTOPOINT" = "yes" ; then ! run_or_die $AUTOPOINT $AUTOPOINT_OPTIONS ! fi for dir in $DIRECTORIES ; do |
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv13362 Modified Files: Makefile.am about.c dirbrowser.c dynamic_lib.c effect.h equalizer.c equalizer.h fft.c fullscreen.c fullscreen.h general.h hints.c hslider.c input.h main.c mainwin.h menurow.c monostereo.c monostereo.h number.c number.h output.c output.h pbutton.c pbutton.h playlist_popup.c playlist_popup.h playlist_slider.c playlist_slider.h playlistwin.h playstatus.c pluginenum.c prefswin.c sbutton.c sbutton.h skin.c skin.h skinwin.c skinwin.h sm.c sm.h svis.c svis.h tbutton.c tbutton.h textbox.c textbox.h util.h vis.c vis.h visualization.c visualization.h Removed Files: beep.h Log Message: - removed all inclusion of "beep.h", removed beep.h Index: Makefile.am =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.am 25 Dec 2003 00:58:09 -0000 1.14 --- Makefile.am 26 Dec 2003 08:30:15 -0000 1.15 *************** *** 59,63 **** plugin.h \ softvolume.c softvolume.h \ - beep.h \ getopt.c getopt1.c getopt.h \ urldecode.c urldecode.h \ --- 59,62 ---- Index: about.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/about.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** about.c 26 Dec 2003 06:15:51 -0000 1.5 --- about.c 26 Dec 2003 08:30:15 -0000 1.6 *************** *** 19,23 **** */ ! #include "config.h" #include "about.h" --- 19,25 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif #include "about.h" Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dirbrowser.c 26 Dec 2003 06:15:51 -0000 1.16 --- dirbrowser.c 26 Dec 2003 08:30:15 -0000 1.17 *************** *** 1,3 **** ! #include "config.h" #include "dirbrowser.h" --- 1,6 ---- ! ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif #include "dirbrowser.h" Index: dynamic_lib.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dynamic_lib.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dynamic_lib.c 24 Dec 2003 14:03:14 -0000 1.4 --- dynamic_lib.c 26 Dec 2003 08:30:15 -0000 1.5 *************** *** 1,7 **** #include <glib.h> #include <string.h> - #include "config.h" - #include "dynamic_lib.h" #ifdef HPUX --- 1,10 ---- + #ifdef HAVE_CONFIG_H + # include "config.h" + #endif + + #include "dynamic_lib.h" #include <glib.h> #include <string.h> #ifdef HPUX Index: effect.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/effect.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** effect.h 26 Dec 2003 05:29:35 -0000 1.4 --- effect.h 26 Dec 2003 08:30:15 -0000 1.5 *************** *** 21,24 **** --- 21,25 ---- void effect_enable_from_stringified_list(const gchar * list); + extern struct EffectPluginData *ep_data; #endif Index: equalizer.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** equalizer.c 26 Dec 2003 06:47:05 -0000 1.10 --- equalizer.c 26 Dec 2003 08:30:15 -0000 1.11 *************** *** 19,23 **** */ ! #include "config.h" #include "equalizer.h" --- 19,25 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif #include "equalizer.h" Index: equalizer.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** equalizer.h 26 Dec 2003 06:47:05 -0000 1.5 --- equalizer.h 26 Dec 2003 08:30:15 -0000 1.6 *************** *** 24,27 **** --- 24,29 ---- #include <gtk/gtk.h> + #include "pbutton.h" + #define EQUALIZER_DOUBLESIZE (cfg.doublesize && cfg.eq_doublesize_linked) #define EQUALIZER_HEIGHT ((cfg.equalizer_shaded ? 14 : 116) * (EQUALIZER_DOUBLESIZE + 1)) *************** *** 52,55 **** --- 54,59 ---- extern GtkWidget *equalizerwin; + extern PButton *equalizerwin_close; + extern gboolean equalizerwin_focus; #endif Index: fft.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/fft.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fft.c 24 Dec 2003 14:03:14 -0000 1.2 --- fft.c 26 Dec 2003 08:30:15 -0000 1.3 *************** *** 26,30 **** */ ! #include "config.h" #include "fft.h" --- 26,33 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif ! #include "fft.h" Index: fullscreen.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/fullscreen.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fullscreen.c 24 Dec 2003 14:03:14 -0000 1.2 --- fullscreen.c 26 Dec 2003 08:30:15 -0000 1.3 *************** *** 16,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include <config.h> ! #include "beep.h" #include "libbeep/util.h" #include <X11/Xatom.h> #include <X11/Xmd.h> --- 16,28 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif ! ! #include "fullscreen.h" ! #include "libbeep/util.h" + + #include <X11/Xlib.h> #include <X11/Xatom.h> #include <X11/Xmd.h> Index: fullscreen.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/fullscreen.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fullscreen.h 24 Dec 2003 14:03:14 -0000 1.2 --- fullscreen.h 26 Dec 2003 08:30:15 -0000 1.3 *************** *** 26,31 **** #define _XMMS_FULLSCREEN_H 1 #include <gtk/gtk.h> ! #include <gdk/gdkx.h> typedef struct { --- 26,33 ---- #define _XMMS_FULLSCREEN_H 1 + #include <glib.h> #include <gtk/gtk.h> ! ! #include <X11/Xlib.h> typedef struct { Index: general.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/general.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** general.h 26 Dec 2003 06:15:51 -0000 1.3 --- general.h 26 Dec 2003 08:30:15 -0000 1.4 *************** *** 18,20 **** --- 18,22 ---- void general_enable_from_stringified_list(gchar * list); + extern struct GeneralPluginData *gp_data; + #endif Index: hints.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/hints.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hints.c 24 Dec 2003 14:03:14 -0000 1.2 --- hints.c 26 Dec 2003 08:30:15 -0000 1.3 *************** *** 18,27 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <X11/Xlib.h> #include <X11/Xmd.h> #include <X11/Xatom.h> - #include <gdk/gdkx.h> - #include <gdk/gdkprivate.h> - #include "beep.h" /* flags for the window layer */ --- 18,36 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + #include "hints.h" + + #include <glib.h> + #include <gtk/gtk.h> + + #include "equalizer.h" + #include "mainwin.h" + #include "playlistwin.h" + + #include <gdk/gdkx.h> + #include <gdk/gdkprivate.h> #include <X11/Xlib.h> #include <X11/Xmd.h> #include <X11/Xatom.h> /* flags for the window layer */ Index: hslider.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/hslider.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hslider.c 24 Dec 2003 14:03:14 -0000 1.3 --- hslider.c 26 Dec 2003 08:30:15 -0000 1.4 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void hslider_set_position(HSlider * hs, gint pos) --- 16,27 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "hslider.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! #include <gtk/gtk.h> ! ! #include "skin.h" void hslider_set_position(HSlider * hs, gint pos) Index: input.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/input.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** input.h 24 Dec 2003 14:03:14 -0000 1.8 --- input.h 26 Dec 2003 08:30:15 -0000 1.9 *************** *** 63,65 **** --- 63,67 ---- gchar ** genre, guint * tracknum); + extern struct InputPluginData *ip_data; + #endif Index: main.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/main.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** main.c 25 Dec 2003 23:26:13 -0000 1.27 --- main.c 26 Dec 2003 08:30:15 -0000 1.28 *************** *** 19,24 **** */ ! #if defined(HAVE_CONFIG_H) ! #include "config.h" #endif --- 19,24 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" #endif Index: mainwin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/mainwin.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mainwin.h 24 Dec 2003 14:03:17 -0000 1.6 --- mainwin.h 26 Dec 2003 08:30:15 -0000 1.7 *************** *** 5,8 **** --- 5,9 ---- #include "number.h" + #include "pbutton.h" #include "tbutton.h" #include "textbox.h" *************** *** 31,37 **** extern GtkItemFactory *mainwin_play_menu; ! extern Number *mainwin_minus_num, *mainwin_10min_num, *mainwin_min_num, ! *mainwin_10sec_num, *mainwin_sec_num; extern TButton *mainwin_shuffle, *mainwin_repeat, *mainwin_eq, *mainwin_pl; extern gint mainwin_timeout_tag; --- 32,40 ---- extern GtkItemFactory *mainwin_play_menu; ! extern Number *mainwin_minus_num, *mainwin_10min_num, *mainwin_min_num; ! extern Number *mainwin_10sec_num, *mainwin_sec_num; + extern PButton *mainwin_menubtn, *mainwin_minimize, *mainwin_shade, + *mainwin_close; extern TButton *mainwin_shuffle, *mainwin_repeat, *mainwin_eq, *mainwin_pl; extern gint mainwin_timeout_tag; *************** *** 41,44 **** --- 44,49 ---- extern SVis *mainwin_svis; extern gint bitrate, frequency, numchannels; + + extern gboolean mainwin_focus; void mainwin_create(void); Index: menurow.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/menurow.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** menurow.c 24 Dec 2003 14:03:17 -0000 1.2 --- menurow.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void menurow_draw(Widget * w) --- 16,28 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "menurow.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! ! #include "main.h" ! #include "menurow.h" ! #include "widget.h" void menurow_draw(Widget * w) Index: monostereo.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/monostereo.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** monostereo.c 24 Dec 2003 14:03:17 -0000 1.2 --- monostereo.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 17,21 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void monostereo_draw(Widget * w) --- 17,28 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "monostereo.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! ! #include "skin.h" ! #include "widget.h" void monostereo_draw(Widget * w) Index: monostereo.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/monostereo.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** monostereo.h 24 Dec 2003 14:03:17 -0000 1.2 --- monostereo.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 19,25 **** #define MONOSTEREO_H typedef struct { Widget ms_widget; ! int ms_num_channels; SkinIndex ms_skin_index; } MonoStereo; --- 19,31 ---- #define MONOSTEREO_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "skin.h" + #include "widget.h" + typedef struct { Widget ms_widget; ! gint ms_num_channels; SkinIndex ms_skin_index; } MonoStereo; Index: number.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/number.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** number.c 24 Dec 2003 14:03:17 -0000 1.2 --- number.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 16,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include "beep.h" ! void number_set_number(Number * nu, int number) { if (number == nu->nu_number) --- 16,28 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "number.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! ! #include "skin.h" ! ! void number_set_number(Number * nu, gint number) { if (number == nu->nu_number) Index: number.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/number.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** number.h 24 Dec 2003 14:03:17 -0000 1.3 --- number.h 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- #define NUMBER_H + #include <glib.h> + #include <gdk/gdk.h> + #include "widget.h" #include "skin.h" *************** *** 29,33 **** } Number; ! void number_set_number(Number * nu, int number); Number *create_number(GList ** wlist, GdkPixmap * parent, GdkGC * gc, gint x, gint y, SkinIndex si); --- 32,36 ---- } Number; ! void number_set_number(Number * nu, gint number); Number *create_number(GList ** wlist, GdkPixmap * parent, GdkGC * gc, gint x, gint y, SkinIndex si); Index: output.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/output.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** output.c 24 Dec 2003 14:03:17 -0000 1.5 --- output.c 26 Dec 2003 08:30:16 -0000 1.6 *************** *** 18,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" #include "playlist.h" #include "libbeep/util.h" --- 18,24 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "output.h" ! #include "playlist.h" #include "libbeep/util.h" Index: output.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/output.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** output.h 24 Dec 2003 14:03:17 -0000 1.2 --- output.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 20,23 **** --- 20,27 ---- #define OUTPUT_H + #include <glib.h> + + #include "plugin.h" + struct OutputPluginData { GList *output_list; *************** *** 27,35 **** GList *get_output_list(void); OutputPlugin *get_current_output_plugin(void); ! void set_current_output_plugin(int i); ! void output_about(int i); ! void output_configure(int i); ! void output_get_volume(int *l, int *r); ! void output_set_volume(int l, int r); #endif --- 31,41 ---- GList *get_output_list(void); OutputPlugin *get_current_output_plugin(void); ! void set_current_output_plugin(gint i); ! void output_about(gint i); ! void output_configure(gint i); ! void output_get_volume(gint * l, gint * r); ! void output_set_volume(gint l, gint r); ! ! extern struct OutputPluginData *op_data; #endif Index: pbutton.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/pbutton.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pbutton.c 24 Dec 2003 14:03:17 -0000 1.3 --- pbutton.c 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void pbutton_draw(Widget * w) --- 16,28 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "pbutton.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> ! ! #include "skin.h" ! #include "widget.h" void pbutton_draw(Widget * w) *************** *** 74,78 **** PButton * button) { ! int inside; if (!button->pb_pressed) --- 82,86 ---- PButton * button) { ! gint inside; if (!button->pb_pressed) Index: pbutton.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/pbutton.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pbutton.h 24 Dec 2003 14:03:17 -0000 1.2 --- pbutton.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 19,22 **** --- 19,28 ---- #define PBUTTON_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "widget.h" + #include "skin.h" + typedef struct { Widget pb_widget; Index: playlist_popup.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_popup.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** playlist_popup.c 24 Dec 2003 14:03:17 -0000 1.3 --- playlist_popup.c 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 17,21 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" typedef struct { --- 17,30 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "playlist_popup.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> ! #include <string.h> ! ! #include "skin.h" ! #include "util.h" typedef struct { Index: playlist_popup.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_popup.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** playlist_popup.h 24 Dec 2003 14:03:17 -0000 1.2 --- playlist_popup.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 19,22 **** --- 19,24 ---- #define PLAYLIST_POPUP_H + #include <glib.h> + void playlist_popup_destroy(void); void playlist_popup(gint x, gint y, gint num_items, gint * nx, gint * ny, Index: playlist_slider.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_slider.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** playlist_slider.c 25 Dec 2003 23:26:13 -0000 1.4 --- playlist_slider.c 26 Dec 2003 08:30:16 -0000 1.5 *************** *** 18,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void playlistslider_draw(Widget * w) --- 18,30 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "playlist_slider.h" ! ! #include <glib.h> ! ! #include "playlist.h" ! #include "playlistwin.h" ! #include "skin.h" ! #include "widget.h" void playlistslider_draw(Widget * w) Index: playlist_slider.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_slider.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** playlist_slider.h 24 Dec 2003 14:03:17 -0000 1.3 --- playlist_slider.h 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 21,25 **** --- 21,29 ---- #define PLAYLIST_SLIDER_H + #include <glib.h> + #include <gdk/gdk.h> + #include "playlist_list.h" + #include "widget.h" typedef struct { *************** *** 29,33 **** gint ps_drag_y, ps_prev_y, ps_prev_height; GdkImage *ps_back_image; ! int ps_skin_id; } PlaylistSlider; --- 33,37 ---- gint ps_drag_y, ps_prev_y, ps_prev_height; GdkImage *ps_back_image; ! gint ps_skin_id; } PlaylistSlider; Index: playlistwin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlistwin.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** playlistwin.h 13 Dec 2003 13:31:54 -0000 1.4 --- playlistwin.h 26 Dec 2003 08:30:16 -0000 1.5 *************** *** 21,25 **** --- 21,28 ---- #define PLAYLISTWIN_H + #include <glib.h> + #include "mainwin.h" + #include "pbutton.h" #include "playlist_list.h" *************** *** 55,58 **** --- 58,65 ---- extern Vis *playlistwin_vis; extern PlayList_List *playlistwin_list; + + extern PButton *playlistwin_shade, *playlistwin_close; + + extern gboolean playlistwin_focus; #endif Index: playstatus.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playstatus.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** playstatus.c 24 Dec 2003 14:03:17 -0000 1.2 --- playstatus.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void playstatus_draw(Widget * w) --- 16,27 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "playstatus.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! ! #include "skin.h" ! #include "widget.h" void playstatus_draw(Widget * w) Index: pluginenum.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/pluginenum.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pluginenum.c 26 Dec 2003 03:33:06 -0000 1.14 --- pluginenum.c 26 Dec 2003 08:30:16 -0000 1.15 *************** *** 43,54 **** }; - extern struct InputPluginData *ip_data; - extern struct OutputPluginData *op_data; - extern struct EffectPluginData *ep_data; - extern struct GeneralPluginData *gp_data; - extern struct VisPluginData *vp_data; - - extern Config cfg; - static gint d_iplist_compare(gconstpointer a, gconstpointer b) { --- 43,46 ---- Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** prefswin.c 26 Dec 2003 06:47:05 -0000 1.6 --- prefswin.c 26 Dec 2003 08:30:16 -0000 1.7 *************** *** 77,89 **** PangoFontDescription *mainwin_font; - - extern MenuRow *mainwin_menurow; - - extern PButton *playlistwin_shade, *playlistwin_close, *equalizerwin_close; - extern PButton *mainwin_menubtn, *mainwin_minimize, *mainwin_shade, - *mainwin_close; - extern TextBox *mainwin_info; - extern gboolean mainwin_focus, equalizerwin_focus, playlistwin_focus; - static gboolean is_opening = FALSE; static gint selected_oplugin; --- 77,80 ---- Index: sbutton.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/sbutton.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sbutton.c 24 Dec 2003 14:03:17 -0000 1.3 --- sbutton.c 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void sbutton_button_press_cb(GtkWidget * widget, GdkEventButton * event, --- 16,25 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "sbutton.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> void sbutton_button_press_cb(GtkWidget * widget, GdkEventButton * event, Index: sbutton.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/sbutton.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sbutton.h 24 Dec 2003 14:03:17 -0000 1.2 --- sbutton.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 19,22 **** --- 19,28 ---- #define SBUTTON_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "widget.h" + + #define SBUTTON(x) ((SButton *)(x)) typedef struct { Widget sb_widget; Index: skin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/skin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** skin.c 24 Dec 2003 14:03:17 -0000 1.12 --- skin.c 26 Dec 2003 08:30:16 -0000 1.13 *************** *** 19,38 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define G_LOG_DOMAIN "skin.c" /* TODO: enforce default sizes! */ ! #include "beep.h" #include <ctype.h> #define DEFAULT_SKIN_PATH DATA_DIR "/Skins/Default" #ifndef HAVE_MKDTEMP ! char *mkdtemp(char *path); #endif Skin *skin; ! static int skin_current_num; typedef struct { --- 19,57 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #define G_LOG_DOMAIN "skin.c" + #ifdef HAVE_CONFIG_H + # include "config.h" + #endif + /* TODO: enforce default sizes! */ ! #include <glib.h> ! #include <stdio.h> ! #include <stdlib.h> ! #include <string.h> #include <ctype.h> + #include "bmp.h" + #include "equalizer.h" + #include "main.h" + #include "playlistwin.h" + #include "skin.h" + #include "skinwin.h" + #include "util.h" + + #include <gdk/gdkx.h> + #include <X11/Xlib.h> + #define DEFAULT_SKIN_PATH DATA_DIR "/Skins/Default" #ifndef HAVE_MKDTEMP ! gchar *mkdtemp(gchar * path); #endif Skin *skin; ! static gint skin_current_num; typedef struct { *************** *** 224,228 **** } ! void skin_mask_create(Skin * sk, const gchar * path, int id, GdkWindow * win) { --- 243,247 ---- } ! void skin_mask_create(Skin * sk, const gchar * path, gint id, GdkWindow * win) { *************** *** 596,600 **** } ! static void skin_load_pixmaps(const char *path) { GdkPixmap *text_pm; --- 615,619 ---- } ! static void skin_load_pixmaps(const gchar * path) { GdkPixmap *text_pm; Index: skin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/skin.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** skin.h 24 Dec 2003 14:03:17 -0000 1.5 --- skin.h 26 Dec 2003 08:30:16 -0000 1.6 *************** *** 21,24 **** --- 21,25 ---- #define SKIN_H + #include <glib.h> #include <gdk/gdk.h> Index: skinwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/skinwin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** skinwin.c 26 Dec 2003 03:33:06 -0000 1.10 --- skinwin.c 26 Dec 2003 08:30:16 -0000 1.11 *************** *** 18,30 **** */ ! #include "beep.h" ! #include "beep/skin.h" #include "skin.h" #include "na.xpm" #include "beep_mini.xpm" GtkWidget *skinwin = NULL, *skinwin_close, *scrolled_win; GList *skinlist = NULL; - //static pthread_mutex_t skinwin_mutex = PTHREAD_MUTEX_INITIALIZER; void create_skin_window(void); --- 18,45 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif ! ! #include "skinwin.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! #include <gdk/gdkkeysyms.h> ! #include <gtk/gtk.h> ! #include <stdlib.h> ! #include <string.h> ! ! #include "main.h" #include "skin.h" + #include "util.h" + #include "na.xpm" #include "beep_mini.xpm" + #include <gdk/gdkx.h> + GtkWidget *skinwin = NULL, *skinwin_close, *scrolled_win; GList *skinlist = NULL; void create_skin_window(void); *************** *** 101,105 **** { ! char *name; GtkTreeIter iter; GtkTreeView *treeview = GTK_TREE_VIEW(data); --- 116,120 ---- { ! gchar *name; GtkTreeIter iter; GtkTreeView *treeview = GTK_TREE_VIEW(data); *************** *** 144,149 **** static void add_skin(gchar * skin) { ! struct SkinNode *node = ! (struct SkinNode *) g_malloc(sizeof(struct SkinNode)); gchar *tmp = NULL; --- 159,163 ---- static void add_skin(gchar * skin) { ! struct SkinNode *node = SKIN_NODE(g_malloc(sizeof(struct SkinNode))); gchar *tmp = NULL; Index: skinwin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/skinwin.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** skinwin.h 24 Dec 2003 14:03:17 -0000 1.3 --- skinwin.h 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 20,25 **** --- 20,29 ---- #define SKINWIN_H + #include <glib.h> + #include <gtk/gtk.h> + extern GList *skinlist; + #define SKIN_NODE(x) ((struct SkinNode *)(x)) struct SkinNode { gchar *name, *path; Index: sm.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/sm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sm.c 24 Dec 2003 14:03:17 -0000 1.2 --- sm.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 18,34 **** */ ! #include "beep.h" #ifdef WITH_SM - #include <X11/SM/SMlib.h> ! void mainwin_quit_cb(void); static SmcConn smc_conn = NULL; static IceConn ice_conn; ! static char *session_id; ! static void sm_save_yourself(SmcConn c, SmPointer p, int save_type, ! Bool shutdown, int interact_style, Bool fast) { GDK_THREADS_ENTER(); --- 18,42 ---- */ ! #ifdef HAVE_CONFIG_H ! # include "config.h" ! #endif ! ! #include "sm.h" ! ! #include <glib.h> ! #ifdef WITH_SM ! #include <gdk/gdk.h> ! ! #include <X11/SM/SMlib.h> static SmcConn smc_conn = NULL; static IceConn ice_conn; ! static gchar *session_id; ! static void sm_save_yourself(SmcConn c, SmPointer p, gint save_type, ! Bool shutdown, gint interact_style, Bool fast) { GDK_THREADS_ENTER(); *************** *** 59,66 **** } ! void sm_init(int argc, char **argv, const char *previous_session_id) { SmcCallbacks smcall; ! char errstr[256]; if (!getenv("SESSION_MANAGER")) --- 67,74 ---- } ! void sm_init(gint argc, gchar ** argv, const gchar * previous_session_id) { SmcCallbacks smcall; ! gchar errstr[256]; if (!getenv("SESSION_MANAGER")) *************** *** 78,82 **** SmcShutdownCancelledProcMask | SmcDieProcMask, ! &smcall, (char *) previous_session_id, &session_id, sizeof(errstr), errstr); if (smc_conn) { --- 86,90 ---- SmcShutdownCancelledProcMask | SmcDieProcMask, ! &smcall, (gchar *) previous_session_id, &session_id, sizeof(errstr), errstr); if (smc_conn) { *************** *** 144,148 **** #else ! void sm_init(int argc, char **argv, const char *previous_session_id) { } --- 152,156 ---- #else ! void sm_init(gint argc, gchar ** argv, const gchar * previous_session_id) { } Index: sm.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/sm.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sm.h 19 Nov 2003 16:02:50 -0000 1.1.1.1 --- sm.h 26 Dec 2003 08:30:16 -0000 1.2 *************** *** 20,25 **** #define SM_H ! void sm_init(int argc, char **argv, const char *previous_session_id); ! void sm_cleanup(void); #endif --- 20,35 ---- #define SM_H ! #include <glib.h> ! ! #ifdef __cplusplus ! extern "C" { ! #endif + void sm_init(gint argc, gchar ** argv, + const gchar * previous_session_id); + void sm_cleanup(void); + + #ifdef __cplusplus + } + #endif #endif Index: svis.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/svis.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** svis.c 24 Dec 2003 14:03:17 -0000 1.2 --- svis.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 17,21 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" static gint svis_redraw_delays[] = { 1, 2, 4, 8 }; --- 17,32 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "svis.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! #include <string.h> ! ! #include "main.h" ! #include "mainwin.h" ! #include "plugin.h" ! #include "widget.h" ! #include "vis.h" static gint svis_redraw_delays[] = { 1, 2, 4, 8 }; Index: svis.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/svis.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** svis.h 24 Dec 2003 14:03:17 -0000 1.2 --- svis.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 20,23 **** --- 20,30 ---- #define SVIS_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "svis.h" + #include "widget.h" + + #define SVIS(x) ((SVis *)(x)) typedef struct { Widget vs_widget; Index: tbutton.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/tbutton.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tbutton.c 24 Dec 2003 14:03:17 -0000 1.3 --- tbutton.c 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void tbutton_draw(Widget * w) --- 16,26 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "tbutton.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! ! #include "widget.h" void tbutton_draw(Widget * w) *************** *** 92,96 **** TButton * button) { ! int inside; if (!button->tb_pressed) --- 98,102 ---- TButton * button) { ! gint inside; if (!button->tb_pressed) Index: tbutton.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/tbutton.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tbutton.h 24 Dec 2003 14:03:17 -0000 1.2 --- tbutton.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 19,22 **** --- 19,28 ---- #define TBUTTON_H + #include <glib.h> + + #include "skin.h" + #include "widget.h" + + #define TBUTTON(x) ((TButton *)(x)) typedef struct { Widget tb_widget; Index: textbox.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/textbox.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** textbox.c 24 Dec 2003 14:03:17 -0000 1.2 --- textbox.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 18,24 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" #include <gdk/gdkprivate.h> #include <ctype.h> static void textbox_generate_pixmap(TextBox * tb); --- 18,33 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "textbox.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> #include <gdk/gdkprivate.h> + #include <string.h> #include <ctype.h> + + #include "main.h" + #include "util.h" static void textbox_generate_pixmap(TextBox * tb); Index: textbox.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/textbox.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** textbox.h 24 Dec 2003 14:03:17 -0000 1.4 --- textbox.h 26 Dec 2003 08:30:16 -0000 1.5 *************** *** 21,30 **** #define TEXTBOX_H #include "skin.h" #include "widget.h" ! #define TEXTBOX_SCROLL_TIMEOUT 200 ! #define TEXTBOX_SCROLL_SMOOTH_TIMEOUT 30 typedef struct { Widget tb_widget; --- 21,35 ---- #define TEXTBOX_H + #include <glib.h> + #include <gdk/gdk.h> + #include <pango/pango.h> + #include "skin.h" #include "widget.h" ! #define TEXTBOX_SCROLL_TIMEOUT 200 ! #define TEXTBOX_SCROLL_SMOOTH_TIMEOUT 30 + #define TEXTBOX(x) ((TextBox*)(x)) typedef struct { Widget tb_widget; *************** *** 37,41 **** gint tb_timeout_tag, tb_drag_x, tb_drag_off; gint tb_nominal_y, tb_nominal_height; ! int tb_skin_id; SkinIndex tb_skin_index; PangoFontDescription *tb_font; --- 42,46 ---- gint tb_timeout_tag, tb_drag_x, tb_drag_off; gint tb_nominal_y, tb_nominal_height; ! gint tb_skin_id; SkinIndex tb_skin_index; PangoFontDescription *tb_font; Index: util.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** util.h 26 Dec 2003 05:29:35 -0000 1.8 --- util.h 26 Dec 2003 08:30:16 -0000 1.9 *************** *** 23,28 **** #include "i18n.h" ! #define NO_PLAY_BUTTON FALSE ! #define PLAY_BUTTON TRUE gchar *escape_shell_chars(const gchar * string); --- 23,31 ---- #include "i18n.h" ! #include <glib.h> ! #include <gtk/gtk.h> ! ! #define NO_PLAY_BUTTON FALSE ! #define PLAY_BUTTON TRUE gchar *escape_shell_chars(const gchar * string); Index: vis.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/vis.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** vis.c 24 Dec 2003 14:03:17 -0000 1.2 --- vis.c 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 17,21 **** */ ! #include "beep.h" static const gfloat vis_afalloff_speeds[] = { 0.34, 0.5, 1.0, 1.3, 1.6 }; --- 17,29 ---- */ ! #include "vis.h" ! ! #include <glib.h> ! #include <gdk/gdk.h> ! #include <string.h> ! ! #include "main.h" ! #include "skin.h" ! #include "widget.h" static const gfloat vis_afalloff_speeds[] = { 0.34, 0.5, 1.0, 1.3, 1.6 }; Index: vis.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/vis.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vis.h 24 Dec 2003 14:03:17 -0000 1.3 --- vis.h 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 19,22 **** --- 19,25 ---- #define VIS_H + #include <glib.h> + #include <gdk/gdk.h> + #include "widget.h" *************** *** 50,53 **** --- 53,57 ---- } FalloffSpeed; + #define VIS(x) ((Vis *)(x)) typedef struct { Widget vs_widget; Index: visualization.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/visualization.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** visualization.c 24 Dec 2003 14:03:17 -0000 1.3 --- visualization.c 26 Dec 2003 08:30:16 -0000 1.4 *************** *** 18,27 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" #include "fft.h" struct VisPluginData *vp_data; - extern Vis *active_vis; - extern SVis *mainwin_svis; GList *get_vis_list(void) --- 18,39 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "visualization.h" ! ! #include <glib.h> ! #include <stdlib.h> ! #include <math.h> ! #include <string.h> ! #include "fft.h" + #include "input.h" + #include "main.h" + #include "plugin.h" + #include "prefswin.h" + #include "svis.h" + #include "vis.h" + #include "widget.h" struct VisPluginData *vp_data; GList *get_vis_list(void) *************** *** 42,46 **** } ! void vis_about(int i) { GList *node = g_list_nth(vp_data->vis_list, i); --- 54,58 ---- } ! void vis_about(gint i) { GList *node = g_list_nth(vp_data->vis_list, i); *************** *** 117,121 **** } ! gboolean vis_enabled(int i) { return (g_list_find --- 129,133 ---- } ! gboolean vis_enabled(gint i) { return (g_list_find Index: visualization.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/visualization.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** visualization.h 24 Dec 2003 14:03:17 -0000 1.2 --- visualization.h 26 Dec 2003 08:30:16 -0000 1.3 *************** *** 21,24 **** --- 21,28 ---- #define VISUALIZATION_H + #include <glib.h> + + #include "plugin.h" + struct VisPluginData { GList *vis_list; *************** *** 29,42 **** GList *get_vis_list(void); GList *get_vis_enabled_list(void); ! void enable_vis_plugin(int i, gboolean enable); void vis_disable_plugin(VisPlugin * vp); ! void vis_about(int i); ! void vis_configure(int i); void vis_playback_start(void); void vis_playback_stop(void); ! gboolean vis_enabled(int i); gchar *vis_stringify_enabled_list(void); void vis_enable_from_stringified_list(gchar * list); ! void vis_send_data(gint16 pcm_data[2][512], int nch, int lenght); #endif --- 33,48 ---- GList *get_vis_list(void); GList *get_vis_enabled_list(void); ! void enable_vis_plugin(gint i, gboolean enable); void vis_disable_plugin(VisPlugin * vp); ! void vis_about(gint i); ! void vis_configure(gint i); void vis_playback_start(void); void vis_playback_stop(void); ! gboolean vis_enabled(gint i); gchar *vis_stringify_enabled_list(void); void vis_enable_from_stringified_list(gchar * list); ! void vis_send_data(gint16 pcm_data[2][512], gint nch, gint length); ! ! extern struct VisPluginData *vp_data; #endif --- beep.h DELETED --- |
From: <des...@us...> - 2003-12-26 06:47:09
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv1883 Modified Files: eq_graph.c eq_graph.h eq_slider.c eq_slider.h equalizer.c equalizer.h hints.h hslider.h menurow.h prefswin.c prefswin.h util.c widget.c widget.h Log Message: - removed '#include "beep.h"' Index: eq_graph.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/eq_graph.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** eq_graph.c 24 Dec 2003 14:03:14 -0000 1.2 --- eq_graph.c 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 16,20 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void init_spline(gfloat * x, gfloat * y, gint n, gfloat * y2) --- 16,26 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "eq_graph.h" ! ! #include <glib.h> ! ! #include "main.h" ! #include "skin.h" void init_spline(gfloat * x, gfloat * y, gint n, gfloat * y2) *************** *** 44,48 **** } ! float eval_spline(gfloat xa[], gfloat ya[], gfloat y2a[], gint n, gfloat x) { gint klo, khi, k; --- 50,55 ---- } ! gfloat eval_spline(gfloat xa[], gfloat ya[], gfloat y2a[], gint n, ! gfloat x) { gint klo, khi, k; Index: eq_graph.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/eq_graph.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** eq_graph.h 24 Dec 2003 14:03:14 -0000 1.2 --- eq_graph.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 19,22 **** --- 19,27 ---- #define EQ_GRAPH_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "widget.h" + typedef struct { Widget eg_widget; Index: eq_slider.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/eq_slider.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eq_slider.c 24 Dec 2003 14:03:14 -0000 1.3 --- eq_slider.c 26 Dec 2003 06:47:05 -0000 1.4 *************** *** 16,24 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" void eqslider_set_position(EqSlider * es, gfloat pos) { ! es->es_position = 25 - (int) ((pos * 25.0) / 20.0); if (es->es_position < 0) es->es_position = 0; --- 16,34 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "eq_slider.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> ! ! #include "i18n.h" ! #include "equalizer.h" ! #include "mainwin.h" ! #include "skin.h" void eqslider_set_position(EqSlider * es, gfloat pos) { ! es->es_position = 25 - (gint) ((pos * 25.0) / 20.0); if (es->es_position < 0) es->es_position = 0; Index: eq_slider.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/eq_slider.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** eq_slider.h 24 Dec 2003 14:03:14 -0000 1.2 --- eq_slider.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 19,22 **** --- 19,27 ---- #define EQ_SLIDER_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "widget.h" + typedef struct { Widget es_widget; Index: equalizer.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** equalizer.c 25 Dec 2003 23:26:13 -0000 1.9 --- equalizer.c 26 Dec 2003 06:47:05 -0000 1.10 *************** *** 18,25 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" #include "libbeep/configfile.h" - #include "beep_mini.xpm" #include "main.h" GtkWidget *equalizerwin; --- 18,54 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "config.h" ! ! #include "equalizer.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> ! #include <gdk/gdkkeysyms.h> ! #include <stdio.h> ! #include <math.h> ! #include <string.h> ! ! #include "i18n.h" ! #include "dock.h" ! #include "eq_graph.h" ! #include "eq_slider.h" ! #include "hints.h" ! #include "hslider.h" ! #include "input.h" #include "libbeep/configfile.h" #include "main.h" + #include "pbutton.h" + #include "playlist.h" + #include "playlistwin.h" + #include "tbutton.h" + #include "util.h" + + #include "beep_mini.xpm" + + #include <gdk/gdkx.h> + #include <X11/Xlib.h> + GtkWidget *equalizerwin; *************** *** 532,536 **** gchar section[21]; ! sprintf(section, "Preset%d", p++); if (xmms_cfg_read_string(cfgfile, "Presets", section, &name)) { preset = g_malloc(sizeof(EqualizerPreset)); --- 561,565 ---- gchar section[21]; ! g_snprintf(section, sizeof(section), "Preset%d", p++); if (xmms_cfg_read_string(cfgfile, "Presets", section, &name)) { preset = g_malloc(sizeof(EqualizerPreset)); *************** *** 539,543 **** for (i = 0; i < 10; i++) { gchar band[7]; ! sprintf(band, "Band%d", i); xmms_cfg_read_float(cfgfile, name, band, &preset->bands[i]); --- 568,572 ---- for (i = 0; i < 10; i++) { gchar band[7]; ! g_snprintf(band, sizeof(band), "Band%d", i); xmms_cfg_read_float(cfgfile, name, band, &preset->bands[i]); *************** *** 1823,1827 **** gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); ! /* gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(mainwin)); */ gtk_container_border_width(GTK_CONTAINER(window), 10); --- 1852,1856 ---- gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); ! /* gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(mainwin)); */ gtk_container_border_width(GTK_CONTAINER(window), 10); Index: equalizer.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** equalizer.h 24 Dec 2003 14:03:14 -0000 1.4 --- equalizer.h 26 Dec 2003 06:47:05 -0000 1.5 *************** *** 21,24 **** --- 21,27 ---- #define EQUALIZER_H + #include <glib.h> + #include <gtk/gtk.h> + #define EQUALIZER_DOUBLESIZE (cfg.doublesize && cfg.eq_doublesize_linked) #define EQUALIZER_HEIGHT ((cfg.equalizer_shaded ? 14 : 116) * (EQUALIZER_DOUBLESIZE + 1)) Index: hints.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/hints.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hints.h 24 Dec 2003 14:03:14 -0000 1.2 --- hints.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 2,5 **** --- 2,8 ---- #define HINTS_H + #include <glib.h> + #include <gtk/gtk.h> + /* Window Managers */ #define WM_HINTS_NONE 0 *************** *** 13,17 **** gboolean hint_always_on_top_available(void); gboolean hint_move_resize_available(void); ! void hint_move_resize(GtkWidget * window, int x, int y, gboolean move); #endif --- 16,20 ---- gboolean hint_always_on_top_available(void); gboolean hint_move_resize_available(void); ! void hint_move_resize(GtkWidget * window, gint x, gint y, gboolean move); #endif Index: hslider.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/hslider.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hslider.h 24 Dec 2003 14:03:14 -0000 1.2 --- hslider.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 19,22 **** --- 19,28 ---- #define HSLIDER_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "skin.h" + #include "widget.h" + typedef struct { Widget hs_widget; Index: menurow.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/menurow.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** menurow.h 24 Dec 2003 14:03:17 -0000 1.2 --- menurow.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 19,22 **** --- 19,28 ---- #define MENUROW_H + #include <glib.h> + #include <gdk/gdk.h> + + #include "skin.h" + #include "widget.h" + typedef enum { MENUROW_NONE, MENUROW_OPTIONS, MENUROW_ALWAYS, MENUROW_FILEINFOBOX, Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** prefswin.c 25 Dec 2003 23:26:13 -0000 1.5 --- prefswin.c 26 Dec 2003 06:47:05 -0000 1.6 *************** *** 27,33 **** */ ! #include "beep.h" #include "libbeep/util.h" #include "libbeep/titlestring.h" static GtkWidget *prefswin, *prefswin_notebook, *prefswin_ok; --- 27,53 ---- */ ! #include "prefswin.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <stdio.h> ! #include <stdlib.h> ! ! #include "i18n.h" ! #include "effect.h" ! #include "equalizer.h" ! #include "general.h" ! #include "hints.h" ! #include "input.h" #include "libbeep/util.h" #include "libbeep/titlestring.h" + #include "main.h" + #include "menurow.h" + #include "playlist.h" + #include "playlistwin.h" + #include "output.h" + #include "pbutton.h" + #include "textbox.h" + #include "visualization.h" static GtkWidget *prefswin, *prefswin_notebook, *prefswin_ok; *************** *** 1713,1717 **** gtk_entry_set_text(GTK_ENTRY(prefswin_title_entry), cfg.gentitle_format); ! sprintf(temp, "%u", cfg.snap_distance); gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); --- 1733,1737 ---- gtk_entry_set_text(GTK_ENTRY(prefswin_title_entry), cfg.gentitle_format); ! snprintf(temp, sizeof(temp), "%u", cfg.snap_distance); gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); Index: prefswin.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** prefswin.h 24 Dec 2003 14:03:17 -0000 1.2 --- prefswin.h 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- #define PREFSWIN_H + #include <glib.h> + #include <gtk/gtk.h> + void create_prefs_window(void); void show_prefs_window(void); Index: util.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** util.c 26 Dec 2003 05:29:35 -0000 1.12 --- util.c 26 Dec 2003 06:47:05 -0000 1.13 *************** *** 19,30 **** */ - #include "beep_mini.xpm" - #include "beep.h" - #include "main.h" #include <gdk/gdkprivate.h> #include <gtk/gtkimage.h> #include <X11/Xlib.h> #include <sys/ipc.h> ! #include <ctype.h> #ifdef HAVE_FTS_H --- 19,41 ---- */ #include <gdk/gdkprivate.h> #include <gtk/gtkimage.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <ctype.h> + + #include "i18n.h" + #include "input.h" + #include "main.h" + #include "playlist.h" + #include "beep_mini.xpm" + + #include <gdk/gdkx.h> #include <X11/Xlib.h> #include <sys/ipc.h> ! #include <unistd.h> ! #include <errno.h> ! #include <dirent.h> #ifdef HAVE_FTS_H *************** *** 254,258 **** g_message ("Failed to create temporary directory: %s. Unable to load skin.", ! strerror(errno)); return retval; } --- 265,269 ---- g_message ("Failed to create temporary directory: %s. Unable to load skin.", ! g_strerror(errno)); return retval; } Index: widget.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/widget.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** widget.c 24 Dec 2003 14:03:17 -0000 1.2 --- widget.c 26 Dec 2003 06:47:05 -0000 1.3 *************** *** 16,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include "beep.h" ! int inside_widget(gint x, gint y, void *p) { Widget *w = (Widget *) p; --- 16,23 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "widget.h" ! ! gint inside_widget(gint x, gint y, gpointer p) { Widget *w = (Widget *) p; *************** *** 28,32 **** } ! void show_widget(void *w) { ((Widget *) w)->visible = 1; --- 29,33 ---- } ! void show_widget(gpointer w) { ((Widget *) w)->visible = 1; *************** *** 34,43 **** } ! void hide_widget(void *w) { ((Widget *) w)->visible = 0; } ! void resize_widget(void *w, gint width, gint height) { ((Widget *) w)->width = width; --- 35,44 ---- } ! void hide_widget(gpointer w) { ((Widget *) w)->visible = 0; } ! void resize_widget(gpointer w, gint width, gint height) { ((Widget *) w)->width = width; *************** *** 46,50 **** } ! void move_widget(void *w, gint x, gint y) { ((Widget *) w)->x = x; --- 47,51 ---- } ! void move_widget(gpointer w, gint x, gint y) { ((Widget *) w)->x = x; *************** *** 53,57 **** } ! void draw_widget(void *p) { Widget *w = (Widget *) p; --- 54,58 ---- } ! void draw_widget(gpointer p) { Widget *w = (Widget *) p; *************** *** 62,66 **** } ! void add_widget(GList ** list, void *w) { (*list) = g_list_append(*list, w); --- 63,67 ---- } ! void add_widget(GList ** list, gpointer w) { (*list) = g_list_append(*list, w); *************** *** 160,169 **** } ! void lock_widget(void *w) { pthread_mutex_lock(&((Widget *) w)->mutex); } ! void unlock_widget(void *w) { pthread_mutex_unlock(&((Widget *) w)->mutex); --- 161,170 ---- } ! void lock_widget(gpointer w) { pthread_mutex_lock(&((Widget *) w)->mutex); } ! void unlock_widget(gpointer w) { pthread_mutex_unlock(&((Widget *) w)->mutex); Index: widget.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/widget.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** widget.h 24 Dec 2003 14:03:17 -0000 1.3 --- widget.h 26 Dec 2003 06:47:05 -0000 1.4 *************** *** 35,45 **** } Widget; ! int inside_widget(gint x, gint y, void *w); ! void show_widget(void *w); ! void hide_widget(void *w); ! void resize_widget(void *w, gint width, gint height); ! void move_widget(void *w, gint x, gint y); ! void draw_widget(void *w); ! void add_widget(GList ** list, void *v); void handle_press_cb(GList * wlist, GtkWidget * widget, GdkEventButton * event); --- 35,45 ---- } Widget; ! int inside_widget(gint x, gint y, gpointer w); ! void show_widget(gpointer w); ! void hide_widget(gpointer w); ! void resize_widget(gpointer w, gint width, gint height); ! void move_widget(gpointer w, gint x, gint y); ! void draw_widget(gpointer w); ! void add_widget(GList ** list, gpointer v); void handle_press_cb(GList * wlist, GtkWidget * widget, GdkEventButton * event); *************** *** 51,56 **** void widget_list_change_pixmap(GList * wlist, GdkPixmap * pixmap); void clear_widget_list_redraw(GList * wlist); ! void lock_widget(void *w); ! void unlock_widget(void *w); void lock_widget_list(GList * wlist); void unlock_widget_list(GList * wlist); --- 51,56 ---- void widget_list_change_pixmap(GList * wlist, GdkPixmap * pixmap); void clear_widget_list_redraw(GList * wlist); ! void lock_widget(gpointer w); ! void unlock_widget(gpointer w); void lock_widget_list(GList * wlist); void unlock_widget_list(GList * wlist); |
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv30901 Modified Files: about.c bmp.c bmp.h dirbrowser.c dirbrowser.h dnd.h dock.c dock.h general.c general.h Log Message: - removed '#Include "beep.h"' Index: about.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/about.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** about.c 24 Dec 2003 17:30:09 -0000 1.4 --- about.c 26 Dec 2003 06:15:51 -0000 1.5 *************** *** 18,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" #include "beep_logo.xpm" --- 18,29 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "config.h" ! ! #include "about.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include "i18n.h" #include "beep_logo.xpm" Index: bmp.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/bmp.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bmp.c 24 Dec 2003 14:03:12 -0000 1.2 --- bmp.c 26 Dec 2003 06:15:51 -0000 1.3 *************** *** 18,22 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" typedef struct tagRGBQUAD { --- 18,31 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "bmp.h" ! ! #include <glib.h> ! #include <stdio.h> ! #include <string.h> ! ! #include "mainwin.h" ! ! #include <sys/stat.h> typedef struct tagRGBQUAD { Index: bmp.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/bmp.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** bmp.h 19 Nov 2003 16:02:53 -0000 1.1.1.1 --- bmp.h 26 Dec 2003 06:15:51 -0000 1.2 *************** *** 20,24 **** #define BMP_H ! GdkPixmap *read_bmp(char *file); #endif --- 20,26 ---- #define BMP_H ! #include <gdk/gdk.h> ! ! GdkPixmap *read_bmp(gchar * file); #endif Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dirbrowser.c 26 Dec 2003 03:33:06 -0000 1.15 --- dirbrowser.c 26 Dec 2003 06:15:51 -0000 1.16 *************** *** 1,13 **** ! #include "beep.h" ! #include "main.h" #include <time.h> #include "libbeep/util.h" #include "libbeep/configfile.h" ! #include <sys/stat.h> ! #include <unistd.h> #include "playlistwin.h" #include "pixmaps.h" ! #include <string.h> ! #include <beep_mini.xpm> #define FILENAME_COL 3 --- 1,28 ---- ! #include "config.h" ! ! #include "dirbrowser.h" ! ! #include <glib.h> ! #include <gtk/gtk.h> ! #include <gdk/gdk.h> ! #include <gdk/gdkkeysyms.h> ! #include <stdio.h> ! #include <string.h> #include <time.h> + + #include "i18n.h" + #include "input.h" + #include "main.h" #include "libbeep/util.h" #include "libbeep/configfile.h" ! #include "playlist.h" #include "playlistwin.h" #include "pixmaps.h" ! #include "beep_mini.xpm" ! ! #include <gdk/gdkx.h> ! #include <sys/stat.h> ! #include <unistd.h> ! #include <dirent.h> #define FILENAME_COL 3 *************** *** 1398,1402 **** } ! GtkWidget *bmp_db_create(gchar * current_path) { static GtkWidget *window; --- 1413,1417 ---- } ! GtkWidget *bmp_db_create(const gchar * current_path) { static GtkWidget *window; Index: dirbrowser.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dirbrowser.h 26 Dec 2003 05:29:35 -0000 1.3 --- dirbrowser.h 26 Dec 2003 06:15:51 -0000 1.4 *************** *** 5,10 **** #include <gtk/gtk.h> ! GtkWidget *beep_create_dir_browser(gchar * current_path); ! GtkWidget *bmp_db_create(gchar * current_path); #endif --- 5,9 ---- #include <gtk/gtk.h> ! GtkWidget *bmp_db_create(const gchar * current_path); #endif Index: dnd.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dnd.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dnd.h 24 Dec 2003 14:03:14 -0000 1.2 --- dnd.h 26 Dec 2003 06:15:51 -0000 1.3 *************** *** 17,20 **** --- 17,22 ---- */ + #include <gtk/gtk.h> + /* Designate dropped data types that we know and care about */ enum { Index: dock.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dock.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dock.c 24 Dec 2003 14:03:14 -0000 1.3 --- dock.c 26 Dec 2003 06:15:51 -0000 1.4 *************** *** 1,4 **** ! #include "beep.h" typedef struct { --- 1,10 ---- ! #include "dock.h" ! ! #include <gdk/gdk.h> ! #include <stdlib.h> ! #include "main.h" + #include <gdk/gdkx.h> + #include <X11/Xlib.h> typedef struct { Index: dock.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dock.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dock.h 24 Dec 2003 14:03:14 -0000 1.3 --- dock.h 26 Dec 2003 06:15:51 -0000 1.4 *************** *** 2,5 **** --- 2,8 ---- #define DOCK_H + #include <glib.h> + #include <gtk/gtk.h> + void dock_set_uposition(GtkWidget * widget, gint x, gint y); GList *dock_add_window(GList * window_list, GtkWidget * window); Index: general.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/general.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** general.c 24 Dec 2003 14:03:14 -0000 1.3 --- general.c 26 Dec 2003 06:15:51 -0000 1.4 *************** *** 1,3 **** ! #include "beep.h" #ifndef fixed --- 1,7 ---- ! #include "general.h" ! ! #include <glib.h> ! #include <string.h> ! #include "plugin.h" #ifndef fixed Index: general.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/general.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** general.h 24 Dec 2003 14:03:14 -0000 1.2 --- general.h 26 Dec 2003 06:15:51 -0000 1.3 *************** *** 2,5 **** --- 2,7 ---- #define GENERIC_H + #include <glib.h> + struct GeneralPluginData { GList *general_list; *************** *** 9,16 **** GList *get_general_list(void); GList *get_general_enabled_list(void); ! void enable_general_plugin(int i, gboolean enable); ! void general_about(int i); ! void general_configure(int i); ! gboolean general_enabled(int i); gchar *general_stringify_enabled_list(void); void general_enable_from_stringified_list(gchar * list); --- 11,18 ---- GList *get_general_list(void); GList *get_general_enabled_list(void); ! void enable_general_plugin(gint i, gboolean enable); ! void general_about(gint i); ! void general_configure(gint i); ! gboolean general_enabled(gint i); gchar *general_stringify_enabled_list(void); void general_enable_from_stringified_list(gchar * list); |
From: <des...@us...> - 2003-12-26 05:53:34
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv28237 Modified Files: playlist_list.c Log Message: - fixed playlist drawing error when list is short Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** playlist_list.c 26 Dec 2003 05:29:35 -0000 1.15 --- playlist_list.c 26 Dec 2003 05:53:31 -0000 1.16 *************** *** 393,404 **** } - PLAYLIST_LOCK(); - list = playlist_get(); - pl->pl_fheight = (ascent + abs(descent)); pl->pl_num_visible = height / pl->pl_fheight; ! max_first = MAX(g_list_length(list) - pl->pl_num_visible, 0); pl->pl_first = CLAMP(pl->pl_first, 0, max_first); for (i = 0; i < pl->pl_first; i++) --- 393,406 ---- } pl->pl_fheight = (ascent + abs(descent)); pl->pl_num_visible = height / pl->pl_fheight; ! max_first = playlist_get_length() - pl->pl_num_visible; ! max_first = MAX(max_first, 0); ! pl->pl_first = CLAMP(pl->pl_first, 0, max_first); + + PLAYLIST_LOCK(); + list = playlist_get(); for (i = 0; i < pl->pl_first; i++) |
From: <des...@us...> - 2003-12-26 05:29:39
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv25857 Modified Files: dirbrowser.h effect.c effect.h playlist_list.c util.c util.h Log Message: - cleanups Index: dirbrowser.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dirbrowser.h 24 Dec 2003 14:03:14 -0000 1.2 --- dirbrowser.h 26 Dec 2003 05:29:35 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- GtkWidget *beep_create_dir_browser(gchar * current_path); + GtkWidget *bmp_db_create(gchar * current_path); #endif Index: effect.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/effect.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** effect.c 24 Dec 2003 14:03:14 -0000 1.3 --- effect.c 26 Dec 2003 05:29:35 -0000 1.4 *************** *** 16,25 **** * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! #include "beep.h" struct EffectPluginData *ep_data; ! static int effect_do_mod_samples(gpointer * data, gint length, AFormat fmt, ! gint srate, gint nch) { GList *l = ep_data->enabled_list; --- 16,30 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ! ! #include "effect.h" ! ! #include <glib.h> ! #include <string.h> ! #include "plugin.h" struct EffectPluginData *ep_data; ! static gint effect_do_mod_samples(gpointer * data, gint length, ! AFormat fmt, gint srate, gint nch) { GList *l = ep_data->enabled_list; *************** *** 73,77 **** } ! int effects_enabled(void) { return TRUE; --- 78,82 ---- } ! gint effects_enabled(void) { return TRUE; Index: effect.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/effect.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** effect.h 24 Dec 2003 14:03:14 -0000 1.3 --- effect.h 26 Dec 2003 05:29:35 -0000 1.4 *************** *** 2,5 **** --- 2,7 ---- #define EFFECT_H + #include <glib.h> + struct EffectPluginData { GList *effect_list; *************** *** 11,19 **** GList *get_effect_list(void); ! void effect_about(int i); ! void effect_configure(int i); GList *get_effect_enabled_list(void); ! void enable_effect_plugin(int i, gboolean enable); ! gboolean effect_enabled(int i); gchar *effect_stringify_enabled_list(void); void effect_enable_from_stringified_list(const gchar * list); --- 13,21 ---- GList *get_effect_list(void); ! void effect_about(gint i); ! void effect_configure(gint i); GList *get_effect_enabled_list(void); ! void enable_effect_plugin(gint i, gboolean enable); ! gboolean effect_enabled(gint i); gchar *effect_stringify_enabled_list(void); void effect_enable_from_stringified_list(const gchar * list); Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** playlist_list.c 26 Dec 2003 03:40:44 -0000 1.14 --- playlist_list.c 26 Dec 2003 05:29:35 -0000 1.15 *************** *** 424,432 **** gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_NORMAL)); ! if (g_utf8_validate(entry->title, -1, NULL)) ! title = g_strdup(entry->title); ! else title = g_path_get_basename(entry->filename); - convert_title_text(title); --- 424,432 ---- gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_NORMAL)); ! /* FIXME: this can be done more efficiently by working on the ! * playlist instead */ ! if (! ! (title = g_locale_to_utf8(entry->title, -1, NULL, NULL, NULL))) title = g_path_get_basename(entry->filename); convert_title_text(title); *************** *** 437,446 **** if (pos != -1) ! g_snprintf(tail, 100, "|%d|%s", pos + 1, entry->length != -1 ? " " : ""); if (entry->length != -1) ! g_snprintf(length, 40, "%d:%-2.2d", entry->length / 60000, ! (entry->length / 1000) % 60); if (pos != -1 || entry->length != -1) { --- 437,446 ---- if (pos != -1) ! g_snprintf(tail, sizeof(tail), "|%d|%s", pos + 1, entry->length != -1 ? " " : ""); if (entry->length != -1) ! g_snprintf(length, sizeof(length), "%d:%-2.2d", ! entry->length / 60000, (entry->length / 1000) % 60); if (pos != -1 || entry->length != -1) { Index: util.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** util.c 26 Dec 2003 03:33:06 -0000 1.11 --- util.c 26 Dec 2003 05:29:35 -0000 1.12 *************** *** 18,21 **** --- 18,22 ---- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "beep_mini.xpm" #include "beep.h" *************** *** 26,29 **** --- 27,31 ---- #include <sys/ipc.h> #include <ctype.h> + #ifdef HAVE_FTS_H #include <fts.h> *************** *** 41,50 **** */ ! char *escape_shell_chars(const char *string) { ! const char *special = "$`\"\\"; /* Characters to escape */ ! const char *in = string; ! char *out, *escaped; ! int num = 0; while (*in != '\0') --- 43,52 ---- */ ! gchar *escape_shell_chars(const gchar * string) { ! const gchar *special = "$`\"\\"; /* Characters to escape */ ! const gchar *in = string; ! gchar *out, *escaped; ! gint num = 0; while (*in != '\0') *************** *** 85,114 **** gchar *find_file_recursively(const gchar * dirname, const gchar * file) { ! GDir *dir2; ! GError *error = NULL; gchar *result, *found = NULL, *retval = NULL; ! const gchar *tmp; ! dir2 = g_dir_open(dirname, 0, &error); ! ! if (error) { ! g_critical("error!!"); ! return retval; } ! if (!dir2) ! return retval; ! while ((tmp = g_dir_read_name(dir2)) != NULL) { /* We need this in order to find out if file is directory */ ! found = g_build_filename(dirname, tmp, NULL); if (g_file_test(found, G_FILE_TEST_IS_REGULAR)) { /* Normal file -- maybe just what we are looking for? */ ! if (!strcasecmp(tmp, file)) { if (strlen(found) > FILENAME_MAX) { /* No good! File + path too long */ - g_dir_close(dir2); break; } else { retval = found; - found = NULL; break; } --- 87,110 ---- gchar *find_file_recursively(const gchar * dirname, const gchar * file) { ! GDir *dir; gchar *result, *found = NULL, *retval = NULL; + const gchar *direntry; ! if (!(dir = g_dir_open(dirname, 0, NULL))) { ! g_critical("failed to open directory %s", dirname); ! return NULL; } ! ! while ((direntry = g_dir_read_name(dir))) { /* We need this in order to find out if file is directory */ ! found = g_build_filename(dirname, direntry, NULL); if (g_file_test(found, G_FILE_TEST_IS_REGULAR)) { /* Normal file -- maybe just what we are looking for? */ ! if (!strcasecmp(direntry, file)) { if (strlen(found) > FILENAME_MAX) { /* No good! File + path too long */ break; } else { retval = found; break; } *************** *** 116,137 **** } else if (g_file_test(found, G_FILE_TEST_IS_DIR)) { result = find_file_recursively(found, file); ! if (result != NULL) { retval = result; break; } } g_free(found); - found = NULL; } - if (found) - g_free(found); ! g_dir_close(dir2); return retval; } ! typedef enum { ARCHIVE_DIR = 0, ARCHIVE_TAR = ! 1, ARCHIVE_TGZ, ARCHIVE_ZIP, ARCHIVE_TBZ2 } ArchiveType; --- 112,135 ---- } else if (g_file_test(found, G_FILE_TEST_IS_DIR)) { result = find_file_recursively(found, file); ! if (result) { retval = result; + g_free(found); break; } } g_free(found); } ! g_dir_close(dir); return retval; } ! typedef enum { ! ARCHIVE_DIR = 0, ! ARCHIVE_TAR = 1, ! ARCHIVE_TGZ, ! ARCHIVE_ZIP, ! ARCHIVE_TBZ2 } ArchiveType; *************** *** 278,285 **** ! void del_directory(const char *dirname) { #ifdef HAVE_FTS_H ! char *const argv[2] = { (char *) dirname, NULL }; FTS *fts; FTSENT *p; --- 276,283 ---- ! void del_directory(const gchar * dirname) { #ifdef HAVE_FTS_H ! gchar *const argv[2] = { (gchar *) dirname, NULL }; FTS *fts; FTSENT *p; *************** *** 329,335 **** register guint x, y; ! /* ! * This needs to be optimized ! */ dblimg = --- 327,331 ---- register guint x, y; ! /* FIXME: This needs to be optimized */ dblimg = *************** *** 430,460 **** } ! char *read_ini_string(const char *filename, const char *section, ! const char *key) { ! FILE *file; ! char *buffer, *ret_buffer = NULL; ! int found_section = 0, off = 0, len = 0; ! struct stat statbuf; if (!filename) return NULL; ! if ((file = fopen(filename, "r")) == NULL) ! return NULL; ! ! if (stat(filename, &statbuf) < 0) { ! fclose(file); return NULL; - } ! buffer = g_malloc(statbuf.st_size); ! fread(buffer, 1, statbuf.st_size, file); ! while (!ret_buffer && off < statbuf.st_size) { ! while (off < statbuf.st_size && (buffer[off] == '\r' || buffer[off] == '\n' || buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= statbuf.st_size) break; if (buffer[off] == '[') { --- 426,448 ---- } ! gchar *read_ini_string(const gchar * filename, const gchar * section, ! const gchar * key) { ! gchar *buffer, *ret_buffer = NULL; ! gint found_section = 0, off = 0, len = 0; ! gsize filesize; if (!filename) return NULL; ! if (!g_file_get_contents(filename, &buffer, &filesize, NULL)) return NULL; ! while (!ret_buffer && off < filesize) { ! while (off < filesize && (buffer[off] == '\r' || buffer[off] == '\n' || buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= filesize) break; if (buffer[off] == '[') { *************** *** 462,466 **** off++; found_section = 0; ! if (off + slen + 1 < statbuf.st_size && !strncasecmp(section, &buffer[off], slen)) { off += slen; --- 450,454 ---- off++; found_section = 0; ! if (off + slen + 1 < filesize && !strncasecmp(section, &buffer[off], slen)) { off += slen; *************** *** 470,490 **** } } ! } else if (found_section && off + strlen(key) < statbuf.st_size && !strncasecmp(key, &buffer[off], strlen(key))) { off += strlen(key); ! while (off < statbuf.st_size && (buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= statbuf.st_size) break; if (buffer[off] == '=') { off++; ! while (off < statbuf.st_size && (buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= statbuf.st_size) break; len = 0; ! while (off + len < statbuf.st_size && buffer[off + len] != '\r' && buffer[off + len] != '\n' && --- 458,478 ---- } } ! } else if (found_section && off + strlen(key) < filesize && !strncasecmp(key, &buffer[off], strlen(key))) { off += strlen(key); ! while (off < filesize && (buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= filesize) break; if (buffer[off] == '=') { off++; ! while (off < filesize && (buffer[off] == ' ' || buffer[off] == '\t')) off++; ! if (off >= filesize) break; len = 0; ! while (off + len < filesize && buffer[off + len] != '\r' && buffer[off + len] != '\n' && *************** *** 495,499 **** } } ! while (off < statbuf.st_size && buffer[off] != '\r' && buffer[off] != '\n') off++; --- 483,487 ---- } } ! while (off < filesize && buffer[off] != '\r' && buffer[off] != '\n') off++; *************** *** 501,505 **** g_free(buffer); - fclose(file); return ret_buffer; } --- 489,492 ---- *************** *** 660,664 **** GList *node; ! text = (char *) gtk_entry_get_text(GTK_ENTRY(entry)); if (!g_list_find_custom(cfg.url_history, text, util_find_compare_func)) { cfg.url_history = g_list_prepend(cfg.url_history, g_strdup(text)); --- 647,651 ---- GList *node; ! text = (gchar *) gtk_entry_get_text(GTK_ENTRY(entry)); if (!g_list_find_custom(cfg.url_history, text, util_find_compare_func)) { cfg.url_history = g_list_prepend(cfg.url_history, g_strdup(text)); *************** *** 749,753 **** gtk_widget_realize(win); ! addurl_set_icon(win, "bmp: Add Url..."); // somehow gcc thinks this is a function declaration return win; } --- 736,740 ---- gtk_widget_realize(win); ! addurl_set_icon(win, "bmp: Add Url..."); return win; } *************** *** 757,766 **** GList *list; GList *node; ! char *filename = (char *) gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); GtkListStore *store; GtkTreeIter iter; ! if ((list = input_scan_dir(filename)) != NULL) { /* * We enter a directory that has been "hijacked" by an --- 744,753 ---- GList *list; GList *node; ! gchar *filename = (gchar *) gtk_file_selection_get_filename(GTK_FILE_SELECTION(filesel)); GtkListStore *store; GtkTreeIter iter; ! if ((list = input_scan_dir(filename))) { /* * We enter a directory that has been "hijacked" by an *************** *** 796,799 **** --- 783,787 ---- } */ + static void filebrowser_entry_changed(GtkEditable * entry, gpointer data) { *************** *** 802,806 **** } ! /* static void filebrowser_dir_select(GtkCList *clist, int row, int col, GdkEventButton *event, gpointer data) { if (event->type == GDK_2BUTTON_PRESS) --- 790,795 ---- } ! /* ! static void filebrowser_dir_select(GtkCList *clist, int row, int col, GdkEventButton *event, gpointer data) { if (event->type == GDK_2BUTTON_PRESS) *************** *** 808,822 **** } */ gboolean util_filebrowser_is_dir(GtkFileSelection * filesel) { ! char *text; ! struct stat buf; gboolean retv = FALSE; text = g_strdup(gtk_file_selection_get_filename(filesel)); ! if (stat(text, &buf) == 0 && S_ISDIR(buf.st_mode)) { /* Selected directory */ ! int len = strlen(text); if (len > 3 && !strcmp(text + len - 4, "/../")) { if (len == 4) --- 797,811 ---- } */ + gboolean util_filebrowser_is_dir(GtkFileSelection * filesel) { ! gchar *text; gboolean retv = FALSE; text = g_strdup(gtk_file_selection_get_filename(filesel)); ! if (g_file_test(text, G_FILE_TEST_IS_DIR)) { /* Selected directory */ ! gint len = strlen(text); if (len > 3 && !strcmp(text + len - 4, "/../")) { if (len == 4) *************** *** 824,828 **** *(text + len - 3) = '\0'; else { ! char *ptr; *(text + len - 4) = '\0'; ptr = strrchr(text, '/'); --- 813,817 ---- *(text + len - 3) = '\0'; else { ! gchar *ptr; *(text + len - 4) = '\0'; ptr = strrchr(text, '/'); *************** *** 841,846 **** GtkFileSelection * filesel) { ! int ctr = 0; ! char *ptr; if (GTK_IS_WIDGET(mainwin_jtf)) --- 830,835 ---- GtkFileSelection * filesel) { ! gint ctr = 0; ! gchar *ptr; if (GTK_IS_WIDGET(mainwin_jtf)) *************** *** 858,862 **** &ptr); ! /* This will give an extra slash if the current dir is the root. */ cfg.filesel_path = g_strconcat(ptr, "/", NULL); } --- 847,852 ---- &ptr); ! /* This will give an extra slash if the current dir is the ! * root. */ cfg.filesel_path = g_strconcat(ptr, "/", NULL); } *************** *** 922,926 **** GtkWidget *button_add_selected, *button_add_all, *button_close, *button_add; ! char *title; if (dialog != NULL) { --- 912,916 ---- GtkWidget *button_add_selected, *button_add_all, *button_close, *button_add; ! gchar *title; if (dialog != NULL) { *************** *** 936,941 **** dialog = gtk_file_selection_new(title); ! // I don't think anyone should be even able to delete files from his/her media player, yes i'm making a decision for a plurality here ! // but it's just safer despite the confirmation requests gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dialog)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); --- 926,932 ---- dialog = gtk_file_selection_new(title); ! /* I don't think anyone should be even able to delete files from ! * his/her media player, yes i'm making a decision for a plurality ! * here but it's just safer despite the confirmation requests */ gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(dialog)); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); *************** *** 948,959 **** cfg.filesel_path); ! // if we destroy the OK button we'll never receive a GTK_RESPONSE_OK e.g. trough dbl click on a file gtk_widget_hide(GTK_FILE_SELECTION(dialog)->ok_button); gtk_widget_destroy(GTK_FILE_SELECTION(dialog)->cancel_button); ! /* ! * The mnemonics are quite unorthodox, but that should guarantee they're unique in any locale ! * plus kinda easy to use ! */ button_add_selected = gtk_dialog_add_button(GTK_DIALOG(dialog), "Add selected", --- 939,949 ---- cfg.filesel_path); ! /* if we destroy the OK button we'll never receive a ! * GTK_RESPONSE_OK e.g. trough dbl click on a file */ gtk_widget_hide(GTK_FILE_SELECTION(dialog)->ok_button); gtk_widget_destroy(GTK_FILE_SELECTION(dialog)->cancel_button); ! /* The mnemonics are quite unorthodox, but that should guarantee ! * they're unique in any locale plus kinda easy to use */ button_add_selected = gtk_dialog_add_button(GTK_DIALOG(dialog), "Add selected", *************** *** 1018,1028 **** } ! GdkFont *util_font_load(char *name) { GdkFont *font; - PangoFontDescription *desc; - desc = pango_font_description_from_string(name); font = gdk_font_from_description(desc); --- 1008,1017 ---- } ! GdkFont *util_font_load(const gchar * name) { GdkFont *font; PangoFontDescription *desc; + desc = pango_font_description_from_string(name); font = gdk_font_from_description(desc); *************** *** 1031,1037 **** #ifdef ENABLE_NLS ! char *util_menu_translate(const char *path, void *func_data) { ! char *translation = gettext(path); if (!translation || *translation != '/') { --- 1020,1026 ---- #ifdef ENABLE_NLS ! gchar *util_menu_translate(const gchar * path, gpointer func_data) { ! gchar *translation = gettext(path); if (!translation || *translation != '/') { *************** *** 1061,1078 **** } ! // text_get_extents() taken from The GIMP (C) Spencer Kimball, Peter Mattis et al ! gboolean ! text_get_extents(const gchar * fontname, ! const gchar * text, ! gint * width, ! gint * height, gint * ascent, gint * descent) { PangoFontDescription *font_desc; PangoLayout *layout; PangoRectangle rect; - /* PangoContext *context; - PangoLayout *layout; - PangoRectangle rect; - */ g_return_val_if_fail(fontname != NULL, FALSE); --- 1050,1063 ---- } ! /* text_get_extents() taken from The GIMP (C) Spencer Kimball, Peter ! * Mattis et al */ ! gboolean text_get_extents(const gchar * fontname, ! const gchar * text, ! gint * width, gint * height, ! gint * ascent, gint * descent) { PangoFontDescription *font_desc; PangoLayout *layout; PangoRectangle rect; g_return_val_if_fail(fontname != NULL, FALSE); *************** *** 1080,1098 **** /* FIXME: resolution */ - - // context = pango_ft2_get_context (72.0, 72.0); - - - // layout = pango_layout_new(pango_context_new()); - layout = gtk_widget_create_pango_layout(GTK_WIDGET(mainwin), text); - // g_object_unref (context); - font_desc = pango_font_description_from_string(fontname); pango_layout_set_font_description(layout, font_desc); pango_font_description_free(font_desc); - // pango_layout_set_text (layout, text, -1); - pango_layout_get_pixel_extents(layout, NULL, &rect); --- 1065,1073 ---- *************** *** 1125,1129 **** void util_dump_menu_rc(void) { ! // char *filename = g_strconcat(g_get_home_dir(), "/.beep/menurc", NULL); // gtk_item_factory_dump_rc(filename, NULL, FALSE); // g_free(filename); --- 1100,1104 ---- void util_dump_menu_rc(void) { ! // char *filename = g_build_filename(g_get_home_dir(), ".bmp/menurc", NULL); // gtk_item_factory_dump_rc(filename, NULL, FALSE); // g_free(filename); *************** *** 1132,1136 **** void util_read_menu_rc(void) { ! // char *filename = g_strconcat(g_get_home_dir(), "/.beep/menurc", NULL); // gtk_item_factory_parse_rc(filename); // g_free(filename); --- 1107,1111 ---- void util_read_menu_rc(void) { ! // char *filename = g_strconcat(g_get_home_dir(), ".bmp/menurc", NULL); // gtk_item_factory_parse_rc(filename); // g_free(filename); Index: util.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** util.h 26 Dec 2003 03:33:06 -0000 1.7 --- util.h 26 Dec 2003 05:29:35 -0000 1.8 *************** *** 48,52 **** gboolean util_run_filebrowser(gboolean clear_pl_on_ok); gboolean util_filebrowser_is_dir(GtkFileSelection * filesel); ! GdkFont *util_font_load(gchar * name); void util_set_cursor(GtkWidget * window); void util_dump_menu_rc(void); --- 48,52 ---- gboolean util_run_filebrowser(gboolean clear_pl_on_ok); gboolean util_filebrowser_is_dir(GtkFileSelection * filesel); ! GdkFont *util_font_load(const gchar * name); void util_set_cursor(GtkWidget * window); void util_dump_menu_rc(void); |
From: <des...@us...> - 2003-12-26 03:40:47
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv13754 Modified Files: playlist_list.c Log Message: - removed freetype2 header #include Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** playlist_list.c 26 Dec 2003 03:33:06 -0000 1.13 --- playlist_list.c 26 Dec 2003 03:40:44 -0000 1.14 *************** *** 40,44 **** #include <X11/Xatom.h> - #include <freetype/freetype.h> #include <pango/pangoft2.h> --- 40,43 ---- |
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv12963 Modified Files: dirbrowser.c playlist.c playlist.h playlist_list.c playlist_list.h pluginenum.c skinwin.c util.c util.h Log Message: - plugged all (I hope) memory leaks in playlist_list.c - more cleanups Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dirbrowser.c 25 Dec 2003 23:26:13 -0000 1.14 --- dirbrowser.c 26 Dec 2003 03:33:06 -0000 1.15 *************** *** 15,19 **** static GtkTreePath *current; - static gchar *playlist_current_name = NULL; static GtkItemFactory *bmp_db_popup; --- 15,18 ---- *************** *** 101,107 **** static void bmp_db_mdb_add_track(gchar * arg_artist_p, ! gchar * arg_album_p, gchar * arg_track_p, ! guint arg_tracknum, gchar * arg_path, ! GtkTreeModel * model_sort) { --- 100,106 ---- static void bmp_db_mdb_add_track(gchar * arg_artist_p, ! gchar * arg_album_p, gchar * arg_track_p, ! guint arg_tracknum, gchar * arg_path, ! GtkTreeModel * model_sort) { *************** *** 230,236 **** { ! /* If this isn't a directory or regular file return failure */ ! if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_DIR)) { ! return FALSE; } --- 229,236 ---- { ! /* If this isn't a directory or regular file return failure */ ! if (!g_file_test ! (filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_DIR)) { ! return FALSE; } *************** *** 316,320 **** static gchar *bmp_db_get_path_real(gchar * path, GtkTreeModel * model, ! GtkTreeIter * iter) { --- 316,320 ---- static gchar *bmp_db_get_path_real(gchar * path, GtkTreeModel * model, ! GtkTreeIter * iter) { *************** *** 333,337 **** static void bmp_db_create_dirtree(GtkTreeModel * model, gchar * from, ! GtkTreeIter parent_iter) { --- 333,337 ---- static void bmp_db_create_dirtree(GtkTreeModel * model, gchar * from, ! GtkTreeIter parent_iter) { *************** *** 351,355 **** from_real = bmp_db_get_path_real(from, model, &parent_iter); g_free(from); ! /* It's not really a waste creating both beforehand since we will * certainly need the folder one at least once, and most probably --- 351,355 ---- from_real = bmp_db_get_path_real(from, model, &parent_iter); g_free(from); ! /* It's not really a waste creating both beforehand since we will * certainly need the folder one at least once, and most probably *************** *** 522,526 **** /* caveat, the root in bmp_db_create_dirtree is relative */ bmp_db_create_dirtree(GTK_TREE_MODEL(model), ! /* starting at */ "/", iter); g_strfreev(frags); } --- 522,526 ---- /* caveat, the root in bmp_db_create_dirtree is relative */ bmp_db_create_dirtree(GTK_TREE_MODEL(model), ! /* starting at */ "/", iter); g_strfreev(frags); } *************** *** 559,564 **** static gchar *bmp_db_path_get_full(GtkTreeModel * model, ! const gchar * path, ! GtkTreeIter iter_current) { --- 559,564 ---- static gchar *bmp_db_path_get_full(GtkTreeModel * model, ! const gchar * path, ! GtkTreeIter iter_current) { *************** *** 597,602 **** static void bmp_db_row_expanded(GtkTreeView * treeview, ! GtkTreeIter * arg1, ! GtkTreePath * arg2, gpointer user_data) { GtkTreeIter iter_current; --- 597,602 ---- static void bmp_db_row_expanded(GtkTreeView * treeview, ! GtkTreeIter * arg1, ! GtkTreePath * arg2, gpointer user_data) { GtkTreeIter iter_current; *************** *** 627,633 **** path = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter_current); bmp_db_create_dirtree(GTK_TREE_MODEL(model), path, ! iter_current); } --- 627,633 ---- path = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter_current); bmp_db_create_dirtree(GTK_TREE_MODEL(model), path, ! iter_current); } *************** *** 643,647 **** static void bmp_db_row_activated(GtkTreeSelection * sel, ! gpointer user_data) { GtkTreeIter iter; --- 643,647 ---- static void bmp_db_row_activated(GtkTreeSelection * sel, ! gpointer user_data) { GtkTreeIter iter; *************** *** 669,674 **** -1); path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter); /* FIXME: path is not freed */ --- 669,673 ---- -1); path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); /* FIXME: path is not freed */ *************** *** 782,787 **** path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter); path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); --- 781,785 ---- path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); *************** *** 816,820 **** static void bmp_db_detatch_selected_entry_kp(GtkWidget * w, ! GtkDialog * dialog) { gtk_dialog_response(dialog, GTK_RESPONSE_ACCEPT); --- 814,818 ---- static void bmp_db_detatch_selected_entry_kp(GtkWidget * w, ! GtkDialog * dialog) { gtk_dialog_response(dialog, GTK_RESPONSE_ACCEPT); *************** *** 877,882 **** entry = gtk_entry_new(); g_signal_connect(entry, "activate", ! G_CALLBACK(bmp_db_detatch_selected_entry_kp), ! dialog); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, TRUE, TRUE, 8); --- 875,879 ---- entry = gtk_entry_new(); g_signal_connect(entry, "activate", ! G_CALLBACK(bmp_db_detatch_selected_entry_kp), dialog); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, TRUE, TRUE, 8); *************** *** 892,897 **** path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter); path_real = bmp_db_get_path_real(path, model, &iter); --- 889,893 ---- path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); path_real = bmp_db_get_path_real(path, model, &iter); *************** *** 924,928 **** 0, node->image, 1, node->name, -1); bmp_db_create_dirtree(GTK_TREE_MODEL(model), ! /* starting at */ "/", iter); } else { /* FIXME: response to failed to get iter */ --- 920,924 ---- 0, node->image, 1, node->name, -1); bmp_db_create_dirtree(GTK_TREE_MODEL(model), ! /* starting at */ "/", iter); } else { /* FIXME: response to failed to get iter */ *************** *** 1041,1046 **** path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, ! iter); path_real = bmp_db_get_path_real(path, model, &iter); --- 1037,1041 ---- path = ! bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); path_real = bmp_db_get_path_real(path, model, &iter); *************** *** 1072,1076 **** static void bmp_db_add_expanded_paths(GtkWidget * treeview, ! GtkTreePath * path, gpointer data) { data = g_list_append(data, gtk_tree_path_to_string(path)); --- 1067,1071 ---- static void bmp_db_add_expanded_paths(GtkWidget * treeview, ! GtkTreePath * path, gpointer data) { data = g_list_append(data, gtk_tree_path_to_string(path)); *************** *** 1198,1202 **** static gint bmp_db_keypress(GtkWidget * grab_widget, ! GdkEventKey * event, gpointer data) { if (event && (event->keyval == GDK_Escape)) { --- 1193,1197 ---- static gint bmp_db_keypress(GtkWidget * grab_widget, ! GdkEventKey * event, gpointer data) { if (event && (event->keyval == GDK_Escape)) { *************** *** 1212,1217 **** static gint bmp_db_mdb_sort_func(GtkTreeModel * model, ! GtkTreeIter * a, GtkTreeIter * b, ! gpointer user_data) { --- 1207,1212 ---- static gint bmp_db_mdb_sort_func(GtkTreeModel * model, ! GtkTreeIter * a, GtkTreeIter * b, ! gpointer user_data) { *************** *** 1319,1323 **** gtk_tree_sortable_set_default_sort_func(GTK_TREE_SORTABLE(sort_model), ! bmp_db_mdb_sort_func, NULL, NULL); --- 1314,1319 ---- gtk_tree_sortable_set_default_sort_func(GTK_TREE_SORTABLE(sort_model), ! bmp_db_mdb_sort_func, NULL, ! NULL); *************** *** 1352,1356 **** bmp_db_mdb_add_track(artist, album, title, tracknumber, ! files->data, sort_model); files = files->next; --- 1348,1352 ---- bmp_db_mdb_add_track(artist, album, title, tracknumber, ! files->data, sort_model); files = files->next; *************** *** 1518,1523 **** db_accel = gtk_accel_group_new(); ! bmp_db_popup = gtk_item_factory_new(GTK_TYPE_MENU, ! "<Main>", db_accel); gtk_item_factory_create_items(GTK_ITEM_FACTORY(bmp_db_popup), --- 1514,1518 ---- db_accel = gtk_accel_group_new(); ! bmp_db_popup = gtk_item_factory_new(GTK_TYPE_MENU, "<Main>", db_accel); gtk_item_factory_create_items(GTK_ITEM_FACTORY(bmp_db_popup), *************** *** 1555,1560 **** static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data) { --- 1550,1555 ---- static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data) { *************** *** 1575,1579 **** static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget) { --- 1570,1574 ---- static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget) { Index: playlist.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** playlist.c 25 Dec 2003 23:26:13 -0000 1.23 --- playlist.c 26 Dec 2003 03:33:06 -0000 1.24 *************** *** 953,957 **** if (cfg.show_numbers_in_pl) ! numbers = g_strdup_printf("%d. ", __playlist_get_position() + 1); else numbers = g_strdup(""); --- 953,958 ---- if (cfg.show_numbers_in_pl) ! numbers = ! g_strdup_printf("%d. ", playlist_get_position_nolock() + 1); else numbers = g_strdup(""); *************** *** 976,980 **** if (cfg.convert_twenty) while ((tmp = strstr(text, "%20")) != NULL) { ! char *tmp2; tmp2 = tmp + 3; *(tmp++) = ' '; --- 977,981 ---- if (cfg.convert_twenty) while ((tmp = strstr(text, "%20")) != NULL) { ! gchar *tmp2; tmp2 = tmp + 3; *(tmp++) = ' '; *************** *** 1230,1234 **** } ! gint __playlist_get_position(void) { /* Caller should hold playlist_mutex */ --- 1231,1235 ---- } ! gint playlist_get_position_nolock(void) { /* Caller should hold playlist_mutex */ *************** *** 1243,1247 **** PLAYLIST_LOCK(); ! retval = __playlist_get_position(); PLAYLIST_UNLOCK(); --- 1244,1248 ---- PLAYLIST_LOCK(); ! retval = playlist_get_position_nolock(); PLAYLIST_UNLOCK(); Index: playlist.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** playlist.h 25 Dec 2003 23:26:13 -0000 1.10 --- playlist.h 26 Dec 2003 03:33:06 -0000 1.11 *************** *** 22,27 **** #include <glib.h> - #include <pthread.h> typedef struct { gchar *filename; --- 22,27 ---- #include <glib.h> + #define PLAYLIST_ENTRY(x) ((PlaylistEntry*)(x)) typedef struct { gchar *filename; *************** *** 38,42 **** /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(gchar *dir, glong pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) --- 38,42 ---- /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(gchar * dir, glong pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) *************** *** 58,65 **** gint playlist_get_length_nolock(void); gint playlist_get_position(void); ! gint __playlist_get_position(void); gchar *playlist_get_info_text(void); int playlist_get_current_length(void); ! gboolean playlist_save(const gchar *filename, gboolean is_pls); gboolean playlist_load(gchar * filename); GList *playlist_get(void); --- 58,65 ---- gint playlist_get_length_nolock(void); gint playlist_get_position(void); ! gint playlist_get_position_nolock(void); gchar *playlist_get_info_text(void); int playlist_get_current_length(void); ! gboolean playlist_save(const gchar * filename, gboolean is_pls); gboolean playlist_load(gchar * filename); GList *playlist_get(void); Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** playlist_list.c 25 Dec 2003 23:26:13 -0000 1.12 --- playlist_list.c 26 Dec 2003 03:33:06 -0000 1.13 *************** *** 37,52 **** /* FIXME: This is all still too slow. */ ! #include "beep.h" - #ifdef HAVE_WCHAR_H - #include <wchar.h> - #endif #include <X11/Xatom.h> ! ! #include <ft2build.h> ! #include FT_FREETYPE_H ! #include <pango/pangoft2.h> PangoFontDescription *playlist_list_font = NULL; guint ascent, descent, width_delta_digit_one; --- 37,52 ---- /* FIXME: This is all still too slow. */ ! #include "playlist_list.h" #include <X11/Xatom.h> ! #include <freetype/freetype.h> #include <pango/pangoft2.h> + #include "main.h" + #include "input.h" + #include "playlist.h" + #include "playlistwin.h" + #include "util.h" + PangoFontDescription *playlist_list_font = NULL; guint ascent, descent, width_delta_digit_one; *************** *** 63,67 **** guint width_approx_digits, width_approx_digits_half; ! static int playlist_list_auto_drag_down_func(gpointer data) { PlayList_List *pl = data; --- 63,67 ---- guint width_approx_digits, width_approx_digits_half; ! static gint playlist_list_auto_drag_down_func(gpointer data) { PlayList_List *pl = data; *************** *** 77,81 **** } ! static int playlist_list_auto_drag_up_func(gpointer data) { PlayList_List *pl = data; --- 77,81 ---- } ! static gint playlist_list_auto_drag_up_func(gpointer data) { PlayList_List *pl = data; *************** *** 100,104 **** return; } ! if (((PlaylistEntry *) list->data)->selected) { /* We are at the top */ PLAYLIST_UNLOCK(); --- 100,104 ---- return; } ! if (PLAYLIST_ENTRY(list->data)->selected) { /* We are at the top */ PLAYLIST_UNLOCK(); *************** *** 106,110 **** } while (list) { ! if (((PlaylistEntry *) list->data)->selected) glist_moveup(list); list = g_list_next(list); --- 106,110 ---- } while (list) { ! if (PLAYLIST_ENTRY(list->data)->selected) glist_moveup(list); list = g_list_next(list); *************** *** 128,132 **** return; } ! if (((PlaylistEntry *) list->data)->selected) { /* We are at the bottom */ PLAYLIST_UNLOCK(); --- 128,132 ---- return; } ! if (PLAYLIST_ENTRY(list->data)->selected) { /* We are at the bottom */ PLAYLIST_UNLOCK(); *************** *** 134,138 **** } while (list) { ! if (((PlaylistEntry *) list->data)->selected) glist_movedown(list); list = g_list_previous(list); --- 134,138 ---- } while (list) { ! if (PLAYLIST_ENTRY(list->data)->selected) glist_movedown(list); list = g_list_previous(list); *************** *** 147,158 **** } ! void playlist_list_button_press_cb(GtkWidget * widget, ! GdkEventButton * event, ! PlayList_List * pl) { if (event->button == 1 && pl->pl_fheight && inside_widget(event->x, event->y, &pl->pl_widget)) { - int nr, y; - y = event->y - pl->pl_widget.y; nr = (y / pl->pl_fheight) + pl->pl_first; --- 147,158 ---- } ! static void playlist_list_button_press_cb(GtkWidget * widget, ! GdkEventButton * event, ! PlayList_List * pl) { + gint nr, y; + if (event->button == 1 && pl->pl_fheight && inside_widget(event->x, event->y, &pl->pl_widget)) { y = event->y - pl->pl_widget.y; nr = (y / pl->pl_fheight) + pl->pl_first; *************** *** 203,209 **** } ! int playlist_list_get_playlist_position(PlayList_List * pl, int x, int y) { ! int iy, length; if (!inside_widget(x, y, pl) || !pl->pl_fheight) --- 203,210 ---- } ! gint playlist_list_get_playlist_position(PlayList_List * pl, gint x, ! gint y) { ! gint iy, length; if (!inside_widget(x, y, pl) || !pl->pl_fheight) *************** *** 217,222 **** } ! void playlist_list_motion_cb(GtkWidget * widget, GdkEventMotion * event, ! PlayList_List * pl) { gint nr, y, off, i; --- 218,224 ---- } ! static void playlist_list_motion_cb(GtkWidget * widget, ! GdkEventMotion * event, ! PlayList_List * pl) { gint nr, y, off, i; *************** *** 262,268 **** } ! void playlist_list_button_release_cb(GtkWidget * widget, ! GdkEventButton * event, ! PlayList_List * pl) { pl->pl_dragging = FALSE; --- 264,270 ---- } ! static void playlist_list_button_release_cb(GtkWidget * widget, ! GdkEventButton * event, ! PlayList_List * pl) { pl->pl_dragging = FALSE; *************** *** 271,301 **** } ! #define playlist_list_draw_string_wc playlist_list_draw_string ! ! void playlist_list_draw_string(PlayList_List * pl, ! PangoFontDescription * font, gint line, ! gint width, gchar * text, guint ppos) { ! int len; ! int pix_len; ! char *tmp; guint padding, plist_length_int; PangoLayout *layout; ! ! if (cfg.convert_underscore) ! while ((tmp = strchr(text, '_')) != NULL) ! *tmp = ' '; ! ! if (cfg.convert_twenty) ! while ((tmp = strstr(text, "%20")) != NULL) { ! char *tmp2 = tmp + 3; ! *(tmp++) = ' '; ! while (*tmp2) ! *(tmp++) = *(tmp2++); ! *tmp = '\0'; ! } len = strlen(text); - pix_len = (width_approx_letters * len); --- 273,289 ---- } ! static void playlist_list_draw_string(PlayList_List * pl, ! PangoFontDescription * font, ! gint line, gint width, gchar * text, ! guint ppos) { ! /* caller must hold playlist mutex */ ! gint len; ! gint pix_len; guint padding, plist_length_int; PangoLayout *layout; ! gchar *text_utf8; len = strlen(text); pix_len = (width_approx_letters * len); *************** *** 307,316 **** if (cfg.show_numbers_in_pl) { - - gchar *pos_string = g_strdup_printf("%d", ppos); plist_length_int = ! strlen(g_strdup_printf("%d", playlist_get_length_nolock())) + ! 1; padding = plist_length_int; --- 295,301 ---- if (cfg.show_numbers_in_pl) { gchar *pos_string = g_strdup_printf("%d", ppos); plist_length_int = ! gint_count_digits(playlist_get_length_nolock()) + 1; padding = plist_length_int; *************** *** 319,329 **** layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! g_locale_to_utf8(pos_string, -1, ! NULL, NULL, ! NULL)); pango_layout_set_font_description(layout, playlist_list_font); pango_layout_set_width(layout, plist_length_int * 100); ! if (atoi(pos_string) == 1) { pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); gdk_draw_layout(pl->pl_widget.parent, pl->pl_widget.gc, --- 304,312 ---- layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! pos_string); pango_layout_set_font_description(layout, playlist_list_font); pango_layout_set_width(layout, plist_length_int * 100); ! if (ppos == 1) { pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); gdk_draw_layout(pl->pl_widget.parent, pl->pl_widget.gc, *************** *** 342,345 **** --- 325,329 ---- ascent + abs(descent), layout); } + g_free(pos_string); g_object_unref(layout); } else { *************** *** 347,354 **** } layout = ! gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! g_locale_to_utf8(text, -1, NULL, ! NULL, NULL)); pango_layout_set_font_description(layout, playlist_list_font); --- 331,337 ---- } + text_utf8 = g_locale_to_utf8(text, -1, NULL, NULL, NULL); layout = ! gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), text_utf8); pango_layout_set_font_description(layout, playlist_list_font); *************** *** 359,367 **** g_object_unref(layout); } ! void playlist_list_draw(Widget * w) { ! PlayList_List *pl = (PlayList_List *) w; GList *list; GdkGC *gc; --- 342,369 ---- g_object_unref(layout); + g_free(text_utf8); } ! static void convert_title_text(gchar * text) { ! gchar *match, *tmp; ! ! if (cfg.convert_underscore) ! while ((match = strchr(text, '_'))) ! *match = ' '; ! ! if (cfg.convert_twenty) ! while ((match = strstr(text, "%20"))) { ! tmp = match + 3; ! *match++ = ' '; ! while (*tmp) ! *match++ = *tmp++; ! *match = '\0'; ! } ! } ! ! static void playlist_list_draw(Widget * w) ! { ! PlayList_List *pl = PLAYLIST_LIST(w); GList *list; GdkGC *gc; *************** *** 370,377 **** gchar *title; gint width, height; ! gint i, tw, max_first; guint padding; guint max_time_len = 0; gc = pl->pl_widget.gc; width = pl->pl_widget.width; --- 372,382 ---- gchar *title; gint width, height; ! gint i, max_first; guint padding; guint max_time_len = 0; + gchar tail[100]; + gchar length[40]; + gc = pl->pl_widget.gc; width = pl->pl_widget.width; *************** *** 384,393 **** width, height); ! if (playlist_list_font == NULL) { ! g_log(NULL, G_LOG_LEVEL_CRITICAL, "Couldn't open playlist font"); return; } - PLAYLIST_LOCK(); list = playlist_get(); --- 389,397 ---- width, height); ! if (!playlist_list_font) { ! g_critical("Couldn't open playlist font"); return; } PLAYLIST_LOCK(); list = playlist_get(); *************** *** 396,406 **** pl->pl_num_visible = height / pl->pl_fheight; ! max_first = g_list_length(list) - pl->pl_num_visible; ! if (max_first < 0) ! max_first = 0; ! if (pl->pl_first >= max_first) ! pl->pl_first = max_first; ! if (pl->pl_first < 0) ! pl->pl_first = 0; for (i = 0; i < pl->pl_first; i++) list = g_list_next(list); --- 400,406 ---- pl->pl_num_visible = height / pl->pl_fheight; ! max_first = MAX(g_list_length(list) - pl->pl_num_visible, 0); ! pl->pl_first = CLAMP(pl->pl_first, 0, max_first); ! for (i = 0; i < pl->pl_first; i++) list = g_list_next(list); *************** *** 409,416 **** list && i < pl->pl_first + pl->pl_num_visible; list = list->next, i++) { ! char qstr[20] = "", length[40] = ""; ! int pos; ! PlaylistEntry *entry = (PlaylistEntry *) list->data; if (entry->selected) { gdk_gc_set_foreground(gc, --- 409,415 ---- list && i < pl->pl_first + pl->pl_num_visible; list = list->next, i++) { ! gint pos; ! PlaylistEntry *entry = PLAYLIST_ENTRY(list->data); if (entry->selected) { gdk_gc_set_foreground(gc, *************** *** 421,471 **** width, pl->pl_fheight); } ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); else gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_NORMAL)); ! if (entry->title) title = g_strdup(entry->title); else title = g_path_get_basename(entry->filename); ! if (!g_locale_to_utf8(title, -1, NULL, NULL, NULL)) ! title = g_path_get_basename(entry->filename); pos = playlist_get_queue_position(entry); if (pos != -1) ! sprintf(qstr, "|%d|%s", pos + 1, ! entry->length != -1 ? " " : ""); if (entry->length != -1) ! sprintf(length, "%d:%-2.2d", entry->length / 60000, ! (entry->length / 1000) % 60); if (pos != -1 || entry->length != -1) { ! int x, y; ! gchar *tail; ! guint t_width; ! guint len_tail; ! guint len; ! tail = g_strdup_printf("%s%s", qstr, length); ! if (strlen(tail) > max_time_len) ! max_time_len = strlen(tail); /* FIXME: This is just an approximate alignment, maybe something still fast, but exact could be done */ ! len_tail = strlen(tail); ! len_tail -= 4; ! ! t_width = ! ((4 + len_tail) * width_approx_digits) + ! (width_approx_digits_half) + 2; ! tw = width - t_width - 5; ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 420,465 ---- width, pl->pl_fheight); } ! if (i == playlist_get_position_nolock()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); else gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_NORMAL)); ! if (g_utf8_validate(entry->title, -1, NULL)) title = g_strdup(entry->title); else title = g_path_get_basename(entry->filename); ! convert_title_text(title); pos = playlist_get_queue_position(entry); + tail[0] = 0; + length[0] = 0; + if (pos != -1) ! g_snprintf(tail, 100, "|%d|%s", pos + 1, ! entry->length != -1 ? " " : ""); if (entry->length != -1) ! g_snprintf(length, 40, "%d:%-2.2d", entry->length / 60000, ! (entry->length / 1000) % 60); if (pos != -1 || entry->length != -1) { ! gint x, y; ! guint tail_width; ! guint tail_len; ! strncat(tail, length, sizeof(tail)); ! tail_len = strlen(tail); ! max_time_len = MAX(max_time_len, tail_len); /* FIXME: This is just an approximate alignment, maybe something still fast, but exact could be done */ ! tail_width = width - (tail_len * width_approx_digits) + ! (width_approx_digits_half) - 3; ! if (i == playlist_get_position_nolock()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 474,478 **** get_skin_color(SKIN_PLEDIT_NORMAL)); playlist_list_draw_string(pl, playlist_list_font, ! i - pl->pl_first, tw, title, i + 1); x = pl->pl_widget.x + width - width_approx_digits * 2; --- 468,473 ---- get_skin_color(SKIN_PLEDIT_NORMAL)); playlist_list_draw_string(pl, playlist_list_font, ! i - pl->pl_first, tail_width, title, ! i + 1); x = pl->pl_widget.x + width - width_approx_digits * 2; *************** *** 490,494 **** } ! /* This isn't very cool, but i don't see a way to calculate row widths with Pango fast enough here */ gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x + pl->pl_widget.width - --- 485,490 ---- } ! /* This isn't very cool, but i don't see a way to ! * calculate row widths with Pango fast enough here */ gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x + pl->pl_widget.width - *************** *** 497,501 **** pl->pl_fheight - 1); ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 493,497 ---- pl->pl_fheight - 1); ! if (i == playlist_get_position_nolock()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 504,521 **** get_skin_color(SKIN_PLEDIT_NORMAL)); - len = strlen(tail); - - - gchar **frags = g_strsplit(tail, ":", 0); layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! g_locale_to_utf8(frags[1], ! -1, NULL, ! NULL, ! NULL)); pango_layout_set_font_description(layout, playlist_list_font); ! pango_layout_set_width(layout, strlen(tail) * 100); pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); gdk_draw_layout(obj, gc, x - (0.25 * width_approx_digits), --- 500,511 ---- get_skin_color(SKIN_PLEDIT_NORMAL)); gchar **frags = g_strsplit(tail, ":", 0); + gchar *frag0 = g_strconcat(frags[0], ":", NULL); layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! frags[1]); pango_layout_set_font_description(layout, playlist_list_font); ! pango_layout_set_width(layout, tail_len * 100); pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); gdk_draw_layout(obj, gc, x - (0.25 * width_approx_digits), *************** *** 525,536 **** layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! g_locale_to_utf8(g_strconcat ! (frags[0], ! ":", ! NULL), -1, ! NULL, NULL, ! NULL)); pango_layout_set_font_description(layout, playlist_list_font); ! pango_layout_set_width(layout, strlen(tail) * 100); pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT); gdk_draw_layout(obj, gc, x - (0.5 * width_approx_digits), --- 515,521 ---- layout = gtk_widget_create_pango_layout(GTK_WIDGET(playlistwin), ! frag0); pango_layout_set_font_description(layout, playlist_list_font); ! pango_layout_set_width(layout, tail_len * 100); pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT); gdk_draw_layout(obj, gc, x - (0.5 * width_approx_digits), *************** *** 538,547 **** g_object_unref(layout); ! } else { ! tw = width; ! ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 523,531 ---- g_object_unref(layout); ! g_free(frag0); ! g_strfreev(frags); } else { ! if (i == playlist_get_position_nolock()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 551,555 **** playlist_list_draw_string(pl, playlist_list_font, ! i - pl->pl_first, tw, title, i + 1); } --- 535,540 ---- playlist_list_draw_string(pl, playlist_list_font, ! i - pl->pl_first, width, title, ! i + 1); } *************** *** 568,572 **** if (pl->pl_drag_motion) { ! unsigned int pos, x, y, plx, ply, plength; /* We already hold the mutex and have the playlist locked, so call --- 553,557 ---- if (pl->pl_drag_motion) { ! guint pos, x, y, plx, ply, plength; /* We already hold the mutex and have the playlist locked, so call *************** *** 585,590 **** && !(y > (pl->pl_widget.height + ply))) { ! pos = ! ((y - ((Widget *) pl)->y) / pl->pl_fheight) + pl->pl_first; if (pos > (plength)) { --- 570,574 ---- && !(y > (pl->pl_widget.height + ply))) { ! pos = ((y - ((Widget *) pl)->y) / pl->pl_fheight) + pl->pl_first; if (pos > (plength)) { *************** *** 633,645 **** if (cfg.show_numbers_in_pl) { padding = ! -1 + ! strlen(g_strdup_printf("%d", playlist_get_length_nolock())) + ! 1; ! padding = ! (padding * width_approx_digits) + (width_approx_digits / 1.3); ! if (playlist_get_length_nolock() <= 0) ! padding = 3; ! // For italic or oblique fonts we add another half of the approximate width if (has_slant) padding += width_approx_digits_half; --- 617,625 ---- if (cfg.show_numbers_in_pl) { padding = ! (gint_count_digits(playlist_get_length_nolock()) * ! width_approx_digits) + (width_approx_digits / 1.3); ! /* For italic or oblique fonts we add another half of the ! * approximate width */ if (has_slant) padding += width_approx_digits_half; *************** *** 649,667 **** pl->pl_widget.y, pl->pl_widget.x + padding, ! (pl->pl_widget.y + pl->pl_widget.height - 1) ! ); ! } - - /* guint xpos = pl->pl_widget.x + width - (width_approx_digits*max_time_len)+width_colon_third-8-width_approx_digits_half; - gdk_draw_line(obj, gc, - xpos, - pl->pl_widget.y, - xpos, - (pl->pl_widget.y + pl->pl_widget.height-1) - ); - */ - PLAYLIST_UNLOCK(); } --- 629,635 ---- pl->pl_widget.y, pl->pl_widget.x + padding, ! (pl->pl_widget.y + pl->pl_widget.height - 1)); } PLAYLIST_UNLOCK(); } *************** *** 698,702 **** } ! void playlist_list_set_font(char *font) { --- 666,670 ---- } ! void playlist_list_set_font(const gchar * font) { *************** *** 741,743 **** --- 709,712 ---- || g_strstr_len(font_lower, strlen(font_lower), "italic"); + g_free(font_lower); } Index: playlist_list.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** playlist_list.h 24 Dec 2003 14:03:17 -0000 1.2 --- playlist_list.h 26 Dec 2003 03:33:06 -0000 1.3 *************** *** 21,28 **** #define PLAYLIST_LIST_H typedef struct { Widget pl_widget; ! gint pl_fheight, pl_prev_selected, pl_prev_min, pl_prev_max; ! gint pl_first, pl_num_visible, pl_drag_pos; gboolean pl_dragging, pl_auto_drag_down, pl_auto_drag_up; gint pl_auto_drag_up_tag, pl_auto_drag_down_tag; --- 21,35 ---- #define PLAYLIST_LIST_H + #include <glib.h> + #include <gtk/gtk.h> + #include <gdk/gdk.h> + + #include "widget.h" + + #define PLAYLIST_LIST(x) ((PlayList_List*)(x)) typedef struct { Widget pl_widget; ! gint pl_first, pl_fheight, pl_prev_selected, pl_prev_min, pl_prev_max; ! gint pl_num_visible, pl_drag_pos; gboolean pl_dragging, pl_auto_drag_down, pl_auto_drag_up; gint pl_auto_drag_up_tag, pl_auto_drag_down_tag; *************** *** 36,41 **** void playlist_list_move_up(PlayList_List * pl); void playlist_list_move_down(PlayList_List * pl); ! int playlist_list_get_playlist_position(PlayList_List * pl, int x, int y); ! void playlist_list_set_font(char *font); #endif --- 43,49 ---- void playlist_list_move_up(PlayList_List * pl); void playlist_list_move_down(PlayList_List * pl); ! int playlist_list_get_playlist_position(PlayList_List * pl, gint x, ! gint y); ! void playlist_list_set_font(const gchar * font); #endif Index: pluginenum.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/pluginenum.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pluginenum.c 24 Dec 2003 14:03:17 -0000 1.13 --- pluginenum.c 26 Dec 2003 03:33:06 -0000 1.14 *************** *** 155,159 **** p->add_vis_pcm = input_add_vis_pcm; p->set_info = playlist_set_info; ! p->set_info_text = (void (*)(char *)) input_set_info_text; ip_data->input_list = g_list_prepend(ip_data->input_list, p); --- 155,159 ---- p->add_vis_pcm = input_add_vis_pcm; p->set_info = playlist_set_info; ! p->set_info_text = (void (*)(gchar *)) input_set_info_text; ip_data->input_list = g_list_prepend(ip_data->input_list, p); Index: skinwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/skinwin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** skinwin.c 24 Dec 2003 14:03:17 -0000 1.9 --- skinwin.c 26 Dec 2003 03:33:06 -0000 1.10 *************** *** 161,165 **** } ! static void scan_skindir(char *path) { GDir *dir2; --- 161,165 ---- } ! static void scan_skindir(const gchar * path) { GDir *dir2; Index: util.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** util.c 24 Dec 2003 14:03:17 -0000 1.10 --- util.c 26 Dec 2003 03:33:06 -0000 1.11 *************** *** 1137,1140 **** --- 1137,1152 ---- } + /* counts number of digits in a gint */ + guint gint_count_digits(gint n) + { + guint count = 0; + + do { + count++; + n /= 10; + } while (n > 0); + + return count; + } #if defined(USE_DMALLOC) Index: util.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/util.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** util.h 24 Dec 2003 14:03:17 -0000 1.6 --- util.h 26 Dec 2003 03:33:06 -0000 1.7 *************** *** 60,63 **** --- 60,65 ---- gchar *archive_basename(const gchar * str); + guint gint_count_digits(gint n); + #if ENABLE_NLS gchar *util_menu_translate(const gchar * path, gpointer func_data); |
From: <des...@us...> - 2003-12-25 23:26:17
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv15620 Modified Files: controlsocket.c dirbrowser.c equalizer.c main.c mainwin.c playlist.c playlist.h playlist_list.c playlist_slider.c playlistwin.c prefswin.c Log Message: - cleanup - renamed get_playlist*() to playlist_get*() Index: controlsocket.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/controlsocket.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** controlsocket.c 24 Dec 2003 14:03:12 -0000 1.9 --- controlsocket.c 25 Dec 2003 23:26:13 -0000 1.10 *************** *** 307,315 **** break; case CMD_GET_PLAYLIST_POS: ! ctrl_write_gint(pkt->fd, get_playlist_position()); ctrl_ack_packet(pkt); break; case CMD_GET_PLAYLIST_LENGTH: ! ctrl_write_gint(pkt->fd, get_playlist_length()); ctrl_ack_packet(pkt); break; --- 307,315 ---- break; case CMD_GET_PLAYLIST_POS: ! ctrl_write_gint(pkt->fd, playlist_get_position()); ctrl_ack_packet(pkt); break; case CMD_GET_PLAYLIST_LENGTH: ! ctrl_write_gint(pkt->fd, playlist_get_length()); ctrl_ack_packet(pkt); break; *************** *** 500,504 **** if (get_input_paused()) input_pause(); ! else if (get_playlist_length()) playlist_play(); else --- 500,504 ---- if (get_input_paused()) input_pause(); ! else if (playlist_get_length()) playlist_play(); else *************** *** 520,524 **** case CMD_SET_PLAYLIST_POS: num = *((guint32 *) data); ! if (num < get_playlist_length()) playlist_set_position(num); break; --- 520,524 ---- case CMD_SET_PLAYLIST_POS: num = *((guint32 *) data); ! if (num < playlist_get_length()) playlist_set_position(num); break; Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dirbrowser.c 24 Dec 2003 17:17:01 -0000 1.13 --- dirbrowser.c 25 Dec 2003 23:26:13 -0000 1.14 *************** *** 14,31 **** ! static gboolean click_play = FALSE; ! static void bmp_db_set_icon(GtkWidget * win); ! ! GtkTreePath *current; ! gchar *playlist_current_name = NULL; ! GtkItemFactory *bmp_db_popup; ! GtkWidget *progressbar_db; static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); enum { --- 14,31 ---- ! static GtkTreePath *current; ! static gchar *playlist_current_name = NULL; ! static GtkItemFactory *bmp_db_popup; ! static GtkWidget *progressbar_db; ! static gboolean click_play = FALSE; static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); ! static void bmp_db_set_icon(GtkWidget * win); ! enum { Index: equalizer.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** equalizer.c 24 Dec 2003 15:24:20 -0000 1.8 --- equalizer.c 25 Dec 2003 23:26:13 -0000 1.9 *************** *** 1579,1583 **** gdk_window_raise(equalizerwin_save_auto_window->window); if ((name = ! playlist_get_filename(get_playlist_position())) != NULL) { gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), g_basename(name)); --- 1579,1583 ---- gdk_window_raise(equalizerwin_save_auto_window->window); if ((name = ! playlist_get_filename(playlist_get_position())) != NULL) { gtk_entry_set_text(GTK_ENTRY(equalizerwin_save_auto_entry), g_basename(name)); *************** *** 1603,1607 **** /* gtk_window_set_position(equalizerwin_save_filesel, GTK_WIN_POS_CENTER); */ if ((songname = ! playlist_get_filename(get_playlist_position())) != NULL) { gchar *eqname = g_strdup_printf("%s.%s", songname, cfg.eqpreset_extension); --- 1603,1607 ---- /* gtk_window_set_position(equalizerwin_save_filesel, GTK_WIN_POS_CENTER); */ if ((songname = ! playlist_get_filename(playlist_get_position())) != NULL) { gchar *eqname = g_strdup_printf("%s.%s", songname, cfg.eqpreset_extension); Index: main.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/main.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** main.c 24 Dec 2003 17:30:09 -0000 1.26 --- main.c 25 Dec 2003 23:26:13 -0000 1.27 *************** *** 511,515 **** cfg.mainwin_font); xmms_cfg_write_int(cfgfile, "xmms", "playlist_position", ! get_playlist_position()); /* dock_get_widget_pos(equalizerwin, &cfg.equalizer_x, &cfg.equalizer_y); */ xmms_cfg_write_int(cfgfile, "xmms", "equalizer_x", cfg.equalizer_x); --- 511,515 ---- cfg.mainwin_font); xmms_cfg_write_int(cfgfile, "xmms", "playlist_position", ! playlist_get_position()); /* dock_get_widget_pos(equalizerwin, &cfg.equalizer_x, &cfg.equalizer_y); */ xmms_cfg_write_int(cfgfile, "xmms", "equalizer_x", cfg.equalizer_x); Index: mainwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/mainwin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mainwin.c 24 Dec 2003 17:17:01 -0000 1.8 --- mainwin.c 25 Dec 2003 23:26:13 -0000 1.9 *************** *** 1317,1321 **** if (GTK_IS_WIDGET(mainwin_jtf)) { ! playlist = get_playlist(); gtk_list_store_clear(store); --- 1317,1321 ---- if (GTK_IS_WIDGET(mainwin_jtf)) { ! playlist = playlist_get(); gtk_list_store_clear(store); *************** *** 1363,1367 **** PLAYLIST_LOCK(); ! playlist = get_playlist(); key = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); store = --- 1363,1367 ---- PLAYLIST_LOCK(); ! playlist = playlist_get(); key = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget))); store = *************** *** 1459,1463 **** PLAYLIST_LOCK(); ! playlist = get_playlist(); /* if (!playlist) --- 1459,1463 ---- PLAYLIST_LOCK(); ! playlist = playlist_get(); /* if (!playlist) *************** *** 1804,1808 **** return; } ! if (get_playlist_length()) playlist_play(); else --- 1804,1808 ---- return; } ! if (playlist_get_length()) playlist_play(); else Index: playlist.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** playlist.c 24 Dec 2003 14:03:17 -0000 1.22 --- playlist.c 25 Dec 2003 23:26:13 -0000 1.23 *************** *** 68,72 **** static void playlist_load_ins_file(gchar * filename, gchar * playlist_name, glong pos, gchar * title, gint len); - static int __get_playlist_length(void); static void playlist_generate_shuffle_list(void); static void __playlist_generate_shuffle_list(void); --- 68,71 ---- *************** *** 182,186 **** playlist_position = NULL; /* Make sure the entry did not disappear under us */ ! if (g_list_index(get_playlist(), entry) == -1) return; } else if (playing_song && --- 181,185 ---- playlist_position = NULL; /* Make sure the entry did not disappear under us */ ! if (g_list_index(playlist_get(), entry) == -1) return; } else if (playing_song && *************** *** 292,297 **** } ! static void __playlist_ins_with_info(char *filename, long pos, char *title, ! int len) { PlaylistEntry *entry; --- 291,296 ---- } ! static void __playlist_ins_with_info(const gchar * filename, glong pos, ! const gchar * title, gint len) { PlaylistEntry *entry; *************** *** 311,325 **** } ! static void __playlist_ins(char *filename, long pos) { __playlist_ins_with_info(filename, pos, NULL, -1); } ! static gboolean is_playlist_name(char *pathname) { ! char *ext; ext = strrchr(pathname, '.'); ! if (ext && ((!strcasecmp(ext, ".m3u") || !strcasecmp(ext, ".pls")))) return TRUE; --- 310,324 ---- } ! static void __playlist_ins(const gchar * filename, glong pos) { __playlist_ins_with_info(filename, pos, NULL, -1); } ! static gboolean is_playlist_name(const gchar * pathname) { ! gchar *ext; ext = strrchr(pathname, '.'); ! if (ext && (!strcasecmp(ext, ".m3u") || !strcasecmp(ext, ".pls"))) return TRUE; *************** *** 343,347 **** * net. */ - struct stat stat_buf; /* --- 342,345 ---- *************** *** 351,362 **** * fstat() */ ! ! ! if (!stat(filename, &stat_buf) && S_ISREG(stat_buf.st_mode)) { ! char buf[64], *p; FILE *file; ! int r; ! if ((file = fopen(filename, "r")) != NULL) { r = fread(buf, 1, sizeof(buf), file); fclose(file); --- 349,358 ---- * fstat() */ ! if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { ! gchar buf[64], *p; FILE *file; ! gint r; ! if ((file = fopen(filename, "r"))) { r = fread(buf, 1, sizeof(buf), file); fclose(file); *************** *** 389,393 **** } ! static int devino_compare(gconstpointer a, gconstpointer b) { const struct devino *da = a, *db = b; --- 385,389 ---- } ! static gint devino_compare(gconstpointer a, gconstpointer b) { const struct devino *da = a, *db = b; *************** *** 401,420 **** } ! static GList *playlist_dir_find_files(char *path, gboolean background, GHashTable * htab) { ! DIR *dir; ! struct dirent *dirent; ! struct stat statbuf; ! char *temp; GList *list = NULL, *ilist; ! struct devino *devino; ! if (stat(path, &statbuf) < 0) ! return NULL; ! if (!S_ISDIR(statbuf.st_mode)) return NULL; devino = g_malloc(sizeof(*devino)); devino->dev = statbuf.st_dev; --- 397,414 ---- } ! static GList *playlist_dir_find_files(gchar * path, gboolean background, GHashTable * htab) { ! GDir *dir; GList *list = NULL, *ilist; ! const gchar *dirent; ! struct stat statbuf; ! struct devino *devino; ! if (!g_file_test(path, G_FILE_TEST_IS_DIR)) return NULL; + stat(path, &statbuf); devino = g_malloc(sizeof(*devino)); devino->dev = statbuf.st_dev; *************** *** 428,441 **** g_hash_table_insert(htab, devino, GINT_TO_POINTER(1)); ! if (path[strlen(path) - 1] != '/') ! temp = g_strconcat(path, "/", NULL); ! else ! temp = g_strdup(path); ! ! if ((ilist = input_scan_dir(temp)) != NULL) { GList *node; node = ilist; while (node) { ! char *name = g_strconcat(temp, node->data, NULL); list = g_list_prepend(list, name); g_free(node->data); --- 422,430 ---- g_hash_table_insert(htab, devino, GINT_TO_POINTER(1)); ! if ((ilist = input_scan_dir(path))) { GList *node; node = ilist; while (node) { ! gchar *name = g_build_filename(path, node->data, NULL); list = g_list_prepend(list, name); g_free(node->data); *************** *** 443,469 **** } g_list_free(ilist); - g_free(temp); return list; } ! if ((dir = opendir(path)) == NULL) { ! g_free(temp); ! return 0; ! } ! while ((dirent = readdir(dir)) != NULL) { ! char *filename; ! if (dirent->d_name[0] == '.') continue; ! filename = g_strconcat(temp, dirent->d_name, NULL); ! ! if (stat(filename, &statbuf) < 0) { ! g_free(filename); ! continue; ! } ! if (S_ISDIR(statbuf.st_mode)) { GList *sub; sub = playlist_dir_find_files(filename, background, htab); --- 432,450 ---- } g_list_free(ilist); return list; } ! if (!(dir = g_dir_open(path, 0, NULL))) ! return NULL; ! while ((dirent = g_dir_read_name(dir))) { ! gchar *filename; ! if (dirent[0] == '.') continue; ! filename = g_build_filename(path, dirent, NULL); ! if (g_file_test(filename, G_FILE_TEST_IS_DIR)) { GList *sub; sub = playlist_dir_find_files(filename, background, htab); *************** *** 478,488 **** gtk_main_iteration(); } ! closedir(dir); ! g_free(temp); return list; } ! guint playlist_ins_dir(char *path, long pos, gboolean background) { --- 459,468 ---- gtk_main_iteration(); } ! g_dir_close(dir); return list; } ! guint playlist_ins_dir(gchar * path, glong pos, gboolean background) { *************** *** 491,495 **** GHashTable *htab; - htab = g_hash_table_new(devino_hash, devino_compare); --- 471,474 ---- *************** *** 517,525 **** guint playlist_ins_url_string(gchar * string, glong pos) { ! char *temp; ! struct stat statbuf; ! int i = 1, entries = 0; gboolean first = TRUE; ! guint firstpos = (guint) NULL; gboolean success = FALSE; gchar *decoded = NULL; --- 496,503 ---- guint playlist_ins_url_string(gchar * string, glong pos) { ! gchar *temp; ! gint i = 1, entries = 0; gboolean first = TRUE; ! guint firstpos = 0; gboolean success = FALSE; gchar *decoded = NULL; *************** *** 536,541 **** } - - if ((!strncasecmp(string, "file:", 5))) { decoded = g_strdup(xmms_urldecode_path(string)); --- 514,517 ---- *************** *** 544,559 **** } ! ! ! stat(decoded, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { ! i = playlist_ins_dir(decoded, pos, FALSE); } else { if (is_playlist_name(decoded)) { - i = playlist_load_ins(decoded, pos); } else { - success = playlist_ins(decoded, pos); i = 1; --- 520,529 ---- } ! if (g_file_test(decoded, G_FILE_TEST_IS_DIR)) { i = playlist_ins_dir(decoded, pos, FALSE); } else { if (is_playlist_name(decoded)) { i = playlist_load_ins(decoded, pos); } else { success = playlist_ins(decoded, pos); i = 1; *************** *** 561,565 **** } ! node = g_list_nth(get_playlist(), pos); entries += i; --- 531,535 ---- } ! node = g_list_nth(playlist_get(), pos); entries += i; *************** *** 588,592 **** guint32 randval; ! if (get_playlist_length() == 0) return; --- 558,562 ---- guint32 randval; ! if (playlist_get_length() == 0) return; *************** *** 650,655 **** ! void playlist_set_info(gchar * title, gint length, gint rate, gint freq, ! gint nch) { PLAYLIST_LOCK(); --- 620,625 ---- ! void playlist_set_info(const gchar * title, gint length, gint rate, ! gint freq, gint nch) { PLAYLIST_LOCK(); *************** *** 667,671 **** void playlist_check_pos_current(void) { ! int pos, row, bottom; PLAYLIST_LOCK(); --- 637,641 ---- void playlist_check_pos_current(void) { ! gint pos, row, bottom; PLAYLIST_LOCK(); *************** *** 682,686 **** } ! bottom = MAX(0, __get_playlist_length() - playlistwin_list->pl_num_visible); row = CLAMP(pos - playlistwin_list->pl_num_visible / 2, 0, bottom); --- 652,656 ---- } ! bottom = MAX(0, playlist_get_length_nolock() - playlistwin_list->pl_num_visible); row = CLAMP(pos - playlistwin_list->pl_num_visible / 2, 0, bottom); *************** *** 857,866 **** } ! int playlist_get_queue_position(PlaylistEntry * entry) { return g_list_index(queued_list, entry); } ! void playlist_set_position(int pos) { GList *node; --- 827,836 ---- } ! gint playlist_get_queue_position(PlaylistEntry * entry) { return g_list_index(queued_list, entry); } ! void playlist_set_position(gint pos) { GList *node; *************** *** 944,953 **** } ! gint get_playlist_length(void) { ! int retval; PLAYLIST_LOCK(); ! retval = __get_playlist_length(); PLAYLIST_UNLOCK(); --- 914,923 ---- } ! gint playlist_get_length(void) { ! gint retval; PLAYLIST_LOCK(); ! retval = playlist_get_length_nolock(); PLAYLIST_UNLOCK(); *************** *** 955,974 **** } ! gint get_playlist_length_nolock(void) ! { ! int retval; ! ! retval = __get_playlist_length(); ! ! return retval; ! } ! ! ! static gint __get_playlist_length(void) { ! /* Caller should hold playlist_mutex */ ! if (playlist) ! return (g_list_length(playlist)); ! return 0; } --- 925,931 ---- } ! gint playlist_get_length_nolock(void) { ! return g_list_length(playlist); } *************** *** 996,1000 **** if (cfg.show_numbers_in_pl) ! numbers = g_strdup_printf("%d. ", __get_playlist_position() + 1); else numbers = g_strdup(""); --- 953,957 ---- if (cfg.show_numbers_in_pl) ! numbers = g_strdup_printf("%d. ", __playlist_get_position() + 1); else numbers = g_strdup(""); *************** *** 1032,1036 **** gint playlist_get_current_length(void) { ! int retval = 0; PLAYLIST_LOCK(); --- 989,993 ---- gint playlist_get_current_length(void) { ! gint retval = 0; PLAYLIST_LOCK(); *************** *** 1054,1058 **** is_pls = TRUE; g_fprintf(file, "[playlist]\n"); ! g_fprintf(file, "NumberOfEntries=%d\n", get_playlist_length()); } else if (cfg.use_pl_metadata) g_fprintf(file, "#EXTM3U\n"); --- 1011,1015 ---- is_pls = TRUE; g_fprintf(file, "[playlist]\n"); ! g_fprintf(file, "NumberOfEntries=%d\n", playlist_get_length()); } else if (cfg.use_pl_metadata) g_fprintf(file, "#EXTM3U\n"); *************** *** 1267,1271 **** ! GList *get_playlist(void) { /* Caller should hold playlist_mutex */ --- 1224,1228 ---- ! GList *playlist_get(void) { /* Caller should hold playlist_mutex */ *************** *** 1273,1277 **** } ! gint __get_playlist_position(void) { /* Caller should hold playlist_mutex */ --- 1230,1234 ---- } ! gint __playlist_get_position(void) { /* Caller should hold playlist_mutex */ *************** *** 1281,1290 **** } ! gint get_playlist_position(void) { int retval; PLAYLIST_LOCK(); ! retval = __get_playlist_position(); PLAYLIST_UNLOCK(); --- 1238,1247 ---- } ! gint playlist_get_position(void) { int retval; PLAYLIST_LOCK(); ! retval = __playlist_get_position(); PLAYLIST_UNLOCK(); *************** *** 1318,1322 **** gchar *playlist_get_songtitle(gint pos) { ! char *title = NULL, *filename, *utf8title; PlaylistEntry *entry; GList *node; --- 1275,1279 ---- gchar *playlist_get_songtitle(gint pos) { ! gchar *title = NULL; PlaylistEntry *entry; GList *node; *************** *** 1334,1359 **** entry = node->data; ! filename = g_strdup(entry->filename); ! ! if (entry->title == NULL && entry->length == -1) { if (playlist_get_info_entry(entry)) title = g_strdup(entry->title); - - PLAYLIST_UNLOCK(); } else { title = g_strdup(entry->title); - PLAYLIST_UNLOCK(); } ! if (title == NULL) ! title = g_strdup(g_basename(filename)); ! ! utf8title = g_locale_to_utf8(title, -1, NULL, NULL, NULL); ! if (utf8title == NULL) ! title = g_strdup(g_basename(filename)); ! // printf("%s\n", title); ! g_free(filename); ! g_free(utf8title); return title; --- 1291,1305 ---- entry = node->data; ! if (!entry->title && entry->length == -1) { if (playlist_get_info_entry(entry)) title = g_strdup(entry->title); } else { title = g_strdup(entry->title); } + PLAYLIST_UNLOCK(); ! if (!title || !g_utf8_validate(title, -1, NULL)) ! title = g_path_get_basename(entry->filename); return title; *************** *** 1362,1366 **** gint playlist_get_songtime(gint pos) { ! int retval = -1; PlaylistEntry *entry; GList *node; --- 1308,1312 ---- gint playlist_get_songtime(gint pos) { ! gint retval = -1; PlaylistEntry *entry; GList *node; *************** *** 1391,1398 **** } ! static int playlist_sort_by_title_cmpfunc(PlaylistEntry * a, ! PlaylistEntry * b) { ! char *a_title, *b_title; if (a->title) --- 1337,1344 ---- } ! static gint playlist_sort_by_title_cmpfunc(PlaylistEntry * a, ! PlaylistEntry * b) { ! const gchar *a_title, *b_title; if (a->title) *************** *** 1665,1669 **** PLAYLIST_LOCK(); ! for (node = get_playlist(); node != 0; node = g_list_next(node), i++) { PlaylistEntry *entry = node->data; if (entry->selected) --- 1611,1615 ---- PLAYLIST_LOCK(); ! for (node = playlist_get(); node != 0; node = g_list_next(node), i++) { PlaylistEntry *entry = node->data; if (entry->selected) *************** *** 1680,1684 **** // PLAYLIST_LOCK(); ! for (node = get_playlist(); node != 0; node = g_list_next(node), i++) { PlaylistEntry *entry = node->data; entry->selected = FALSE; --- 1626,1630 ---- // PLAYLIST_LOCK(); ! for (node = playlist_get(); node != 0; node = g_list_next(node), i++) { PlaylistEntry *entry = node->data; entry->selected = FALSE; *************** *** 1695,1699 **** PLAYLIST_LOCK(); ! for (node = get_playlist(); node != 0; node = g_list_next(node)) { PlaylistEntry *entry = node->data; if (entry->selected) --- 1641,1645 ---- PLAYLIST_LOCK(); ! for (node = playlist_get(); node != 0; node = g_list_next(node)) { PlaylistEntry *entry = node->data; if (entry->selected) *************** *** 1744,1748 **** PLAYLIST_LOCK(); ! if ((node = g_list_nth(get_playlist(), pos)) != NULL) { PlaylistEntry *entry = node->data; path = g_strdup(entry->filename); --- 1690,1694 ---- PLAYLIST_LOCK(); ! if ((node = g_list_nth(playlist_get(), pos)) != NULL) { PlaylistEntry *entry = node->data; path = g_strdup(entry->filename); *************** *** 1760,1764 **** PLAYLIST_LOCK(); ! if (get_playlist() && playlist_position) path = g_strdup(playlist_position->filename); PLAYLIST_UNLOCK(); --- 1706,1710 ---- PLAYLIST_LOCK(); ! if (playlist_get() && playlist_position) path = g_strdup(playlist_position->filename); PLAYLIST_UNLOCK(); *************** *** 1793,1797 **** /* Make sure entry is still around */ ! if (g_list_index(get_playlist(), entry) == -1) return FALSE; --- 1739,1743 ---- /* Make sure entry is still around */ ! if (g_list_index(playlist_get(), entry) == -1) return FALSE; *************** *** 1812,1824 **** if (cfg.get_info_on_load && playlist_get_info_scan_active) { PLAYLIST_LOCK(); ! for (node = get_playlist(); node; node = g_list_next(node)) { entry = node->data; if (entry->title || entry->length != -1) continue; if (!playlist_get_info_entry(entry)) { ! if (g_list_index(get_playlist(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ ! node = get_playlist(); } else if (entry->title || entry->length != -1) { update_playlistwin = TRUE; --- 1758,1770 ---- if (cfg.get_info_on_load && playlist_get_info_scan_active) { PLAYLIST_LOCK(); ! for (node = playlist_get(); node; node = g_list_next(node)) { entry = node->data; if (entry->title || entry->length != -1) continue; if (!playlist_get_info_entry(entry)) { ! if (g_list_index(playlist_get(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ ! node = playlist_get(); } else if (entry->title || entry->length != -1) { update_playlistwin = TRUE; *************** *** 1837,1841 **** PLAYLIST_LOCK(); ! if (!get_playlist()) { PLAYLIST_UNLOCK(); xmms_usleep(1000000); --- 1783,1787 ---- PLAYLIST_LOCK(); ! if (!playlist_get()) { PLAYLIST_UNLOCK(); xmms_usleep(1000000); *************** *** 1844,1852 **** for (node = ! g_list_nth(get_playlist(), playlistwin_get_toprow()); node && playlistwin_item_visible(g_list_position ! (get_playlist(), node)); node = g_list_next(node)) { entry = node->data; --- 1790,1798 ---- for (node = ! g_list_nth(playlist_get(), playlistwin_get_toprow()); node && playlistwin_item_visible(g_list_position ! (playlist_get(), node)); node = g_list_next(node)) { entry = node->data; *************** *** 1855,1863 **** if (!playlist_get_info_entry(entry)) { ! if (g_list_index(get_playlist(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ node = ! g_list_nth(get_playlist(), playlistwin_get_toprow()); } else if (entry->title || entry->length != -1) { --- 1801,1809 ---- if (!playlist_get_info_entry(entry)) { ! if (g_list_index(playlist_get(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ node = ! g_list_nth(playlist_get(), playlistwin_get_toprow()); } else if (entry->title || entry->length != -1) { *************** *** 1978,1982 **** PLAYLIST_LOCK(); ! list = get_playlist(); while (list) { entry = list->data; --- 1924,1928 ---- PLAYLIST_LOCK(); ! list = playlist_get(); while (list) { entry = list->data; *************** *** 2001,2005 **** PLAYLIST_LOCK(); ! list = get_playlist(); while (list) { PlaylistEntry *entry = list->data; --- 1947,1951 ---- PLAYLIST_LOCK(); ! list = playlist_get(); while (list) { PlaylistEntry *entry = list->data; *************** *** 2015,2019 **** PLAYLIST_LOCK(); ! list = get_playlist(); while (list) { PlaylistEntry *entry = list->data; --- 1961,1965 ---- PLAYLIST_LOCK(); ! list = playlist_get(); while (list) { PlaylistEntry *entry = list->data; *************** *** 2030,2034 **** PLAYLIST_LOCK(); ! if ((list = g_list_nth(get_playlist(), num)) != NULL) { PlaylistEntry *entry = list->data; entry->selected = !entry->selected; --- 1976,1980 ---- PLAYLIST_LOCK(); ! if ((list = g_list_nth(playlist_get(), num)) != NULL) { PlaylistEntry *entry = list->data; entry->selected = !entry->selected; *************** *** 2053,2057 **** PLAYLIST_LOCK(); ! list = g_list_nth(get_playlist(), min); for (i = min; i <= max && list; i++) { PlaylistEntry *entry = list->data; --- 1999,2003 ---- PLAYLIST_LOCK(); ! list = g_list_nth(playlist_get(), min); for (i = min; i <= max && list; i++) { PlaylistEntry *entry = list->data; *************** *** 2068,2072 **** PLAYLIST_LOCK(); ! for (node = get_playlist(); node; node = node->next) { PlaylistEntry *entry = node->data; // if (entry->selected) --- 2014,2018 ---- PLAYLIST_LOCK(); ! for (node = playlist_get(); node; node = node->next) { PlaylistEntry *entry = node->data; // if (entry->selected) *************** *** 2078,2085 **** entry->length = -1; if (!playlist_get_info_entry(entry)) { ! if (g_list_index(get_playlist(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ ! node = get_playlist(); } // } --- 2024,2031 ---- entry->length = -1; if (!playlist_get_info_entry(entry)) { ! if (g_list_index(playlist_get(), entry) == -1) /* Entry disapeared while we looked it up. Restart. */ ! node = playlist_get(); } // } *************** *** 2095,2099 **** PLAYLIST_LOCK(); ! if ((node = g_list_nth(get_playlist(), pos)) != NULL) { PlaylistEntry *entry = node->data; --- 2041,2045 ---- PLAYLIST_LOCK(); ! if ((node = g_list_nth(playlist_get(), pos)) != NULL) { PlaylistEntry *entry = node->data; Index: playlist.h =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** playlist.h 24 Dec 2003 14:03:17 -0000 1.9 --- playlist.h 25 Dec 2003 23:26:13 -0000 1.10 *************** *** 38,48 **** /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(char *dir, long pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) guint playlist_ins_url_string(gchar * string, glong pos); void playlist_play(void); ! void playlist_set_info(gchar * title, gint length, gint rate, gint freq, ! gint nch); void playlist_check_pos_current(void); void playlist_next(void); --- 38,48 ---- /* void playlist_add_dir(gchar * dir); */ #define playlist_add_dir(directory) playlist_ins_dir(directory, -1, TRUE) ! guint playlist_ins_dir(gchar *dir, glong pos, gboolean background); /* void playlist_add_url_string(gchar * string); */ #define playlist_add_url_string(string) playlist_ins_url_string(string, -1) guint playlist_ins_url_string(gchar * string, glong pos); void playlist_play(void); ! void playlist_set_info(const gchar * title, gint length, gint rate, ! gint freq, gint nch); void playlist_check_pos_current(void); void playlist_next(void); *************** *** 50,67 **** void playlist_queue(void); void playlist_queue_position(gint pos); ! gboolean playlist_is_position_queued(int pos); void playlist_clear_queue(void); int playlist_get_queue_position(PlaylistEntry * entry); void playlist_eof_reached(void); void playlist_set_position(gint pos); ! gint get_playlist_length(void); ! gint get_playlist_length_nolock(void); ! gint get_playlist_position(void); ! gint __get_playlist_position(void); gchar *playlist_get_info_text(void); int playlist_get_current_length(void); ! gboolean playlist_save(const char *filename, gboolean is_pls); gboolean playlist_load(gchar * filename); ! GList *get_playlist(void); void playlist_start_get_info_thread(void); void playlist_stop_get_info_thread(); --- 50,67 ---- void playlist_queue(void); void playlist_queue_position(gint pos); ! gboolean playlist_is_position_queued(gint pos); void playlist_clear_queue(void); int playlist_get_queue_position(PlaylistEntry * entry); void playlist_eof_reached(void); void playlist_set_position(gint pos); ! gint playlist_get_length(void); ! gint playlist_get_length_nolock(void); ! gint playlist_get_position(void); ! gint __playlist_get_position(void); gchar *playlist_get_info_text(void); int playlist_get_current_length(void); ! gboolean playlist_save(const gchar *filename, gboolean is_pls); gboolean playlist_load(gchar * filename); ! GList *playlist_get(void); void playlist_start_get_info_thread(void); void playlist_stop_get_info_thread(); *************** *** 92,100 **** gboolean * selection_more); void playlist_select_all(gboolean set); ! void playlist_select_range(int min, int max, gboolean sel); void playlist_select_invert_all(void); ! gboolean playlist_select_invert(int num); gboolean playlist_read_info_selection(void); ! void playlist_read_info(int pos); void playlist_set_shuffle(gboolean shuffle); void playlist_clear_selected(void); --- 92,100 ---- gboolean * selection_more); void playlist_select_all(gboolean set); ! void playlist_select_range(gint min, gint max, gboolean sel); void playlist_select_invert_all(void); ! gboolean playlist_select_invert(gint num); gboolean playlist_read_info_selection(void); ! void playlist_read_info(gint pos); void playlist_set_shuffle(gboolean shuffle); void playlist_clear_selected(void); Index: playlist_list.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_list.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** playlist_list.c 24 Dec 2003 14:03:17 -0000 1.11 --- playlist_list.c 25 Dec 2003 23:26:13 -0000 1.12 *************** *** 96,100 **** PLAYLIST_LOCK(); ! if ((list = get_playlist()) == NULL) { PLAYLIST_UNLOCK(); return; --- 96,100 ---- PLAYLIST_LOCK(); ! if ((list = playlist_get()) == NULL) { PLAYLIST_UNLOCK(); return; *************** *** 124,128 **** PLAYLIST_LOCK(); ! if ((list = g_list_last(get_playlist())) == NULL) { PLAYLIST_UNLOCK(); return; --- 124,128 ---- PLAYLIST_LOCK(); ! if ((list = g_list_last(playlist_get())) == NULL) { PLAYLIST_UNLOCK(); return; *************** *** 157,162 **** y = event->y - pl->pl_widget.y; nr = (y / pl->pl_fheight) + pl->pl_first; ! if (nr >= get_playlist_length()) ! nr = get_playlist_length() - 1; if (!(event->state & GDK_CONTROL_MASK)) playlist_select_all(FALSE); --- 157,162 ---- y = event->y - pl->pl_widget.y; nr = (y / pl->pl_fheight) + pl->pl_first; ! if (nr >= playlist_get_length()) ! nr = playlist_get_length() - 1; if (!(event->state & GDK_CONTROL_MASK)) playlist_select_all(FALSE); *************** *** 210,214 **** return -1; ! if ((length = get_playlist_length()) == 0) return -1; iy = y - pl->pl_widget.y; --- 210,214 ---- return -1; ! if ((length = playlist_get_length()) == 0) return -1; iy = y - pl->pl_widget.y; *************** *** 311,315 **** gchar *pos_string = g_strdup_printf("%d", ppos); plist_length_int = ! strlen(g_strdup_printf("%d", get_playlist_length_nolock())) + 1; --- 311,315 ---- gchar *pos_string = g_strdup_printf("%d", ppos); plist_length_int = ! strlen(g_strdup_printf("%d", playlist_get_length_nolock())) + 1; *************** *** 391,395 **** PLAYLIST_LOCK(); ! list = get_playlist(); pl->pl_fheight = (ascent + abs(descent)); --- 391,395 ---- PLAYLIST_LOCK(); ! list = playlist_get(); pl->pl_fheight = (ascent + abs(descent)); *************** *** 421,425 **** width, pl->pl_fheight); } ! if (i == __get_playlist_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); else --- 421,425 ---- width, pl->pl_fheight); } ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); else *************** *** 467,471 **** tw = width - t_width - 5; ! if (i == __get_playlist_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 467,471 ---- tw = width - t_width - 5; ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 497,501 **** pl->pl_fheight - 1); ! if (i == __get_playlist_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 497,501 ---- pl->pl_fheight - 1); ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 543,547 **** tw = width; ! if (i == __get_playlist_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); --- 543,547 ---- tw = width; ! if (i == __playlist_get_position()) gdk_gc_set_foreground(gc, get_skin_color(SKIN_PLEDIT_CURRENT)); *************** *** 572,576 **** /* We already hold the mutex and have the playlist locked, so call the non-locking function. */ ! plength = get_playlist_length_nolock(); x = pl->drag_motion_x; --- 572,576 ---- /* We already hold the mutex and have the playlist locked, so call the non-locking function. */ ! plength = playlist_get_length_nolock(); x = pl->drag_motion_x; *************** *** 634,642 **** padding = -1 + ! strlen(g_strdup_printf("%d", get_playlist_length_nolock())) + 1; padding = (padding * width_approx_digits) + (width_approx_digits / 1.3); ! if (get_playlist_length_nolock() <= 0) padding = 3; --- 634,642 ---- padding = -1 + ! strlen(g_strdup_printf("%d", playlist_get_length_nolock())) + 1; padding = (padding * width_approx_digits) + (width_approx_digits / 1.3); ! if (playlist_get_length_nolock() <= 0) padding = 3; Index: playlist_slider.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlist_slider.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** playlist_slider.c 24 Dec 2003 14:03:17 -0000 1.3 --- playlist_slider.c 25 Dec 2003 23:26:13 -0000 1.4 *************** *** 24,32 **** PlaylistSlider *ps = (PlaylistSlider *) w; GdkPixmap *obj; ! int y, skinx; ! if (get_playlist_length() > ps->ps_list->pl_num_visible) y = (ps->ps_list->pl_first * (ps->ps_widget.height - 19)) / ! (get_playlist_length() - ps->ps_list->pl_num_visible); else y = 0; --- 24,32 ---- PlaylistSlider *ps = (PlaylistSlider *) w; GdkPixmap *obj; ! gint y, skinx; ! if (playlist_get_length() > ps->ps_list->pl_num_visible) y = (ps->ps_list->pl_first * (ps->ps_widget.height - 19)) / ! (playlist_get_length() - ps->ps_list->pl_num_visible); else y = 0; *************** *** 63,67 **** y = CLAMP(y, 0, ps->ps_widget.height - 19); ! pos = (y * (get_playlist_length() - ps->ps_list->pl_num_visible)) / (ps->ps_widget.height - 19); playlistwin_set_toprow(pos); --- 63,67 ---- y = CLAMP(y, 0, ps->ps_widget.height - 19); ! pos = (y * (playlist_get_length() - ps->ps_list->pl_num_visible)) / (ps->ps_widget.height - 19); playlistwin_set_toprow(pos); Index: playlistwin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/playlistwin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** playlistwin.c 24 Dec 2003 14:03:17 -0000 1.10 --- playlistwin.c 25 Dec 2003 23:26:13 -0000 1.11 *************** *** 354,358 **** int pos, time, max_len; ! pos = get_playlist_position(); title = playlist_get_songtitle(pos); time = playlist_get_songtime(pos); --- 354,358 ---- int pos, time, max_len; ! pos = playlist_get_position(); title = playlist_get_songtitle(pos); time = playlist_get_songtime(pos); *************** *** 575,579 **** playlistwin_list->pl_prev_selected = 0; playlistwin_list->pl_prev_min = 0; ! playlistwin_list->pl_prev_max = get_playlist_length() - 1; playlistwin_update_list(); } --- 575,579 ---- playlistwin_list->pl_prev_selected = 0; playlistwin_list->pl_prev_min = 0; ! playlistwin_list->pl_prev_max = playlist_get_length() - 1; playlistwin_update_list(); } *************** *** 1549,1553 **** PLAYLIST_LOCK(); ! for (node = get_playlist(); node != NULL; node = g_list_next(node)) { entry = node->data; /* ignore URLs */ --- 1549,1553 ---- PLAYLIST_LOCK(); ! for (node = playlist_get(); node != NULL; node = g_list_next(node)) { entry = node->data; /* ignore URLs */ *************** *** 1628,1632 **** pl->pl_prev_max += (up ? -1 : 1); pl->pl_prev_max = ! CLAMP(pl->pl_prev_max, 0, get_playlist_length() - 1); pl->pl_first = MIN(pl->pl_first, pl->pl_prev_max); --- 1628,1632 ---- pl->pl_prev_max += (up ? -1 : 1); pl->pl_prev_max = ! CLAMP(pl->pl_prev_max, 0, playlist_get_length() - 1); pl->pl_first = MIN(pl->pl_first, pl->pl_prev_max); *************** *** 1651,1655 **** pl->pl_prev_selected = ! CLAMP(pl->pl_prev_selected, 0, get_playlist_length() - 1); if (pl->pl_prev_selected < pl->pl_first) --- 1651,1655 ---- pl->pl_prev_selected = ! CLAMP(pl->pl_prev_selected, 0, playlist_get_length() - 1); if (pl->pl_prev_selected < pl->pl_first) *************** *** 1697,1701 **** case GDK_End: playlistwin_list->pl_first = ! get_playlist_length() - playlistwin_list->pl_num_visible; break; case GDK_Return: --- 1697,1701 ---- case GDK_End: playlistwin_list->pl_first = ! playlist_get_length() - playlistwin_list->pl_num_visible; break; case GDK_Return: *************** *** 2004,2009 **** playlistwin_list->pl_fheight) + playlistwin_list->pl_first; ! if (pos > get_playlist_length()) ! pos = get_playlist_length(); playlist_ins_url_string((gchar *) selection_data->data, pos); } else --- 2004,2009 ---- playlistwin_list->pl_fheight) + playlistwin_list->pl_first; ! if (pos > playlist_get_length()) ! pos = playlist_get_length(); playlist_ins_url_string((gchar *) selection_data->data, pos); } else Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** prefswin.c 24 Dec 2003 14:03:17 -0000 1.4 --- prefswin.c 25 Dec 2003 23:26:13 -0000 1.5 *************** *** 460,464 **** g_locale_to_utf8 (playlist_get_songtitle ! (get_playlist_position()), -1, NULL, NULL, NULL)); gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG --- 460,464 ---- g_locale_to_utf8 (playlist_get_songtitle ! (playlist_get_position()), -1, NULL, NULL, NULL)); gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG |
From: <des...@us...> - 2003-12-25 00:58:13
|
Update of /cvsroot/beepmp/bmp/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv21437/scripts Modified Files: cleanall.sh rm-auto-scripts.sh Log Message: - updated helper scripts, cleanall.sh now removes .gmo files Index: cleanall.sh =================================================================== RCS file: /cvsroot/beepmp/bmp/scripts/cleanall.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cleanall.sh 28 Nov 2003 02:09:41 -0000 1.5 --- cleanall.sh 25 Dec 2003 00:58:09 -0000 1.6 *************** *** 15,31 **** if test -e Makefile; then ! echo "cleaning up source tree" make -k distclean fi ! echo "removing auto generated files" scripts/rm-auto-scripts.sh ! echo "removing backups..." scripts/rm-backups.sh -f -v ! echo "removing change log..." rm -f ChangeLog ! echo "removing cache files used by autoconf/automake..." rm -rf autom4te* --- 15,34 ---- if test -e Makefile; then ! echo "*info* cleaning up source tree" make -k distclean fi ! echo "*info* removing .gmo files" ! find po -name '*.gmo' -exec rm -vf {} \; ! ! echo "*info* removing auto generated files" scripts/rm-auto-scripts.sh ! echo "*info* removing backups..." scripts/rm-backups.sh -f -v ! echo "*info* removing change log..." rm -f ChangeLog ! echo "*info* removing cache files used by autoconf/automake..." rm -rf autom4te* Index: rm-auto-scripts.sh =================================================================== RCS file: /cvsroot/beepmp/bmp/scripts/rm-auto-scripts.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rm-auto-scripts.sh 28 Nov 2003 02:09:41 -0000 1.6 --- rm-auto-scripts.sh 25 Dec 2003 00:58:09 -0000 1.7 *************** *** 7,26 **** # RM="rm -vf" ! RemoveMakeIns() { # scan for Makefile.ins and remove only if # there is a corresponding Makefile.am ! Files=`find ./ -name Makefile.in` ! for File in $Files; do ! if [ -e "`dirname $File`/Makefile.am" -o \ ! -e "`dirname $File`/Makefile.in.in" ]; then ! $RM $File else ! echo *info* Not deleting $File... fi --- 7,27 ---- # + DIRECTORIES=". libbeep" RM="rm -vf" ! remove_makefile_ins() { # scan for Makefile.ins and remove only if # there is a corresponding Makefile.am ! FILES=`find ./ -name Makefile.in` ! for file in $FILES; do ! if [ -e "`dirname $file`/Makefile.am" -o \ ! -e "`dirname $file`/Makefile.in.in" ]; then ! $RM $file else ! echo *info* NOT deleting $file... fi *************** *** 28,31 **** --- 29,58 ---- } + remove_files() + { + pushd . > /dev/null + + echo Entering $1 + cd $1 + + # remove files from aclocal + $RM aclocal.m4 + + # remove files from autoheader + $RM config.h.in + $RM stamp-h1.in + + # remove files from automake + remove_makefile_ins + + # remove files from autoconf and configure + $RM configure + $RM config.status + $RM libtool + $RM -r autom4te.cache + + echo Leaving $1 + popd > /dev/null + } # lame test for top level path *************** *** 34,50 **** fi ! # remove files from aclocal ! $RM {.,libbeep}/aclocal.m4 ! ! # remove files from autoheader ! $RM {.,libbeep}/config.h.in ! $RM {.,libbeep}/stamp-h1.in ! ! # remove files from automake ! RemoveMakeIns ! ! # remove files from autoconf and configure ! $RM {.,libbeep}/configure ! $RM {.,libbeep}/config.status ! $RM {.,libbeep}/libtool ! $RM -r {.,libbeep}/autom4te.cache --- 61,65 ---- fi ! for dir in $DIRECTORIES ; do ! remove_files $dir ! done |
From: <des...@us...> - 2003-12-25 00:58:13
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv21437/beep Modified Files: Makefile.am Log Message: - updated helper scripts, cleanall.sh now removes .gmo files Index: Makefile.am =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.am 24 Dec 2003 05:35:13 -0000 1.13 --- Makefile.am 25 Dec 2003 00:58:09 -0000 1.14 *************** *** 74,78 **** desktopdir = $(datadir)/applications - pkgdata_DATA = beep_logo.xpm - EXTRA_DIST = beep.wmconfig beep_mini.xpm --- 74,76 ---- |
From: <des...@us...> - 2003-12-25 00:08:07
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv15352 Modified Files: beep.desktop.in Log Message: - added 'Application' to Category field, added Encoding field Index: beep.desktop.in =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/beep.desktop.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** beep.desktop.in 29 Nov 2003 04:13:49 -0000 1.2 --- beep.desktop.in 25 Dec 2003 00:07:55 -0000 1.3 *************** *** 5,9 **** Icon=beep.svg MimeType=audio/x-scpls;audio/x-mpegurl;audio/mpegurl;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/x-wav;application/x-ogg ! Categories=GTK;AudioVideo;Player Terminal=0 Type=Application --- 5,10 ---- Icon=beep.svg MimeType=audio/x-scpls;audio/x-mpegurl;audio/mpegurl;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/x-wav;application/x-ogg ! Categories=Application;GTK;AudioVideo;Player; Terminal=0 Type=Application + Encoding=UTF-8 |