[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: KAudioCreator on non-linux systems
From: Adriaan de Groot <adridg () cs ! kun ! nl>
Date: 2003-04-24 19:44:47
[Download RAW message or body]
The attached diffs (against BRANCH, but I suppose HEAD would work too) make it
possible to compile KAudioCreator on non-Linux systems. Since BSD got
cdparanoia recently, the only thing tripping up KAC was the linux/cdrom thing
required for FixupTOC, which appears to be known-and-ignored in the BSD
version of cdparanoia. There's several #ifdef LINUX in the patch, which need
the right treatment (s/LINUX/_LiNuX_ || Linux || .../) to work on all Linux
systems. Maybe an HAVE_LINUX_CDROM_H would be useful in the configure.
For the BSD crowd: please give it a shot (assuming you have a working audiocd:
slave). For the -devel crowd: look ok to commit? Does anyone know what the
exact combination of Linux defines is to reliably detect that OS?
--
pub 1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <groot@kde.org>
Key fingerprint = 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE
["kac.diff" (text/x-diff)]
Index: cdconfigimp.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/cdconfigimp.cpp,v
retrieving revision 1.9
diff -u -3 -p -r1.9 cdconfigimp.cpp
--- cdconfigimp.cpp 21 Sep 2002 21:27:01 -0000 1.9
+++ cdconfigimp.cpp 24 Apr 2003 19:38:37 -0000
@@ -22,10 +22,13 @@
#include <kprocess.h>
#include <kmessagebox.h>
-#define HAVE_LAME 0
-
#include <config.h>
+// Moved the HAVE_LAME define in order to avoid redefined-warnings.
+#ifndef HAVE_LAME
+#define HAVE_LAME 0
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -52,21 +55,32 @@ typedef Q_INT32 size32;
#include <qlineedit.h>
#include <qcheckbox.h>
+#if HAVE_LAME
+extern "C"
+{
+#include <lame/lame.h>
+}
+#endif
+
extern "C"
{
#include <cdda_interface.h>
#include <cdda_paranoia.h>
+}
+// Many Linux systems do not define LINUX. It's something else that I
+// can't be bothered to look up just right now.
+#ifdef LINUX
+extern "C"
+{
/* This is in support for the Mega Hack, if cdparanoia ever is fixed, or we
use another ripping library we can remove this. */
#include <linux/cdrom.h>
#include <sys/ioctl.h>
-#if HAVE_LAME
-#include <lame/lame.h>
+}
#endif
-}
#include <kdebug.h>
#include <kurl.h>
#include <kprotocolmanager.h>
@@ -91,6 +105,16 @@ extern "C"
int start_of_first_data_as_in_toc;
int hack_track;
+
+#ifdef __FreeBSD__
+/* The code found in FreeBSD's port of cdparanoia 3.9.8_4 has
+** pretty much the same functionality, except it is documented.
+** In addition, the multisession hack stuff is #ifdeffed out
+** in the port, so presumably (a) it never happes or (b) the
+** TOC returned by the BSD driver works differently or (c) we
+** just don't care over there.
+*/
+#else
/* Mega hack. This function comes from libcdda_interface, and is called by
it. We need to override it, so we implement it ourself in the hope, that
shared lib semantics make the calls in libcdda_interface to FixupTOC end
@@ -151,6 +175,7 @@ int FixupTOC(cdrom_drive *d, int tracks)
}
return 0;
}
+#endif
/* libcdda returns for cdda_disc_lastsector() the last sector of the last
_audio_ track. How broken. For CDDB Disc-ID we need the real last sector
@@ -159,6 +184,7 @@ long my_last_sector(cdrom_drive *drive)
{
return cdda_track_lastsector(drive, drive->tracks);
}
+
enum Which_dir { Unknown = 0, Device, ByName, ByTrack, Title, Info, Root,
MP3, Vorbis };
Index: configure.in.in
===================================================================
RCS file: /home/kde/kdemultimedia/kaudiocreator/configure.in.in,v
retrieving revision 1.1.2.1
diff -u -3 -p -r1.1.2.1 configure.in.in
--- configure.in.in 30 Jan 2003 20:12:42 -0000 1.1.2.1
+++ configure.in.in 24 Apr 2003 19:38:37 -0000
@@ -3,10 +3,13 @@ dnl the linux cdrom headers.
enable_kac=yes
-KDE_CHECK_HEADER(linux/cdrom.h,
- [:],
- [AC_MSG_WARN([This doesn't seem to be a Linux system. KAudioCreator has been disabled.])
-enable_kac=no])
+dnl If you don't have Linux, you can still use cdparanoia's FixupTOC
+dnl which seems to be #ifdeffed out for non-Linux systems anyway.
+dnl
+dnl KDE_CHECK_HEADER(linux/cdrom.h,
+dnl [:],
+dnl [AC_MSG_WARN([This doesn't seem to be a Linux system. KAudioCreator has been disabled.])
+dnl enable_kac=no])
if test "x$HAVE_CDPARANOIA" = "x1" ; then
# It just might work
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic