// initalizes all the data for CDInterface based on a file name from // CDOpen inline void CDInterface::open(const std::string& str) { // use the FIFactory to make the FileInterface std::string extension; image = FileInterfaceFactory(str, extension); std::string fileroot = str; fileroot.erase(fileroot.rfind(extension)); TrackParser* tp = TrackParserFactory(fileroot); tp->parse(); tp->postProcess(image->getCDLength()); trackList = tp->getTrackList(); delete tp; // if there is more than one track, initalize the CDDA data if (trackList.size() > 2) { cdda = new PlayCDDAData(trackList, tp->hasPregap()); cdda->openFile(str); } else { cdda = new NoCDDAData(); } // build the subchannel data scd = SubchannelDataFactory(fileroot); if (tp->hasPregap()) { image->setPregap(true, trackList[2].trackStart); } }