Hello everyone, I am a regular on the Linux from Scratch mailing lists, and someone named Michael Uleysky sent a patch to make kdemultimedia use libcdio instead of cdparanoia (because they provide equivalent functionality). The patch is attached. However, I would like some improvements to be done. I want kdemultimedia to use either libcdio or cdparanoia, depending on which one exists, and on user preference. I don't know CMake enough to do that, but if anyone would like to do that task, it would be much appreciated. The patch is in LFS format, apply with -Np1. -- William Immendorf The ultimate in free computing. Messages in plain text, please, no HTML. GPG key ID: 1697BE98 If it's not signed, it's not from me. -- "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman -- Are you a Gmail user? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?31450.
diff -urNd kdemultimedia-4.6.4/cmake/modules/FindCdparanoia.cmake kdemultimedia-4.6.4-libcdio/cmake/modules/FindCdparanoia.cmake --- kdemultimedia-4.6.4/cmake/modules/FindCdparanoia.cmake 2011-01-20 08:22:40.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/cmake/modules/FindCdparanoia.cmake 2011-06-19 13:49:10.611760816 +1100 @@ -17,20 +17,31 @@ SET(CDPARANOIA_FOUND TRUE) else (CDPARANOIA_INCLUDE_DIR AND CDPARANOIA_LIBRARIES) + IF (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + FIND_PACKAGE(PkgConfig) + PKG_CHECK_MODULES(PC_CDPARANOIA QUIET libcdio_paranoia) + SET(CDPARANOIA_DEFINITIONS ${PC_CDPARANOIA_CFLAGS_OTHER}) + ENDIF (NOT WIN32) - FIND_PATH(CDPARANOIA_INCLUDE_DIR cdda_interface.h PATH_SUFFIXES cdda cdparanoia) - - FIND_LIBRARY(CDPARANOIA_LIBRARY NAMES cdda_paranoia) - FIND_LIBRARY(CDPARANOIA_IF_LIBRARY NAMES cdda_interface) - - IF (CDPARANOIA_LIBRARY AND CDPARANOIA_IF_LIBRARY) - SET(CDPARANOIA_LIBRARIES ${CDPARANOIA_LIBRARY} ${CDPARANOIA_IF_LIBRARY} "-lm") - ENDIF (CDPARANOIA_LIBRARY AND CDPARANOIA_IF_LIBRARY) + FIND_PATH(CDPARANOIA_INCLUDE_DIR paranoia.h + HINTS + ${PC_CDPARANOIA_INCLUDEDIR} + ${PC_CDPARANOIA_INCLUDE_DIRS} + PATH_SUFFIXES cdio + ) + + FIND_LIBRARY(CDPARANOIA_LIBRARIES NAMES cdio_paranoia libcdio_paranoia + HINTS + ${PC_CDPARANOIA_LIBDIR} + ${PC_CDPARANOIA_LIBRARY_DIRS} + ) INCLUDE(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cdparanoia DEFAULT_MSG + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libcdio DEFAULT_MSG CDPARANOIA_LIBRARIES CDPARANOIA_INCLUDE_DIR) - MARK_AS_ADVANCED(CDPARANOIA_INCLUDE_DIR CDPARANOIA_LIBRARY CDPARANOIA_IF_LIBRARY) + MARK_AS_ADVANCED(CDPARANOIA_INCLUDE_DIR) endif (CDPARANOIA_INCLUDE_DIR AND CDPARANOIA_LIBRARIES) diff -urNd kdemultimedia-4.6.4/kioslave/audiocd/audiocd.cpp kdemultimedia-4.6.4-libcdio/kioslave/audiocd/audiocd.cpp --- kdemultimedia-4.6.4/kioslave/audiocd/audiocd.cpp 2011-01-20 08:23:34.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/kioslave/audiocd/audiocd.cpp 2011-06-19 13:42:24.296182196 +1100 @@ -28,12 +28,8 @@ #include <kdemacros.h> extern "C" { - //cdda_interface.h in cdparanoia 10.2 has a member called 'private' which the C++ compiler doesn't like - #define private _private - #include <cdda_interface.h> - #include <cdda_paranoia.h> - #undef private - void paranoiaCallback(long, int); + #include <paranoia.h> + void paranoiaCallback(long, paranoia_cb_mode_t); KDE_EXPORT int kdemain(int argc, char ** argv); } @@ -116,24 +112,22 @@ cddbUserChoice = -1; } - bool tocsAreDifferent(struct cdrom_drive *drive) + bool tocsAreDifferent(cdrom_drive *drive) { if (tracks != (uint)drive->tracks) return true; for (int i = 0; i < drive->tracks; ++i) { if (disc_toc[i].dwStartSector != drive->disc_toc[i].dwStartSector || - disc_toc[i].bFlags != drive->disc_toc[i].bFlags || disc_toc[i].bTrack != drive->disc_toc[i].bTrack) return true; } return false; } - void setToc(struct cdrom_drive *drive) + void setToc(cdrom_drive *drive) { for (int i = 0; i < drive->tracks; ++i) { disc_toc[i].dwStartSector = drive->disc_toc[i].dwStartSector; - disc_toc[i].bFlags = drive->disc_toc[i].bFlags; disc_toc[i].bTrack = drive->disc_toc[i].bTrack; } } @@ -218,7 +212,7 @@ return encoderFromExtension(filename.right(len - pos)); } -static void setDeviceToCd(KCompactDisc *cd, struct cdrom_drive *drive) +static void setDeviceToCd(KCompactDisc *cd, cdrom_drive *drive) { #if defined(HAVE_CDDA_IOCTL_DEVICE) cd->setDevice(QLatin1String( drive->ioctl_device_name ), 50, false); @@ -264,7 +258,7 @@ #endif } -struct cdrom_drive * AudioCDProtocol::initRequest(const KUrl & url) +cdrom_drive * AudioCDProtocol::initRequest(const KUrl & url) { if (url.hasHost()) { @@ -279,7 +273,7 @@ // Then url parameters can overrule our settings. parseURLArgs(url); - struct cdrom_drive * drive = getDrive(); + cdrom_drive * drive = getDrive(); if (0 == drive) return 0; @@ -426,7 +420,7 @@ return drive; } -bool AudioCDProtocol::getSectorsForRequest(struct cdrom_drive * drive, long & firstSector, long & lastSector) const +bool AudioCDProtocol::getSectorsForRequest(cdrom_drive * drive, long & firstSector, long & lastSector) const { if (d->req_allTracks) { // we rip all the tracks of the CD @@ -447,7 +441,7 @@ void AudioCDProtocol::get(const KUrl & url) { - struct cdrom_drive * drive = initRequest(url); + cdrom_drive * drive = initRequest(url); if (!drive) return; @@ -534,7 +528,7 @@ void AudioCDProtocol::stat(const KUrl & url) { - struct cdrom_drive * drive = initRequest(url); + cdrom_drive * drive = initRequest(url); if (!drive) return; @@ -609,7 +603,7 @@ void AudioCDProtocol::listDir(const KUrl & url) { - struct cdrom_drive * drive = initRequest(url); + cdrom_drive * drive = initRequest(url); // Some error checking before proceeding if (!drive) @@ -726,7 +720,7 @@ finished(); } -void AudioCDProtocol::addEntry(const QString& trackTitle, AudioCDEncoder *encoder, struct cdrom_drive * drive, int trackNo) +void AudioCDProtocol::addEntry(const QString& trackTitle, AudioCDEncoder *encoder, cdrom_drive * drive, int trackNo) { if(!encoder || !drive) return; @@ -760,11 +754,11 @@ return encoder->size(length_seconds); } -struct cdrom_drive *AudioCDProtocol::getDrive() +cdrom_drive *AudioCDProtocol::getDrive() { const QByteArray device(QFile::encodeName(d->device)); - struct cdrom_drive * drive = 0; + cdrom_drive * drive = 0; if (!device.isEmpty() && device != "/" ) drive = cdda_identify(device, CDDA_MESSAGE_PRINTIT, 0); @@ -806,7 +800,7 @@ } void AudioCDProtocol::paranoiaRead( - struct cdrom_drive * drive, + cdrom_drive * drive, long firstSector, long lastSector, AudioCDEncoder* encoder, @@ -1136,7 +1130,7 @@ * The higher the paranoia_read_limited_error the worse the problem is * FYI: PARANOIA_CB_READ & PARANOIA_CB_VERIFY happen continusly when ripping */ -void paranoiaCallback(long, int function) +void paranoiaCallback(long, paranoia_cb_mode_t function) { switch(function){ case PARANOIA_CB_VERIFY: diff -urNd kdemultimedia-4.6.4/kioslave/audiocd/audiocd.h kdemultimedia-4.6.4-libcdio/kioslave/audiocd/audiocd.h --- kdemultimedia-4.6.4/kioslave/audiocd/audiocd.h 2011-01-20 08:23:34.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/kioslave/audiocd/audiocd.h 2011-06-19 13:12:47.616189278 +1100 @@ -29,7 +29,7 @@ class AudioCDEncoder; -struct cdrom_drive; +//struct cdrom_drive; namespace AudioCD { @@ -53,7 +53,7 @@ AudioCDEncoder *encoderFromExtension(const QString& extension); AudioCDEncoder *determineEncoder(const QString & filename); - struct cdrom_drive *findDrive(bool &noPermission); + cdrom_drive *findDrive(bool &noPermission); void parseURLArgs(const KUrl &); void loadSettings(); @@ -64,7 +64,7 @@ * return false if the parameters are invalid (for instance, * track number which does not exist on this CD) */ - bool getSectorsForRequest(struct cdrom_drive * drive, + bool getSectorsForRequest(cdrom_drive * drive, long & firstSector, long & lastSector) const; /** @@ -78,7 +78,7 @@ * Reads data off the cd and then passes it to an encoder to encode */ void paranoiaRead( - struct cdrom_drive * drive, + cdrom_drive * drive, long firstSector, long lastSector, AudioCDEncoder* encoder, @@ -86,7 +86,7 @@ unsigned long size ); - struct cdrom_drive *initRequest(const KUrl &); + cdrom_drive *initRequest(const KUrl &); /** * Add an entry in the KIO directory, using the title you give, @@ -101,7 +101,7 @@ * this function will do the right thing. */ void addEntry(const QString& trackTitle, AudioCDEncoder *encoder, - struct cdrom_drive * drive, int trackNo); + cdrom_drive * drive, int trackNo); class Private; Private * d; diff -urNd kdemultimedia-4.6.4/kioslave/audiocd/CMakeLists.txt kdemultimedia-4.6.4-libcdio/kioslave/audiocd/CMakeLists.txt --- kdemultimedia-4.6.4/kioslave/audiocd/CMakeLists.txt 2011-01-20 08:23:34.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/kioslave/audiocd/CMakeLists.txt 2011-06-19 13:40:39.296201408 +1100 @@ -34,7 +34,7 @@ -target_link_libraries(kio_audiocd ${CDPARANOIA_LIBRARIES} ${KDE4_KIO_LIBS} audiocdplugins kcddb kcompactdisc) +target_link_libraries(kio_audiocd ${CDPARANOIA_LIBRARIES} cdio_cdda cdio ${KDE4_KIO_LIBS} audiocdplugins kcddb kcompactdisc) install(TARGETS kio_audiocd DESTINATION ${PLUGIN_INSTALL_DIR} ) diff -urNd kdemultimedia-4.6.4/kioslave/audiocd/plugins/wav/encodercda.cpp kdemultimedia-4.6.4-libcdio/kioslave/audiocd/plugins/wav/encodercda.cpp --- kdemultimedia-4.6.4/kioslave/audiocd/plugins/wav/encodercda.cpp 2011-01-20 08:23:33.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/kioslave/audiocd/plugins/wav/encodercda.cpp 2011-06-19 13:43:28.066185535 +1100 @@ -42,10 +42,7 @@ // Remove this by calculating CD_FRAMESIZE_RAW from the frames extern "C" { - //cdda_interface.h in cdparanoia 10.2 has a member called 'private' which the C++ compiler doesn't like - #define private _private - #include <cdda_interface.h> - #undef private + #include <sector.h> } inline int16_t swap16 (int16_t i) diff -urNd kdemultimedia-4.6.4/kioslave/CMakeLists.txt kdemultimedia-4.6.4-libcdio/kioslave/CMakeLists.txt --- kdemultimedia-4.6.4/kioslave/CMakeLists.txt 2011-01-20 08:23:35.000000000 +1000 +++ kdemultimedia-4.6.4-libcdio/kioslave/CMakeLists.txt 2011-06-19 13:50:15.551774979 +1100 @@ -1,5 +1,5 @@ macro_optional_find_package(Cdparanoia) -macro_log_feature(CDPARANOIA_FOUND "cdparanoia" "Reads digital audio directly from a CD, then writes the data to a file or pipe in several different formats" "http://www.xiph.org/paranoia/" FALSE "" "Required for building the AudioCD ioslave.") +macro_log_feature(CDPARANOIA_FOUND "libcdio" "Reads digital audio directly from a CD, then writes the data to a file or pipe in several different formats" "http://www.xiph.org/paranoia/" FALSE "" "Required for building the AudioCD ioslave.") if (CDPARANOIA_FOUND)
___________________________________________________ This message is from the kde mailing list. Account management: https://mail.kde.org/mailman/listinfo/kde. Archives: http://lists.kde.org/. More info: http://www.kde.org/faq.html.