[mythtv] [RFC] MythMusic: use libcdio to play & rip CDs (Win32 & MacOSX too)

Lawrence Rust lvr at softsystem.co.uk
Tue Nov 30 16:21:12 UTC 2010


Hi,

I wanted to get MythMusic playing & ripping CDs on Windows so came up
with this patch (64k so too big to attach):
http://www.softsystem.co.uk/download/mythtv/mythmusic-cdio.diff

It provides a new CdDecoder implementation (in cddecoder-cdio.cpp) which
uses the Gnu libcdio library to access the CD.

Libcdio http://www.gnu.org/software/libcdio is a highly portable
replacement for the obsolete cdaudio http://libcdaudio.sourceforge.net
and also provides a portable implementation of cdparanoia.  The library
is available for Linux, Windows, Mac OS X, BSD and many other systems.
This means that Windows and Mac OS users can now play and rip CDs with
MythMusic :-)

The patch also provides a replacement (in cddb.cpp & cddb.h) for
cdaudio's CDDB lookup.  This code was based on cddecoder-darwin.cpp but
is now OS agnostic, using the the Myth httpcomms class and Qt, and adds
local ~/.cddb file access & creation.

Early on I rejected using libcddb http://libcddb.sourceforge.net because
of its contrived interface and also because it is heavily dependent upon
the regex library for which there is no robust implementation available
for mingw.

This CDDB implementation should also close ticket #7857
http://svn.mythtv.org/trac/ticket/7857  - Replace libcdaudio freedb
lookups.  The new Cddb interface provides simple access to all the
fields available from a local file or remote cddb query.

Affected files:

mythplugins/configure
mythplugins/mythmusic/mythmusic/mythmusic.pro
mythplugins/mythmusic/mythmusic/playbackbox.cpp
mythplugins/mythmusic/mythmusic/cddecoder.h
mythplugins/mythmusic/mythmusic/cddecoder.cpp
+ mythplugins/mythmusic/mythmusic/cddecoder-cdio.cpp
+ mythplugins/mythmusic/mythmusic/cddb.cpp
+ mythplugins/mythmusic/mythmusic/cddb.h
mythplugins/mythmusic/mythmusic/cdrip.cpp
mythplugins/mythmusic/mythmusic/decoder.cpp
mythplugins/mythmusic/mythmusic/databasebox.cpp
mythplugins/mythmusic/mythmusic/main.cpp
mythplugins/mythmusic/mythmusic/musiccommon.cpp

Comments please...

################################################################
Build info....

libcdio is installed by default on many Linux distributions and the
development headers are available on Debian/Ubuntu by:

sudo apt-get install libcdio10 libcdio-dev

If not, build from source:

wget ftp://mirror.cict.fr/gnu/libcdio/libcdio-0.82.tar.gz
tar -zxf libcdio-0.82.tar.gz && cd libcdio-0.82
./configure && make
sudo make install

################################################################

To build MythMusic with the new code, checkout 0.24-fixes or trunk and
then:

cd mythplugins
patch -p1 < ../mythmusic-cdio.diff

NB with this patch applied and a standard ./configure the cdio code is
not compiled and the current, minimally changed, code is built.  The
--enable-cdio option must be supplied to ./configure to enable it.  If
all is OK ./configure will announce "libcdio support will be included in
MythMusic"

./configure [your options] --enable-cdio
make && make install

################################################################

To build libcdio for Mac OS X see http://libcdio.darwinports.com
You may also have to edit mythmusic.pro but I haven't been able to try
this.  Feedback appreciated.

################################################################

To cross-compile libcdio with mingw see
http://www.softsystem.co.uk/mythtv and then:

cd [mingw build folder]
export DIR=$PWD
wget http://www.softsystem.co.uk/download/mythtv/libcdio-0.82.diff
wget ftp://mirror.cict.fr/gnu/libcdio/libcdio-0.82.tar.gz
tar -zxf libcdio-0.82.tar.gz && cd libcdio-0.82

# Fix for no S_ISLNK && S_ISSOCK in mingw...
patch -p1 < ../libcdio-0.82.diff

PKG_CONFIG_PATH=$DIR/lib/pkgconfig ./configure --prefix=$DIR \
--host=i586-mingw32msvc --build=i686-pc-linux-gnu --disable-joliet

make && make install && $DIR/mkinstall.sh

-- Lawrence Rust




More information about the mythtv-dev mailing list