1 /* 2 * Copyright 2007, 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 uint8 kMaxTracks = 0x63; 16 17 struct cdtext { 18 cdtext(); 19 ~cdtext(); 20 21 char *artist; 22 char *album; 23 char *genre; 24 25 char *titles[kMaxTracks]; 26 char *artists[kMaxTracks]; 27 uint8 track_count; 28 }; 29 30 31 status_t read_cdtext(int fd, cdtext &text); 32 status_t read_table_of_contents(int fd, scsi_toc_toc *toc, size_t length); 33 status_t read_cdda_data(int fd, off_t offset, void *data, size_t length, 34 off_t bufferOffset, void *buffer, size_t bufferSize); 35 36 #endif // CDDA_H 37