1 /* 2 * Copyright 2007-2011, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef CDDA_H 6 #define CDDA_H 7 8 9 #include <scsi_cmds.h> 10 11 12 static const uint32 kFramesPerSecond = 75; 13 static const uint32 kFramesPerMinute = kFramesPerSecond * 60; 14 static const uint32 kFrameSize = 2352; 15 static const uint32 kDataTrackLeadGap = 11400; 16 static const uint8 kMaxTracks = 0x63; 17 18 struct cdtext { 19 cdtext(); 20 ~cdtext(); 21 22 char *artist; 23 char *album; 24 char *genre; 25 26 char *titles[kMaxTracks]; 27 char *artists[kMaxTracks]; 28 uint8 track_count; 29 }; 30 31 32 status_t read_cdtext(int fd, cdtext &text); 33 status_t read_table_of_contents(int fd, scsi_toc_toc *toc, size_t length); 34 status_t read_cdda_data(int fd, off_t endFrame, off_t offset, void *data, 35 size_t length, off_t bufferOffset, void *buffer, size_t bufferSize); 36 37 #endif // CDDA_H 38