From: arik d. <ca...@us...> - 2002-04-30 08:16:44
|
CVS Root: /cvsroot/gstreamer Module: gst-player Changes by: cael Date: Tue Apr 30 2002 01:16:43 PDT Log message: heh, thanks thomasvs, forgot to commit these. Added files: libs/gst/player : mediainfo.c mediainfo.h Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-player/libs/gst/player/mediainfo.c?rev=1.1&content-type=text/vnd.viewcvs-markup http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-player/libs/gst/player/mediainfo.h?rev=1.1&content-type=text/vnd.viewcvs-markup ====Begin Diffs==== --- NEW FILE: mediainfo.c --- #include <gnome.h> static char * build_string_for_display (const char *uri) { char *tmp = NULL; gchar **ampersand; tmp = g_strdup_printf ("%s", uri); if (tmp != NULL && strlen (tmp) > 40) { tmp = g_strdup_printf ("%s...", g_strndup (tmp, 40)); } if (tmp != NULL) { ampersand = g_strsplit (tmp, "&", 0); if (ampersand != NULL) { tmp = g_strjoinv ("&", ampersand); } g_strfreev (ampersand); } return tmp; } GtkWidget * mediainfo_new (gchar *uri) { GtkWidget *window; GtkWidget *button; GtkWidget *lcd; GtkWidget *lcd_seek; GdkPixbuf *lcdpixbuf; GnomeCanvasGroup *root; GtkStyle *rcstyle; char *font; char *tmp; GnomeCanvasItem *filename_text; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), " info"); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); lcdpixbuf = gdk_pixbuf_new_from_file ("mediainfo.png", NULL); gtk_widget_push_colormap (gdk_rgb_get_cmap ()); lcd = gnome_canvas_new_aa (); gtk_widget_set_usize (lcd, 291, 139); gnome_canvas_set_center_scroll_region (GNOME_CANVAS (lcd), FALSE); root = gnome_canvas_root (GNOME_CANVAS (lcd)); gnome_canvas_set_pixels_per_unit (GNOME_CANVAS (lcd), 1.0); gnome_canvas_item_new (root, gnome_canvas_rect_get_type (), "x1", 0.0, "y1", 0.0, "x2", 64.0, "y2", 139.0, "fill-color-rgba", GNOME_CANVAS_COLOR_A(171, 221, 161, 255), NULL); gnome_canvas_item_new(root, gnome_canvas_rect_get_type(), "x1", 65.0, "y1", 0.0, "x2", 66.0, "y2", 139.0, "fill-color-rgba", GNOME_CANVAS_COLOR_A (0, 0, 0, 255), NULL); gnome_canvas_item_new (root, gnome_canvas_rect_get_type (), "x1", 66.0, "y1", 0.0, "x2", 291.0, "y2", 139.0, "fill-color", "white", NULL); rcstyle = gtk_rc_get_style (lcd); if (rcstyle == NULL) rcstyle = lcd->style; font = pango_font_description_to_string (rcstyle->font_desc); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "Testing - Testing", "x", 70.0, "y", 22.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "black", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "File Info", "x", 20.0, "y", 55.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "blue", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "Sound", "x", 33.0, "y", 68.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "red", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "Ogg Vorbis Decoder", "x", 68.0, "y", 68.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "black", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "16 Bit Stereo, 44.10 kHz", "x", 68.0, "y", 80.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "black", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "Duration", "x", 20.0, "y", 91.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "red", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "0:00", "x", 68.0, "y", 92.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "black", NULL); gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "Location", "x", 20.0, "y", 103.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_LEFT, "fill_color", "red", NULL); filename_text = gnome_canvas_item_new (root, gnome_canvas_text_get_type (), "text", "", "x", 68.0, "y", 103.0, "font", font, "anchor", GTK_ANCHOR_NW, "justification", GTK_JUSTIFY_CENTER, "fill_color", "black", NULL); gtk_widget_pop_colormap (); tmp = build_string_for_display (uri); gnome_canvas_item_set (filename_text, "markup", tmp, NULL); g_free (tmp); gtk_container_add (GTK_CONTAINER (window), lcd); gtk_widget_show_all (window); return window; } --- NEW FILE: mediainfo.h --- #ifndef __GST_MEDIAINFO_H__ #define __GST_MEDIAINFO_H__ #include <gnome.h> GtkWidget * mediainfo_new (gchar *uri); #endif /* __GST_MEDIAINFO_H__ */ |