Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > contrib-updates-src > by-pkgid > 1f83167268cb6fd8ae85431d1c94c1b7 > files > 2

mythplugins-0.23-26732.1mdv2010.1.src.rpm

Index: configure
===================================================================
--- configure	(revision 24335)
+++ configure	(working copy)
@@ -32,6 +32,7 @@
 fftw_lib="yes"
 fftw_lib3="yes"
 sdl="yes"
+mp3lame="yes"
 exif="yes"
 newexif="yes"
 festival="no"     # no config detection/setup routine
@@ -74,6 +75,7 @@
   --enable-libvisual       enable libvisual visualizers [$visual]
   --enable-fftw            enable fftw visualizers [$fftw_lib]
   --enable-sdl             use SDL for the synaesthesia output [$sdl]
+  --enable-libmp3lame      enable MP3 encoding support using LAME [$mp3lame]
 
 MythNews related options:
   --enable-mythnews        build the mythnews plugin [$news]
@@ -198,6 +200,10 @@
   ;;
   --disable-sdl) sdl="no"
   ;;
+  --enable-libmp3lame) mp3lame="yes"
+  ;;
+  --disable-libmp3lame) mp3lame="no"
+  ;;
   --enable-exif) exif="yes"
   ;;
   --enable-new-exif)  newexif="yes"
@@ -227,6 +233,7 @@
                  visual="yes";
                  fftw_lib="yes";
                  fftw_lib3="yes";
+                 mp3lame="yes";
                  exif="yes";
                  festival="yes";
                  archive="yes";
@@ -247,6 +254,7 @@
                  visual="no";
                  fftw_lib="no";
                  fftw_lib3="no";
+                 mp3lame="no";
                  exif="no";
                  festival="no";
                  archive="no";
@@ -424,11 +432,11 @@
         echo "MythMusic requires CDDA Paranoia."
     fi
 
-    mp3lame="no"
-    if has_header lame/lame.h && has_library libmp3lame ; then
-        mp3lame="yes"
-    else
-        echo "MythMusic requires the LAME mp3 encoder."
+    if test "$mp3lame" != "no" ; then
+        mp3lame="no"
+        if has_header lame/lame.h && has_library libmp3lame ; then
+            mp3lame="yes"
+        fi
     fi
 
     taglib="no"
@@ -452,7 +460,7 @@
         fi
     fi
 
-    if test "$vorbis" = "no" -o "$flac" = "no" -o "$mp3lame" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then
+    if test "$vorbis" = "no" -o "$flac" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then
         echo "Disabling MythMusic due to missing dependencies."
         music="no"
     fi
@@ -733,6 +741,18 @@
     if test "$taglib" = "yes" ; then
         echo "INCLUDEPATH += `taglib-config --prefix`/include/taglib" >> ./mythmusic/mythmusic/config.pro
     fi
+
+    if test "$mp3lame" = "yes" ; then
+        echo "        MP3 encoding   support will be included in MythMusic"
+        echo "#define LAME 1" >> ./mythmusic/mythmusic/config.h
+        echo "LIBS += -lmp3lame" >> ./mythmusic/mythmusic/config.pro
+        echo "HEADERS += lameencoder.h" >> ./mythmusic/mythmusic/config.pro
+        echo "SOURCES += lameencoder.cpp" >> ./mythmusic/mythmusic/config.pro
+    fi
+
+    if test "$mp3lame" = "no" ; then
+        echo "        MP3 encoding   support will not be included in MythMusic"
+    fi
 fi
 
 ###########################################################
Index: mythmusic/mythmusic/mythmusic.pro
===================================================================
--- mythmusic/mythmusic/mythmusic.pro	(revision 24335)
+++ mythmusic/mythmusic/mythmusic.pro	(working copy)
@@ -18,7 +18,7 @@
 
 LIBS += -lmythavcodec-$$LIBVERSION -lmythavutil-$$LIBVERSION
 LIBS += -lmythavformat-$$LIBVERSION
-LIBS += -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC -lmp3lame
+LIBS += -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC
 
 cdaudio: LIBS += -lcdaudio
 paranoia:LIBS += -lcdda_paranoia -lcdda_interface
@@ -29,7 +29,7 @@
 HEADERS += metadata.h playbackbox.h playlist.h polygon.h
 HEADERS += streaminput.h synaesthesia.h encoder.h visualize.h avfdecoder.h
 HEADERS += treecheckitem.h vorbisencoder.h polygon.h
