changeset 908:9bc585cc3c65 trunk

[svn] Report mode from mpg123. Patch by spike, closes bug #457.
author chainsaw
date Fri, 31 Mar 2006 12:38:59 -0800
parents be9f514458b6
children 46960fb15ba0
files Plugins/Input/mpg123/fileinfo.c
diffstat 1 files changed, 30 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/mpg123/fileinfo.c	Fri Mar 31 11:10:09 2006 -0800
+++ b/Plugins/Input/mpg123/fileinfo.c	Fri Mar 31 12:38:59 2006 -0800
@@ -58,7 +58,7 @@
     *mpeg_filesize;
 static GtkWidget *mpeg_level_val, *mpeg_bitrate_val, *mpeg_samplerate_val,
     *mpeg_error_val, *mpeg_copy_val, *mpeg_orig_val, *mpeg_emph_val,
-    *mpeg_frames_val, *mpeg_filesize_val;
+    *mpeg_frames_val, *mpeg_filesize_val, *mpeg_flags_val;
 
 GtkWidget *vbox, *hbox, *left_vbox, *table;
 GtkWidget *mpeg_frame, *mpeg_box;
@@ -648,7 +648,7 @@
         GdkPixbuf *pixbuf;
         PangoAttrList *attrs;
         PangoAttribute *attr;
-        GtkWidget *test_table = gtk_table_new(2, 10, FALSE);
+        GtkWidget *test_table = gtk_table_new(2, 11, FALSE);
         GtkWidget *urk, *blark;
 #ifdef HAVE_ID3LIB
 	GtkWidget * tracknum_box, * comment_frame;
@@ -785,66 +785,79 @@
         gtk_table_attach(GTK_TABLE(test_table), mpeg_filesize_val, 1, 2, 4,
                          5, GTK_FILL, GTK_FILL, 10, 2);
 
+        mpeg_flags = gtk_label_new(_("Mode:"));
+        gtk_misc_set_alignment(GTK_MISC(mpeg_flags), 1, 0.5);
+        gtk_label_set_justify(GTK_LABEL(mpeg_flags), GTK_JUSTIFY_RIGHT);
+        gtk_label_set_attributes(GTK_LABEL(mpeg_flags), attrs);
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_flags, 0, 1, 5, 6,
+                         GTK_FILL, GTK_FILL, 5, 2);
+
+        mpeg_flags_val = gtk_label_new("");
+        gtk_misc_set_alignment(GTK_MISC(mpeg_flags_val), 0, 0);
+        gtk_label_set_justify(GTK_LABEL(mpeg_flags_val), GTK_JUSTIFY_LEFT);
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_flags_val, 1, 2, 5,
+                         6, GTK_FILL, GTK_FILL, 10, 2);
+
         urk = gtk_label_new("");
         blark = gtk_label_new("");
         gtk_misc_set_alignment(GTK_MISC(urk), 1, 0.5);
         gtk_misc_set_alignment(GTK_MISC(blark), 0, 0);
 
