Index: configure =================================================================== --- configure (revision 16031) +++ configure (working copy) @@ -32,6 +32,7 @@ fftw_lib3="yes" sdl="yes" aac="no" # compile fails w/libfaad v2.0 +mp3lame="yes" exif="yes" newexif="yes" festival="no" # no config detection/setup routine @@ -92,6 +93,7 @@ --enable-fftw enable fftw visualizers [$fftw_lib] --enable-sdl use SDL for the synaesthesia output [$sdl] --enable-aac enable AAC/MP4 audio file decompression [$aac] + --enable-libmp3lame enable MP3 encoding support using LAME [$mp3lame] MythNews related options: --enable-mythnews build the mythnews plugin [$news] @@ -239,6 +241,10 @@ ;; --disable-aac) aac="no" ;; + --enable-libmp3lame) mp3lame="yes" + ;; + --disable-libmp3lame) mp3lame="no" + ;; --enable-exif) exif="yes" ;; --enable-new-exif) newexif="yes" @@ -269,6 +275,7 @@ visual="yes"; fftw_lib="yes"; aac="yes"; + mp3lame="yes"; exif="yes"; festival="yes"; archive="yes"; @@ -293,6 +300,7 @@ visual="no"; fftw_lib="no"; aac="no"; + mp3lame="no"; exif="no"; festival="no"; archive="no"; @@ -477,11 +485,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" @@ -498,7 +506,7 @@ fi fi - if test "$mad" = "no" -o "$vorbis" = "no" -o "$flac" = "no" -o "$mp3lame" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then + if test "$mad" = "no" -o "$vorbis" = "no" -o "$flac" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then echo "Disabling MythMusic due to missing dependencies." music="no" fi @@ -802,6 +810,18 @@ if test "$exif" = "no" ; then echo " EXIF support will not be included in MythGallery" 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 16031) +++ mythmusic/mythmusic/mythmusic.pro (working copy) @@ -20,7 +20,7 @@ INSTALLS += installfiles uifiles -LIBS += -lmad -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC -lmp3lame +LIBS += -lmad -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC cdaudio: LIBS += -lcdaudio paranoia:LIBS += -lcdda_paranoia -lcdda_interface @@ -31,7 +31,7 @@ HEADERS += metadata.h playbackbox.h playlist.h polygon.h HEADERS += streaminput.h synaesthesia.h encoder.h visualize.h avfdecoder.h HEADERS += treecheckitem.h vorbisdecoder.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 vcedit.h metaiooggvorbiscomment.h HEADERS += metaioflacvorbiscomment.h metaioavfcomment.h HEADERS += goom/filters.h goom/goomconfig.h goom/goom_core.h goom/graphic.h @@ -45,7 +45,7 @@ SOURCES += flacdecoder.cpp flacencoder.cpp maddecoder.cpp main.cpp SOURCES += mainvisual.cpp metadata.cpp playbackbox.cpp playlist.cpp SOURCES += streaminput.cpp encoder.cpp dbcheck.cpp -SOURCES += synaesthesia.cpp treecheckitem.cpp vorbisdecoder.cpp lameencoder.cpp +SOURCES += synaesthesia.cpp treecheckitem.cpp vorbisdecoder.cpp SOURCES += vorbisencoder.cpp visualize.cpp bumpscope.cpp globalsettings.cpp SOURCES += databasebox.cpp genres.cpp SOURCES += metaio.cpp metaiotaglib.cpp vcedit.c metaiooggvorbiscomment.cpp Index: mythmusic/mythmusic/globalsettings.cpp =================================================================== --- mythmusic/mythmusic/globalsettings.cpp (revision 16031) +++ mythmusic/mythmusic/globalsettings.cpp (working copy) @@ -20,6 +20,7 @@ // mythmusic #include "globalsettings.h" +#include "config.h" #include "mainvisual.h" // General Settings @@ -174,7 +175,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.")); @@ -193,6 +196,7 @@ return gc; }; +#ifdef LAME static HostCheckBox *Mp3UseVBR() { HostCheckBox *gc = new HostCheckBox("Mp3UseVBR"); @@ -203,6 +207,7 @@ "The Ogg encoder will always use variable bitrates.")); return gc; }; +#endif static HostLineEdit *FilenameTemplate() { @@ -696,7 +701,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 16031) +++ mythmusic/mythmusic/cdrip.cpp (working copy) @@ -37,11 +37,14 @@ #include <mythtv/mythmediamonitor.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" @@ -172,7 +175,9 @@ QString textstatus; QString encodertype = gContext->GetSetting("EncoderType"); +#ifdef LAME bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0); +#endif m_totalSectors = 0; m_totalSectorsDone = 0; @@ -228,6 +233,7 @@ if (m_quality < 3) { +#ifdef LAME if (encodertype == "mp3") { outfile += ".mp3"; @@ -235,6 +241,7 @@ titleTrack, mp3usevbr)); } else // ogg +#endif { outfile += ".ogg"; encoder.reset(new VorbisEncoder(outfile, m_quality, Index: settings.pro =================================================================== --- settings.pro (revision 16031) +++ settings.pro (working copy) @@ -59,7 +59,7 @@ } QMAKE_LIBDIR_X11 = -EXTRA_LIBS = -lfreetype -lmp3lame +EXTRA_LIBS = -lfreetype EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS EXTRA_LIBS += $$CONFIG_AUDIO_ARTS_LIBS EXTRA_LIBS += $$CONFIG_AUDIO_JACK_LIBS