summaryrefslogtreecommitdiffstats
path: root/sysutils/k3b/files/patch-src-device-k3bdevice.cpp
blob: 06c1ddca7aa6c56964bfd3651cd59d312ef1de49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--- src/device/k3bdevice.cpp.orig	Wed Jun 23 12:06:46 2004
+++ src/device/k3bdevice.cpp	Sun Jul 11 12:24:22 2004
@@ -57,6 +57,13 @@
 
 #endif // Q_OS_LINUX
 
+#ifdef __FreeBSD__
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+#define CD_FRAMESIZE_RAW 2352
+#define nearbyint(x) rint(x)
+#endif
+
 
 #ifdef HAVE_RESMGR
 extern "C" {
@@ -153,8 +160,10 @@
 
   d->supportedProfiles = 0;
 
+#ifndef __FreeBSD__
   if(open() < 0)
     return false;
+#endif
 
 
   //
@@ -193,6 +202,7 @@
   unsigned char header[2048];
   ::memset( header, 0, 2048 );
 
+  cmd.clear();
   cmd[0] = MMC::GET_CONFIGURATION;
   cmd[8] = 8;
   if( cmd.transport( TR_DIR_READ, header, 8 ) ) {
@@ -769,6 +779,14 @@
       m_bufferSize = 1024;
       d->burnfree = false;
     }
+    else if( description().startsWith("CD-R56S") ) {
+      m_writeModes |= TAO;
+      d->deviceType |= CDROM|CDR;
+      m_maxWriteSpeed = 6;
+      m_maxReadSpeed = 24;
+      m_bufferSize = 1302;
+      d->burnfree = false;
+    }
   }
   else if( vendor().startsWith("HP") ) {
     if( description().startsWith("CD-Writer 6020") ) {
@@ -2559,10 +2577,12 @@
 {
   // if the device is already opened we do not close it
   // to allow fast multible method calls in a row
+#ifndef __FreeBSD__
   bool needToClose = !isOpen();
 
   if (open() < 0)
     return;
+#endif
 
   // header size is 8
   unsigned char* buffer = 0;
@@ -2648,13 +2668,16 @@
     delete [] buffer;
   }
     
+#ifndef __FreeBSD__
   if( needToClose )
     close();
+#endif
 }
 
 
 bool K3bCdDevice::CdDevice::readTocPmaAtip( unsigned char** data, int& dataLen, int format, bool time, int track ) const
 {
+  kdDebug() << "(K3bCdDevice::CdDevice) readTocPmaAtip started,  format:" << format << ", time: " << time << ", track: " << track << endl;
   unsigned char header[2048];
   ::memset( header, 0, 2048 );
 
OpenPOWER on IntegriCloud