-HEADERS += bumpscope.h globalsettings.h lameencoder.h dbcheck.h
+HEADERS += bumpscope.h globalsettings.h dbcheck.h
 HEADERS += metaio.h metaiotaglib.h
 HEADERS += metaioflacvorbis.h metaioavfcomment.h metaiomp4.h
 HEADERS += metaiowavpack.h metaioid3.h metaiooggvorbis.h
@@ -46,7 +46,7 @@
 SOURCES += flacencoder.cpp main.cpp
 SOURCES += mainvisual.cpp metadata.cpp playbackbox.cpp playlist.cpp
 SOURCES += streaminput.cpp encoder.cpp dbcheck.cpp
-SOURCES += synaesthesia.cpp treecheckitem.cpp lameencoder.cpp
+SOURCES += synaesthesia.cpp treecheckitem.cpp
 SOURCES += vorbisencoder.cpp visualize.cpp bumpscope.cpp globalsettings.cpp
 SOURCES += databasebox.cpp genres.cpp
 SOURCES += metaio.cpp metaiotaglib.cpp
Index: mythmusic/mythmusic/globalsettings.cpp
===================================================================
--- mythmusic/mythmusic/globalsettings.cpp	(revision 24335)
+++ mythmusic/mythmusic/globalsettings.cpp	(working copy)
@@ -28,6 +28,7 @@
 
 // mythmusic
 #include "globalsettings.h"
+#include "config.h"
 #include "mainvisual.h"
 #include "mythlistview-qt3.h"
 
@@ -185,7 +186,9 @@
     HostComboBox *gc = new HostComboBox("EncoderType");
     gc->setLabel(QObject::tr("Encoding"));
     gc->addSelection(QObject::tr("Ogg Vorbis"), "ogg");
+#ifdef LAME
     gc->addSelection(QObject::tr("Lame (MP3)"), "mp3");
+#endif
     gc->setHelpText(QObject::tr("Audio encoder to use for CD ripping. "
                     "Note that the quality level 'Perfect' will use the "
 		                "FLAC encoder."));
@@ -204,6 +207,7 @@
     return gc;
 };
 
+#ifdef LAME
 static HostCheckBox *Mp3UseVBR()
 {
     HostCheckBox *gc = new HostCheckBox("Mp3UseVBR");
@@ -214,6 +218,7 @@
                     "The Ogg encoder will always use variable bitrates."));
     return gc;
 };
+#endif
 
 static HostLineEdit *FilenameTemplate()
 {
@@ -649,7 +654,9 @@
     encodersettings->setLabel(QObject::tr("CD Ripper Settings (part 2)"));
     encodersettings->addChild(EncoderType());
     encodersettings->addChild(DefaultRipQuality());
+#ifdef LAME
     encodersettings->addChild(Mp3UseVBR());
+#endif
     addChild(encodersettings);
 }
 
Index: mythmusic/mythmusic/cdrip.cpp
===================================================================
--- mythmusic/mythmusic/cdrip.cpp	(revision 24335)
+++ mythmusic/mythmusic/cdrip.cpp	(working copy)
@@ -45,11 +45,14 @@
 #include <mythuibuttonlist.h>
 
 // MythMusic includes
+#include "config.h"
 #include "cdrip.h"
 #include "cddecoder.h"
 #include "encoder.h"
 #include "vorbisencoder.h"
+#ifdef LAME
 #include "lameencoder.h"
+#endif
 #include "flacencoder.h"
 #include "genres.h"
 #include "editmetadata.h"
@@ -193,7 +196,9 @@
 
     QString textstatus;
     QString encodertype = gContext->GetSetting("EncoderType");
+#ifdef LAME
     bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0);
+#endif
 
     m_totalSectors = 0;
     m_totalSectorsDone = 0;
@@ -260,6 +265,7 @@
 
                 if (m_quality < 3)
                 {
+#ifdef LAME
                     if (encodertype == "mp3")
                     {
                         outfile += ".mp3";
@@ -267,6 +273,7 @@
                                                       titleTrack, mp3usevbr));
                     }
                     else // ogg
+#endif
                     {
                         outfile += ".ogg";
                         encoder.reset(new VorbisEncoder(outfile, m_quality,
Index: settings.pro
===================================================================
--- settings.pro	(revision 24335)
+++ settings.pro	(working copy)
@@ -60,7 +60,7 @@
 }
 QMAKE_LIBDIR_X11 = 
 
-EXTRA_LIBS += -lfreetype -lmp3lame
+EXTRA_LIBS += -lfreetype
 EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS
 EXTRA_LIBS += $$CONFIG_AUDIO_JACK_LIBS
 EXTRA_LIBS += $$CONFIG_FIREWIRE_LIBS