// // Programmer: Craig Stuart Sapp // Creation Date: Mon Oct 23 19:44:36 PDT 2000 // Last Modified: Mon Oct 23 19:44:38 PDT 2000 // Filename: ...sig/examples/all/scordur.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/scordur.cpp // Syntax: C++; museinfo // // Description: measures the total length of a humdrum file in terms of // metrical beats. If more than one data set in input file, then displays // the total beat duration of each set. // #include #include #include "humdrum.h" using namespace std; // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void displayResults (HumdrumFile& hfile, int count, const string& filename); void example (void); void usage (const string& command); // global variables: Options options; // database for command-line arguments int numinputs; // the total number of input files ////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { HumdrumFile hfile; // process the command-line options checkOptions(options, argc, argv); // figure out the number of input files to process numinputs = options.getArgCount(); string filename; for (int i=0; i 1) { cout << filename << ":\t"; } cout << hfile.getAbsBeat(i) << "\n"; } } } ////////////////////////////// // // example -- example usage of the quality program // void example(void) { cout << " \n" "# example usage of the scordur program. \n" " scordur chor217.krn \n" " \n" << endl; } ////////////////////////////// // // usage -- gives the usage statement for the meter program // void usage(const string& command) { cout << " \n" "Measures the total length of a humdrum file in terms of \n" "metrical beats. If more than one data set in input file, then displays \n" "the total beat duration of each set. \n" " \n" "Usage: " << command << " [input1 [input2 ...]] \n" " \n" "Options: \n" " --options = list of all options, aliases and default values \n" " \n" << endl; }