changeset 676:1733b12ef974 trunk

[svn] - show dynamic bitrate for vbr is off by default. now it is configurable from preferences.
author yaz
date Mon, 19 Feb 2007 19:39:42 -0800
parents 1ea4cfb007e0
children 5860f8d93fbc
files ChangeLog src/madplug/configure.c src/madplug/decoder.c src/madplug/plugin.c src/madplug/plugin.h
diffstat 5 files changed, 29 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Feb 19 18:53:25 2007 -0800
+++ b/ChangeLog	Mon Feb 19 19:39:42 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-20 02:53:25 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1436]
+  - if genre name is generated from number, it may exceed allocated memory block.
+  
+  trunk/src/madplug/input.c |   11 ++++++++---
+  1 file changed, 8 insertions(+), 3 deletions(-)
+
+
 2007-02-20 02:08:27 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [1434]
   madplug bug fix:
--- a/src/madplug/configure.c	Mon Feb 19 18:53:25 2007 -0800
+++ b/src/madplug/configure.c	Mon Feb 19 19:39:42 2007 -0800
@@ -27,7 +27,7 @@
 
 static GtkWidget *configure_win = NULL;
 static GtkWidget *vbox;
-static GtkWidget *fast_playback, *use_xing, *dither, *sjis;
+static GtkWidget *fast_playback, *use_xing, *dither, *sjis, *show_avg;
 static GtkWidget *RG_enable, *RG_track_mode, *RG_default, *pregain,
     *hard_limit;
 static GtkWidget *title_id3_box, *title_tag_desc;
@@ -49,6 +49,8 @@
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dither));
     audmad_config.sjis =
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sjis));
+    audmad_config.show_avg_vbr_bitrate =
+        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(show_avg));
 
     audmad_config.replaygain.enable =
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(RG_enable));
@@ -96,6 +98,9 @@
     bmp_cfg_db_set_bool(db, "MAD", "title_override", audmad_config.title_override);
     bmp_cfg_db_set_string(db, "MAD", "id3_format", audmad_config.id3_format);
 
+    bmp_cfg_db_set_bool(db, "MAD", "show_avg_vbr_bitrate",
+                            audmad_config.show_avg_vbr_bitrate);
+
     bmp_cfg_db_close(db);
     gtk_widget_destroy(configure_win);
 }
@@ -148,6 +153,12 @@
 
     vbox2 = gtk_vbox_new(FALSE, 5);
 
+    dither = gtk_check_button_new_with_label
+        (_("Dither output when rounding to 16-bit"));
+    gtk_box_pack_start(GTK_BOX(vbox2), dither, TRUE, TRUE, 0);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dither),
+                                 audmad_config.dither);
+
     fast_playback =
         gtk_check_button_new_with_label(_("Enable fast play-length calculation"));
     gtk_box_pack_start(GTK_BOX(vbox2), fast_playback, TRUE, TRUE, 0);
@@ -163,12 +174,10 @@
     gtk_box_pack_start(GTK_BOX(vbox2), sjis, TRUE, TRUE, 0);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sjis), audmad_config.sjis);
 
-    dither =
-        gtk_check_button_new_with_label
-        (_("Dither output when rounding to 16-bit"));
-    gtk_box_pack_start(GTK_BOX(vbox2), dither, TRUE, TRUE, 0);
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dither),
-                                 audmad_config.dither);
+    show_avg = gtk_check_button_new_with_label(_("Display average bitrate for VBR"));
+    gtk_box_pack_start(GTK_BOX(vbox2), show_avg, TRUE, TRUE, 0);
+    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(show_avg),
+                                 audmad_config.show_avg_vbr_bitrate);
 
     gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("General")));
 
--- a/src/madplug/decoder.c	Mon Feb 19 18:53:25 2007 -0800
+++ b/src/madplug/decoder.c	Mon Feb 19 19:39:42 2007 -0800
@@ -515,7 +515,7 @@
 
             info->bitrate = frame.header.bitrate;
 
-            if (info->vbr && (iteration % 40 == 0)) {
+            if (!audmad_config.show_avg_vbr_bitrate && info->vbr && (iteration % 40 == 0)) {
                 mad_plugin->set_info(info->title,
                                      tlen == 0 ? -1 : tlen,
                                      info->bitrate, info->freq, info->channels);
--- a/src/madplug/plugin.c	Mon Feb 19 18:53:25 2007 -0800
+++ b/src/madplug/plugin.c	Mon Feb 19 19:39:42 2007 -0800
@@ -113,6 +113,7 @@
     audmad_config.replaygain.enable = TRUE;
     audmad_config.replaygain.track_mode = FALSE;
     audmad_config.title_override = FALSE;
+    audmad_config.show_avg_vbr_bitrate = TRUE;
 
     db = bmp_cfg_db_open();
     if (db) {
@@ -136,6 +137,8 @@
                             &audmad_config.title_override);
         bmp_cfg_db_get_string(db, "MAD", "id3_format",
                               &audmad_config.id3_format);
+        bmp_cfg_db_get_bool(db, "MAD", "show_avg_vbr_bitrate",
+                            &audmad_config.show_avg_vbr_bitrate);
 
         bmp_cfg_db_close(db);
     }
--- a/src/madplug/plugin.h	Mon Feb 19 18:53:25 2007 -0800
+++ b/src/madplug/plugin.h	Mon Feb 19 19:39:42 2007 -0800
@@ -123,6 +123,7 @@
     } replaygain;
     gboolean title_override;
     gchar *id3_format;
+    gboolean show_avg_vbr_bitrate;
 };
 
 // gcond