Ejemplo n.º 1
0
void WaveTrack::WriteXML(int depth, FILE *fp)
{
   int i;

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "<wavetrack ");
   fprintf(fp, "name=\"%s\" ", (const char *)XMLEsc(mName).mb_str());
   fprintf(fp, "channel=\"%d\" ", mChannel);
   fprintf(fp, "linked=\"%d\" ", mLinked);
   fprintf(fp, "offset=\"%s\" ", (const char *)Internat::ToString(mOffset, 8).mb_str());
   fprintf(fp, "rate=\"%s\" ", (const char *)Internat::ToString(mRate).mb_str());
   fprintf(fp, "gain=\"%s\" ", (const char *)Internat::ToString((double)mGain).mb_str());
   fprintf(fp, "pan=\"%s\" ", (const char *)Internat::ToString((double)mPan).mb_str());
   fprintf(fp, ">\n");
   
   for (WaveClipList::Node* it=GetClipIterator(); it; it=it->GetNext())
   {
      it->GetData()->WriteXML(depth+1, fp);
   }

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "</wavetrack>\n");
}
Ejemplo n.º 2
0
void Tags::WriteXML(int depth, FILE *fp)
{
   int i;

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "<tags ");
   fprintf(fp, "title=\"%s\" ", (const char *)XMLEsc(mTitle).mb_str());
   fprintf(fp, "artist=\"%s\" ", (const char *)XMLEsc(mArtist).mb_str());
   fprintf(fp, "album=\"%s\" ", (const char *)XMLEsc(mAlbum).mb_str());
   fprintf(fp, "track=\"%d\" ", mTrackNum);
   fprintf(fp, "year=\"%s\" ", (const char *)XMLEsc(mYear).mb_str());
   fprintf(fp, "genre=\"%d\" ", mGenre);
   fprintf(fp, "comments=\"%s\" ", (const char *)XMLEsc(mComments).mb_str());
   fprintf(fp, "id3v2=\"%d\" ", (int)mID3V2);
   fprintf(fp, "/>\n"); // XML shorthand for childless tag
}
Ejemplo n.º 3
0
void XMLWriter::WriteData(const wxString &value)
{
   int i;

   for (i = 0; i < mDepth; i++) {
      Write(wxT("\t"));
   }

   Write(XMLEsc(value));
}
Ejemplo n.º 4
0
void LabelTrack::WriteXML(int depth, FILE *fp)
{
   int len = mLabels.Count();
   int i, j;

   for(j=0; j<depth; j++)
      fprintf(fp, "\t");
   fprintf(fp, "<labeltrack ");
   fprintf(fp, "name=\"%s\" ", XMLEsc(mName).c_str());
   fprintf(fp, "numlabels=\"%d\">\n", len);

   for (i = 0; i < len; i++) {
      for(j=0; j<depth+1; j++)
         fprintf(fp, "\t");
      fprintf(fp, "<label t=\"%s\" t1=\"%s\" title=\"%s\"/>\n",
            Internat::ToString(mLabels[i]->t, 8).c_str(),
            Internat::ToString(mLabels[i]->t1, 8).c_str(),
            XMLEsc(mLabels[i]->title).c_str());
   }
   for(j=0; j<depth; j++)
      fprintf(fp, "\t");
   fprintf(fp, "</labeltrack>\n");
}
Ejemplo n.º 5
0
void TimeTrack::WriteXML(int depth, FILE *fp)
{
   int i;

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "<timetrack ");
   fprintf(fp, "name=\"%s\" ", XMLEsc(mName).c_str());
   fprintf(fp, "channel=\"%d\" ", mChannel);
   fprintf(fp, "offset=\"%f\" ", mOffset);
   fprintf(fp, ">\n");

   mEnvelope->WriteXML(depth+1, fp);

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "</timetrack>\n");
}
Ejemplo n.º 6
0
void WaveTrack::WriteXML(int depth, FILE *fp)
{
   int i;

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "<wavetrack ");
   fprintf(fp, "name=\"%s\" ", XMLEsc(mName).c_str());
   fprintf(fp, "channel=\"%d\" ", mChannel);
   fprintf(fp, "linked=\"%d\" ", mLinked);
   fprintf(fp, "offset=\"%s\" ", Internat::ToString(mOffset, 8).c_str());
   fprintf(fp, "rate=\"%s\" ", Internat::ToString(mRate).c_str());
   fprintf(fp, "gain=\"%s\" ", Internat::ToString((double)mGain).c_str());
   fprintf(fp, "pan=\"%s\" ", Internat::ToString((double)mPan).c_str());
   fprintf(fp, ">\n");

   mSequence->WriteXML(depth+1, fp);

   mEnvelope->WriteXML(depth+1, fp);

   for(i=0; i<depth; i++)
      fprintf(fp, "\t");
   fprintf(fp, "</wavetrack>\n");
}
Ejemplo n.º 7
0
void XMLWriter::WriteAttr(const wxString &name, const wxString &value)
{
   Write(wxString::Format(wxT(" %s=\"%s\""),
      name.c_str(),
      XMLEsc(value).c_str()));
}