Exemplo n.º 1
0
//________________________________________________________________________
void notevisitor::print (ostream& out) const
{
		if (isGrace()) out << "grace ";
		if (isCue())   out << "cue ";
		int type = getType();
		if (type == kUndefinedType)
			out << "type undefined";
		else if (type == kUnpitched) {
			out << "unpitched note - duration " << getDuration() << " ";
		}
		else if (type == kRest) {
			out << "rest - duration " << getDuration() << " ";
		}
		else if (type == kPitched) {
			out << "note " << getStep();
			int alter = int(getAlter());
			float diff = getAlter() - alter;
			if (diff >= 0.5) alter++; 
			else if (diff <= -0.5) alter--; 
			while (alter < 0) { out << 'b'; alter++; }
			while (alter > 0) { out << '#'; alter--; }
			out << getOctave() << " (" << getMidiPitch() << ")";
			out << " - duration " << getDuration() << " ";
		}
		else out << "unknown type " <<  type << " ";
		if (inChord())	out << "in chord ";
		if (getTie() & StartStop::start)	out << "- tie start ";
		if (getTie() & StartStop::stop)	out << "- tie stop ";
		string instr = getInstrument();
		if (!instr.empty()) out << "instrument " << instr << " ";
		if (getDynamics() >= 0) out << "dynamics " << getDynamics();
}
Exemplo n.º 2
0
/*	getDiscType
*	method checks which kind of cd/dvd is to burn
*	returns integer which is defined in header (AI.h)
*/
int
ProjectTypeSelector::getDiscType()
{		
	if(objFileAccess == NULL)
		throw new ProjectTypeSelectorException(new BString("FileAccess object isn't seted ProjectTypeSelector::getDiscType()"));

	objFileAccess->generateFileInfos();
	TypeList = objFileAccess->getTypes();
	fSizeOfFiles = objFileAccess->getFileSize();
	FileList = objFileAccess->getFiles();
	
	if(FileList->CountItems() == 0) {
		return EMPTYLIST;
	}
	
	if(FileList->CountItems() == 1 && isVolume()) {
	
		//CD or DVD
		if(fSizeOfFiles > CDSIZE) {
			return DVDCOPY;
		}
		else {
			return CDCOPY;
		}
	}
	else if(FileList->CountItems() == 1 && isCue()) {
		return CUE;
	}
	else if(FileList->CountItems() == 1 && isImage()) {
		
		//CD or DVD
		if(fSizeOfFiles > CDSIZE) {
			return DVDIMAGE;
		}
		else {
			return CDIMAGE;
		}
	}
	else if(FileList->CountItems() == 1 && isProject()) {
		return PORJECT;
	}
	
	if(isAudioDisc() && intPlayTime > AUDIOCDPLAYTIME) {
		return AUDIODVD;
	}
	else if(isAudioDisc()) {
		return AUDIOCD;
	}
		
	//CD or DVD
	if(fSizeOfFiles > CDSIZE) {
		return DATADVD;
	}
	else {
		
		//Video CD or data CD
		if(isVideoDisc()) {
			return VCD;
		}
		else {
			return DATACD;
		}
	}
	
	return ERROR;
}