Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (81 sloc) 2.25 KB
//
// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
// Creation Date: Mon Feb 17 22:35:50 PST 2014
// Last Modified: Thu Feb 20 23:29:45 PST 2014
// Filename: ScorePage.cpp
// URL: https://github.com/craigsapp/scorelib/blob/master/src-library/ScorePage.cpp
// Syntax: C++11
//
// Description: This class handles analysis of relationships between
// SCORE items on the page, such as system, pitch, and chord
// groupings.
//
#include "ScorePage.h"
#include "ScoreUtility.h"
#include <algorithm>
using namespace std;
///////////////////////////////
//
// ScorePage::ScorePage --
//
ScorePage::ScorePage(void) : ScorePageBase() {
// do nothing
}
ScorePage::ScorePage(const char* filename) : ScorePageBase(filename) {
// do nothing
}
ScorePage::ScorePage(istream& instream) : ScorePageBase(instream) {
// do nothing
}
ScorePage::ScorePage(const ScorePage& apage) :
ScorePageBase((ScorePageBase)apage) {
// do nothing
}
ScorePage::ScorePage(const ScorePageBase& apage) :
ScorePageBase(apage) {
// do nothing
}
//////////////////////////////
//
// ScorePage::~ScorePage --
//
ScorePage::~ScorePage() {
// do nothing
}
//////////////////////////////
//
// ScorePage::setSetOwner --
//
void ScorePage::setSetOwner(ScorePageSet* pageset) {
pageset_owner = (void*)pageset;
}
//////////////////////////////
//
// ScorePage::getSetOwner --
//
ScorePageSet* ScorePage::getSetOwner(void) {
return (ScorePageSet*)pageset_owner;
}
///////////////////////////////////////////////////////////////////////////
//
// Private functions.
//
//////////////////////////////
//
// ScorePage::sortPageHorizontally -- The primary analysis function
// to which most other analysis functions depend.
//
void ScorePage::sortPageHorizontally (void) {
analysis_info.setInvalid("sorted");
vectorSIp& sortlist = itemlist_P3sorted;
sortlist.resize(item_storage.size());
auto it = item_storage.begin();
auto it2 = sortlist.begin();
for ( ; ((it != item_storage.end()) && (it2 != sortlist.end()));
it++, it2++) {
*it2 = *it;
}
sort(sortlist.begin(), sortlist.end(), SU::sortP3);
analysis_info.setValid("notmodified");
analysis_info.setValid("sorted");
}
You can’t perform that action at this time.