Exemplo n.º 1
0
//===========================================
// MusicTrack::MusicTrack
//===========================================
MusicTrack::MusicTrack(const XmlNode data)
   : Asset(internString("MusicTrack")) {

   string path;

   try {
      XML_NODE_CHECK(data, MusicTrack);

      XmlAttribute attr = data.firstAttribute();
      XML_ATTR_CHECK(attr, path);

      stringstream ss;
      ss << gGetWorkingDir() << "/" << attr.getString();

      path = ss.str();
   }
   catch (XmlException& e) {
      e.prepend("Error parsing XML for instance of class MusicTrack; ");
      throw;
   }

   Audio audio;
   audio.newMusicTrack(this, path);
}
Exemplo n.º 2
0
//===========================================
// MusicTrack::MusicTrack
//===========================================
MusicTrack::MusicTrack(const string& file)
   : Asset(internString("MusicTrack")) {

   Audio audio;
   audio.newMusicTrack(this, file);
}