// // Programmer: Craig Stuart Sapp // Creation Date: Fri Jun 18 15:26:27 PDT 2010 // Last Modified: Fri Jun 18 15:26:31 PDT 2010 // Filename: ...sig/examples/all/museset.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/museset.cpp // Syntax: C++; museinfo // // Description: Test program for handling multiple MuseData part files. // #include "MuseDataSet.h" #include "Options.h" #include "museinfo.h" #ifndef OLDCPP using namespace std; #endif // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void usage (const char* command); void printData (MuseData& infile); void cleanData (MuseDataSet& infile, const char* cleanstring); // global variables Options options; // database for command-line arguments int countQ = 0; // used with -c option int part = -1; // used with -p option int partQ = 0; // used with -p option int instrumentQ = 0; // used with -i option int typeQ = 0; // used with -t option int cleanQ = 0; // used with -C option string clean; // used with -C option string membership; // used with -m optnion /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { checkOptions(options, argc, argv); int numinputs = options.getArgCount(); MuseDataSet infile; int i, j; if (numinputs > 1) { for (i=0; i= 0 && part < infile.getPartCount()) { if (part != i) { continue; } } for (j=0; j= infile.getPartCount()) { cout << infile; } else { cout << infile[part]; } } return 0; } /////////////////////////////////////////////////////////////////////////// ////////////////////////////// // // cleanData -- force the group memberships to only be those // listed in the clean string. (only one membership at the moment). // void cleanData(MuseDataSet& infile, const char* cleanstring) { int i; for (i=0; i