Ejemplo n.º 1
0
//ナビを描画する
void Navigator::setDraw( bool isDouble){
	mNoteChanged = false;
	int count = 1;
	if(isDouble){
		count = 2;
	}
	for(int i=0;i<count;i++){
		Note* note = dynamic_cast<Note*>( mNoteArray->objectAtIndex(i) );
		Note::NoteType type = note->getNoteType();
		NoteTap* noteTap;
		NoteHold* noteHold;
		switch (type){
			case Note::TAP:
				noteTap = dynamic_cast<NoteTap*>(note);
				if(i == 0){
					setPosition(noteTap->mPos_x,noteTap->mPos_y,false);
				}else{
					setPosition(noteTap->mPos_x,noteTap->mPos_y,true);
				}
				break;
			case Note::HOLD:
				noteHold = dynamic_cast<NoteHold*>(note);
				if(i == 0){
					setPosition(noteHold->mCurrentPos_x,noteHold->mCurrentPos_y,false);
					mIsHoldFirst = true;
				}else{
					setPosition(noteHold->mCurrentPos_x,noteHold->mCurrentPos_y,true);
					mIsHoldSecond = true;
				}
				break;
		}
	}
	
}
Ejemplo n.º 2
0
QString
NotationStrings::getAmericanName(Note note, bool plural, bool triplet)
{
    Note::Type type = note.getNoteType();
    int dots = note.getDots();

    static const QString names[] = {
                                       "sixty-fourth note", "thirty-second note",
                                       "sixteenth note", "eighth note",
                                       "quarter note", "half note",
                                       "whole note", "double whole note"
                                   };
    static const QString pluralnames[] = {
                                             "sixty-fourth notes", "thirty-second notes",
                                             "sixteenth notes", "eighth notes",
                                             "quarter notes", "half notes",
                                             "whole notes", "double whole notes"
                                         };

    if (plural && triplet) {
        return addDots(QString("%1 triplets").arg(names[type]), dots, false, false);
    } else if (plural) {
        return addDots(pluralnames[type], dots, false, false);
    } else if (triplet) {
        return addDots(QString("%1 triplet").arg(names[type]), dots, false, false);
    } else {
        return addDots(names[type], dots, false, false);
    }
}
Ejemplo n.º 3
0
QString
NotationStrings::getNoteName(Note note, bool plural, bool triplet)
{
    Note::Type type = note.getNoteType();
    int dots = note.getDots();

    static const QString names[] = {
                                       tr("sixty-fourth note"), tr("thirty-second note"),
                                       tr("sixteenth note"), tr("eighth note"),
                                       tr("quarter note"), tr("half note"),
                                       tr("whole note"), tr("double whole note")
                                   };
    static const QString pluralnames[] = {
                                             tr("sixty-fourth notes"), tr("thirty-second notes"),
                                             tr("sixteenth notes"), tr("eighth notes"),
                                             tr("quarter notes"), tr("half notes"),
                                             tr("whole notes"), tr("double whole notes")
                                         };

    if (plural && triplet) {
        return addDots(tr("%1 triplets").arg(names[type].toStdString().c_str()), dots, false, true); // TODO PLURAL - this is broken because it assumes there's only 1 plural form
    } else if (plural) {
        return addDots(pluralnames[type], dots, false, true);
    } else if (triplet) {
        return addDots(tr("%1 triplet").arg(names[type].toStdString().c_str()), dots, false, true);
    } else {
        return addDots(names[type], dots, false, true);
    }
}
Ejemplo n.º 4
0
QString
NotationStrings::getShortNoteName(Note note, bool plural, bool triplet)
{
    Note::Type type = note.getNoteType();
    int dots = note.getDots();

    static const QString names[] = {
        tr("64th"), tr("32nd"), tr("16th"), tr("8th"),
        tr("quarter"), tr("half"), tr("whole"),
        tr("double whole")
    };
    static const QString pluralnames[] = {
        tr("64ths"), tr("32nds"), tr("16ths"), tr("8ths"),
        tr("quarters"), tr("halves"), tr("wholes"),
        tr("double wholes")
    };

    if (plural && triplet) {
        return addDots(tr("%1 triplets").arg(names[type]), dots, false, true); // TODO - this is broken because it assumes there's only 1 plural form
    } else if (plural) {
        return addDots(pluralnames[type], dots, false, true);
    } else if (triplet) {
        return addDots(tr("%1 triplet").arg(names[type]), dots, false, true);
    } else {
        return addDots(names[type], dots, false, true);
    }
}
Ejemplo n.º 5
0
QString
NotationStrings::getReferenceName(Note note, bool isRest)
{
    Note::Type type = note.getNoteType();
    int dots = note.getDots();

    static const QString names[] = {
        "hemidemisemi", "demisemi", "semiquaver",
        "quaver", "crotchet", "minim", "semibreve", "breve"
    };

    QString name(names[type]);
    if (isRest) name = "rest-" + name;
    return addDots(name, dots, true, false);
}
Ejemplo n.º 6
0
//ノートからナビフラグが立っているか調べる
bool Navigator::checkNaviFlag(){
	for(int i=0;i<getNoteArrayCount();i++){
		Note* note = dynamic_cast<Note*>( mNoteArray->objectAtIndex(i) );
		Note::NoteType type = note->getNoteType();
		NoteTap* noteTap;
		NoteHold* noteHold;
		switch (type){
			case Note::TAP:
				noteTap = dynamic_cast<NoteTap*>(note);
				return noteTap->mNaviFlag;
			case Note::HOLD:
				noteHold = dynamic_cast<NoteHold*>(note);
				return noteHold->mNaviFlag;
		}
	}
	return false;
}