[mythtv] [PATCH] mythmusic: adds the lame VBR checkbox setting

Stefan Frank sfr+lists at 6913304088794.gnuu.de
Sun Jan 25 17:07:11 EST 2004


Hi,

this patch finishes the variable bitrate support for lame.

ciao, Stefan

-------------- next part --------------
--- mythmusic/mythmusic/cdrip.cpp	2004-01-07 19:36:03.000000000 +0100
+++ mythmusic-local/mythmusic/cdrip.cpp	2004-01-25 22:12:06.000000000 +0100
@@ -432,6 +432,7 @@
     QString cddevice = gContext->GetSetting("CDDevice");
     QString encodertype = gContext->GetSetting("EncoderType");
     int encodequal = qualitygroup->id(qualitygroup->selected());
+    bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0);
 
     CdDecoder *decoder = new CdDecoder("cda", NULL, NULL, NULL);
 
@@ -477,7 +478,8 @@
                 if (encodertype == "mp3")
                 {
                     outfile += ".mp3";
-                    encoder = new LameEncoder(outfile, encodequal, track);
+                    encoder = new LameEncoder(outfile, encodequal, track, 
+                                              mp3usevbr);
                 }
                 else // ogg
                 {
--- mythmusic/mythmusic/globalsettings.cpp	2004-01-25 19:51:39.000000000 +0100
+++ mythmusic-local/mythmusic/globalsettings.cpp	2004-01-25 22:42:57.000000000 +0100
@@ -155,6 +155,8 @@
     };
 };
 
+// Encoder settings
+
 class EncoderType: public ComboBoxSetting, public GlobalSetting {
 public:
     EncoderType():
@@ -168,6 +170,31 @@
     };
 };
 
+class DefaultRipQuality: public ComboBoxSetting, public GlobalSetting {
+public:
+    DefaultRipQuality():
+        GlobalSetting("DefaultRipQuality") {
+        setLabel(QObject::tr("Default Rip Quality"));
+        addSelection(QObject::tr("Low"), "0");
+        addSelection(QObject::tr("Medium"), "1");
+        addSelection(QObject::tr("High"), "2");
+        addSelection(QObject::tr("Perfect"), "3");
+        setHelpText(QObject::tr("Default quality for new CD rips."));
+    };
+};
+
+class Mp3UseVBR: public CheckBoxSetting, public GlobalSetting {
+public:
+    Mp3UseVBR():
+        GlobalSetting("Mp3UseVBR") {
+        setLabel(QObject::tr("Use variable bitrates"));
+        setValue(false);
+        setHelpText(QObject::tr("If set, the MP3 encoder will use variable "
+                    "bitrates (VBR) except for the low quality setting. "
+                    "The Ogg encoder will always use variable bitrates."));
+    };
+};
+
 class FilenameTemplate: public LineEditSetting, public GlobalSetting {
 public:
     FilenameTemplate():
@@ -402,19 +429,6 @@
     };
 };
 
-class DefaultRipQuality: public ComboBoxSetting, public GlobalSetting {
-public:
-    DefaultRipQuality():
-        GlobalSetting("DefaultRipQuality") {
-        setLabel(QObject::tr("Default Rip Quality"));
-        addSelection(QObject::tr("Low"), "0");
-        addSelection(QObject::tr("Medium"), "1");
-        addSelection(QObject::tr("High"), "2");
-        addSelection(QObject::tr("Perfect"), "3");
-        setHelpText(QObject::tr("Default quality for new CD rips."));
-    };
-};
-
 MusicGeneralSettings::MusicGeneralSettings()
 {
     VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
@@ -458,8 +472,6 @@
 {
     VerticalConfigurationGroup* rippersettings = new VerticalConfigurationGroup(false);
     rippersettings->setLabel(QObject::tr("CD Ripper Settings"));
-    rippersettings->addChild(new EncoderType());
-    rippersettings->addChild(new DefaultRipQuality());
     rippersettings->addChild(new ParanoiaLevel());
     rippersettings->addChild(new FilenameTemplate());
     rippersettings->addChild(new TagSeparator());
@@ -467,4 +479,12 @@
     rippersettings->addChild(new PostCDRipScript());
     rippersettings->addChild(new EjectCD());
     addChild(rippersettings);
+
+    VerticalConfigurationGroup* encodersettings = new VerticalConfigurationGroup(false);
+    encodersettings->setLabel(QObject::tr("CD Ripper Settings (part 2)"));
+    encodersettings->addChild(new EncoderType());
+    encodersettings->addChild(new DefaultRipQuality());
+    encodersettings->addChild(new Mp3UseVBR());
+    addChild(encodersettings);
 }
+


More information about the mythtv-dev mailing list