コード例 #1
0
ファイル: xmliter.cpp プロジェクト: 02191998/libmusicxml
//_______________________________________________________________________________
int main(int argc, char *argv[]) {
#if debug
	char *path = "rm.xml";
	argc = 2;
#else
	char *path = argv[1];
#endif
	if (argc > 1) {
		xmlreader r;
		SXMLFile file = r.read(path);
		if (file) {
			Sxmlelement st = file->elements();
			if (st) {
				test1(st);
				count(st, k_measure);
				count(st, k_note);

				test2(st);
				count(st, k_measure);
				count(st, k_note);

				test3(st);
				count(st, k_measure);
				count(st, k_note);

				file->print (cout);
				cout << endl;		
			}
		}
	}
	return 0;
}
コード例 #2
0
ファイル: RandomMusic.cpp プロジェクト: 02191998/libmusicxml
int main (int argc, char * argv[]) {
	// if present, reads the measures count from the command line
	int count = (argc == 2) ? atoi(argv[1]) : 20;
	// sets the random numbers seed
#ifdef WIN32
	srand((unsigned)time(0));
#else
	srandom((unsigned)time(0));
#endif
	SXMLFile f = TXMLFile::create();
	f->set( new TXMLDecl("1.0", "", TXMLDecl::kNo));
	f->set( new TDocType("score-partwise"));
	f->set( randomMusic(count) );
	f->print(cout);
	cout << endl;
    return 0;
}