Esempio n. 1
0
// 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, FILE_BROWSER_ISO_FILE_PTR);

   std::string fileroot = str;
   fileroot.erase(fileroot.rfind(extension));

   TrackParser* tp = TrackParserFactory(fileroot, image);
   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->getPregapLength());
      cdda->openFile(str, FILE_BROWSER_CDDA_FILE_PTR);
   }
   else
   {
      cdda = new NoCDDAData();
   }

		// build the subchannel data
   scd = SubchannelDataFactory(fileroot, FILE_BROWSER_SUB_FILE_PTR);

   if (trackList.size() > 2)
   {
      image->setPregap(tp->getPregapLength(), trackList[2].trackStart);
   }

}