File indexing completed on 2025-03-23 04:28:10
0001 /* 0002 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef _K3B_DEVICE_GLOBALS_H_ 0007 #define _K3B_DEVICE_GLOBALS_H_ 0008 0009 #include "k3bmsf.h" 0010 #include "k3bdevice_export.h" 0011 #include "k3bdevicetypes.h" 0012 #include <QString> 0013 0014 namespace K3b { 0015 namespace Device 0016 { 0017 class Device; 0018 0019 LIBK3BDEVICE_EXPORT QString deviceTypeString( int ); 0020 LIBK3BDEVICE_EXPORT QString writingModeString( int ); 0021 LIBK3BDEVICE_EXPORT QString mediaStateString( int ); 0022 /** 0023 * @param simplified if true the formatting state of DVD media is left out. 0024 */ 0025 LIBK3BDEVICE_EXPORT QString mediaTypeString( int, bool simplified = false ); 0026 LIBK3BDEVICE_EXPORT void debugBitfield( unsigned char* data, long len ); 0027 0028 LIBK3BDEVICE_EXPORT quint16 from2Byte( const unsigned char* ); 0029 LIBK3BDEVICE_EXPORT quint32 from4Byte( const unsigned char* ); 0030 0031 LIBK3BDEVICE_EXPORT char fromBcd( const char& ); 0032 LIBK3BDEVICE_EXPORT char toBcd( const char& ); 0033 LIBK3BDEVICE_EXPORT bool isValidBcd( const char& ); 0034 0035 /** 0036 * @return the maximum nuber of sectors that can be read from device @p dev starting 0037 * at sector @p firstSector. 0038 */ 0039 int determineMaxReadingBufferSize( Device* dev, const K3b::Msf& firstSector ); 0040 0041 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, MediaType ); 0042 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, MediaTypes ); 0043 0044 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, MediaState ); 0045 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, MediaStates ); 0046 0047 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, WritingMode ); 0048 LIBK3BDEVICE_EXPORT QDebug& operator<<( QDebug& dbg, WritingModes ); 0049 } 0050 } 0051 0052 0053 #endif