Ejemplo n.º 1
0
void createTable(ostream& out, HumdrumFile& infile) {

   out << "<table " << C0C0 << ">\n";

   int i;
   for (i=0; i<infile.getNumLines(); i++) {
      if (infile[i].isGlobalComment()) {
         printGlobalComment(out, infile, i);
         continue;
      }
      if (infile[i].isBibliographic()) {
         printReferenceRecord(out, infile, i);
         continue;
      }
      if (infile[i].isData()) {
         printFields(out, infile, i);
      }
      if (infile[i].isMeasure()) {
         printFields(out, infile, i);
      }
      if (infile[i].isInterpretation()) {
         printFields(out, infile, i);
      }
   }

   out << "</table>\n";

   if (textareaQ) {
      out << "<textarea wrap=off rows=10 cols=70>";
      out << infile;
      out << "</textarea>\n";
   }

}
Ejemplo n.º 2
0
void printGlobalComments(HumdrumFile& hfile, int direction) {
   int start = 0;
   int stop = hfile.getNumLines();
   int i;

   if (direction == 1) {
      start = 0;
      i = 0;
      while (i < hfile.getNumLines()) {
         if (strncmp(hfile[i][0], "**", 2) == 0) {
            stop = i;
            break;
         }
         i++;
      }
      
   } else {
      stop = hfile.getNumLines() - 1;
      i = stop;
      while (i >= 0) {
         if (strcmp(hfile[i][0], "*-") == 0) {
            start = i;
            break;
         }
         i--;
      }
   }

   for (i=start; i<=stop; i++) {
      switch (hfile[i].getType()) {
         case E_humrec_global_comment:
            printGlobalComment(hfile, i);
            break;
         case E_humrec_bibliography:
            printBibliography(hfile, i);
            break;
      }

   }

}