-        gtk_table_attach(GTK_TABLE(test_table), urk, 0, 1, 5, 6, GTK_FILL,
+        gtk_table_attach(GTK_TABLE(test_table), urk, 0, 1, 6, 7, GTK_FILL,
                          GTK_FILL, 5, 5);
-        gtk_table_attach(GTK_TABLE(test_table), blark, 1, 2, 5, 6,
+        gtk_table_attach(GTK_TABLE(test_table), blark, 1, 2, 6, 7,
                          GTK_FILL, GTK_FILL, 10, 5);
 
         mpeg_error = gtk_label_new(_("Error Protection:"));
         gtk_misc_set_alignment(GTK_MISC(mpeg_error), 1, 0.5);
         gtk_label_set_justify(GTK_LABEL(mpeg_error), GTK_JUSTIFY_RIGHT);
         gtk_label_set_attributes(GTK_LABEL(mpeg_error), attrs);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_error, 0, 1, 6, 7,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_error, 0, 1, 7, 8,
                          GTK_FILL, GTK_FILL, 5, 0);
 
         mpeg_error_val = gtk_label_new("");
         gtk_misc_set_alignment(GTK_MISC(mpeg_error_val), 0, 0);
         gtk_label_set_justify(GTK_LABEL(mpeg_error_val), GTK_JUSTIFY_LEFT);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_error_val, 1, 2, 6, 7,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_error_val, 1, 2, 7, 8,
                          GTK_FILL, GTK_FILL, 10, 2);
 
         mpeg_copy = gtk_label_new(_("Copyright:"));
         gtk_misc_set_alignment(GTK_MISC(mpeg_copy), 1, 0.5);
         gtk_label_set_justify(GTK_LABEL(mpeg_copy), GTK_JUSTIFY_RIGHT);
         gtk_label_set_attributes(GTK_LABEL(mpeg_copy), attrs);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_copy, 0, 1, 7, 8,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_copy, 0, 1, 8, 9,
                          GTK_FILL, GTK_FILL, 5, 2);
 
         mpeg_copy_val = gtk_label_new("");
         gtk_misc_set_alignment(GTK_MISC(mpeg_copy_val), 0, 0);
         gtk_label_set_justify(GTK_LABEL(mpeg_copy_val), GTK_JUSTIFY_LEFT);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_copy_val, 1, 2, 7, 8,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_copy_val, 1, 2, 8, 9,
                          GTK_FILL, GTK_FILL, 10, 2);
 
         mpeg_orig = gtk_label_new(_("Original:"));
         gtk_misc_set_alignment(GTK_MISC(mpeg_orig), 1, 0.5);
         gtk_label_set_justify(GTK_LABEL(mpeg_orig), GTK_JUSTIFY_RIGHT);
         gtk_label_set_attributes(GTK_LABEL(mpeg_orig), attrs);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_orig, 0, 1, 8, 9,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_orig, 0, 1, 9, 10,
                          GTK_FILL, GTK_FILL, 5, 2);
 
         mpeg_orig_val = gtk_label_new("");
         gtk_misc_set_alignment(GTK_MISC(mpeg_orig_val), 0, 0);
         gtk_label_set_justify(GTK_LABEL(mpeg_orig_val), GTK_JUSTIFY_LEFT);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_orig_val, 1, 2, 8, 9,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_orig_val, 1, 2, 9, 10,
                          GTK_FILL, GTK_FILL, 10, 2);
 
         mpeg_emph = gtk_label_new(_("Emphasis:"));
         gtk_misc_set_alignment(GTK_MISC(mpeg_emph), 1, 0.5);
         gtk_label_set_justify(GTK_LABEL(mpeg_emph), GTK_JUSTIFY_RIGHT);
         gtk_label_set_attributes(GTK_LABEL(mpeg_emph), attrs);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_emph, 0, 1, 9, 10,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_emph, 0, 1, 10, 11,
                          GTK_FILL, GTK_FILL, 5, 2);
 
         mpeg_emph_val = gtk_label_new("");
         gtk_misc_set_alignment(GTK_MISC(mpeg_emph_val), 0, 0);
         gtk_label_set_justify(GTK_LABEL(mpeg_emph_val), GTK_JUSTIFY_LEFT);
-        gtk_table_attach(GTK_TABLE(test_table), mpeg_emph_val, 1, 2, 9, 10,
+        gtk_table_attach(GTK_TABLE(test_table), mpeg_emph_val, 1, 2, 10, 11,
                          GTK_FILL, GTK_FILL, 10, 2);
 
 
@@ -1146,6 +1159,9 @@
     gtk_label_set_text(GTK_LABEL(mpeg_filesize), _("File size:"));
     gtk_label_set_text(GTK_LABEL(mpeg_filesize_val), _("N/A"));
 
+    gtk_label_set_text(GTK_LABEL(mpeg_flags), _("Mode:"));
+    gtk_label_set_text(GTK_LABEL(mpeg_flags_val), _("N/A"));
+
     if (str_has_prefix_nocase(filename, "http://")) {
         file_info_http(filename);
         return;
@@ -1268,6 +1284,7 @@
       label_set_text(mpeg_emph_val, _("%s"), emphasis[frm.emphasis]);
       label_set_text(mpeg_frames_val, _("%d"), num_frames);
       label_set_text(mpeg_filesize_val, _("%lu Bytes"), vfs_ftell(fh));
+      label_set_text(mpeg_flags_val, _("%s"), channel_mode_name(frm.mode));
       g_free(buf);
     }
     vfs_fclose(fh);
@@ -1389,6 +1406,7 @@
             label_set_text(mpeg_emph_val, _("%s"), emphasis[frm.emphasis]);
             label_set_text(mpeg_frames_val, _("%d"), num_frames);
             label_set_text(mpeg_filesize_val, _("%lu Bytes"), vfs_ftell(fh));
+            label_set_text(mpeg_flags_val, _("%s"), channel_mode_name(frm.mode));
             g_free(buf);
         }
         vfs_fclose(fh);