/* cdda input class based on cdparanoia Copyright (C) 2000 Martin Vogt This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation. For more information look at the file COPYRIGHT in this package */ #ifdef HAVE_CONFIG_H #include #endif #ifdef CDDA_PARANOIA #include using namespace std; #include "cddaInputStream.h" #include "inputDetector.h" void paranoiaCallback(long, int) { //cout << "long:"<tracks; for (int i = 1; i <= trackCount; i++) { if (IS_AUDIO(drive, i)) { printf("track%02d.cda\n", i); } else { printf("no audio:%d\n",i); } } paranoia = paranoia_init(drive); if (paranoia == NULL) { cout << "paranoia init failed"< initialized! int paranoiaLevel = PARANOIA_MODE_FULL ^ PARANOIA_MODE_NEVERSKIP; paranoia_modeset(paranoia, paranoiaLevel); cdda_verbose_set(drive, CDDA_MESSAGE_PRINTIT, CDDA_MESSAGE_PRINTIT); paranoia_seek(paranoia, firstSector, SEEK_SET); return true; } void CDDAInputStream::close() { if (isOpen() == false) { return; } cdda_close(drive); drive=NULL; if (paranoia != NULL) { paranoia_free(paranoia); paranoia = 0; } if (device != NULL) { delete device; device=NULL; } } int CDDAInputStream::isOpen() { return (drive != NULL); } int CDDAInputStream::eof() { if (isOpen()==false) { return true; } if (currentSector >= lastSector) { return true; } return false; } int CDDAInputStream::read(char* dest,int len) { if (len != 2*CD_FRAMESIZE_RAW) { cout << "len must be 2*CD_FRAMESIZE_RAW"<