Beispiel #1
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);
    }
}
Beispiel #2
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);
    }
}
Beispiel #3
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);
    }
}
Beispiel #4
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);
}