Example #1
0
bool operator==(const Chord &c1, const Chord &c2)
{
    if (c1.getChordText() != c2.getChordText())
        return false;

    if (c1.getBeat() != c2.getBeat())
        return false;

    return true;
}
Example #2
0
int ChordsPanel::getEstimatedChordDuration(const Chord &chord,
                                           const ChordProgressionMeasure &measure) const
{
    int chordsInMeasure = measure.getChords().size();
    if (chordsInMeasure <= 2)// only one or two chords in the measure?
        return measure.getBeats()/chordsInMeasure;
    if (chordsInMeasure == 3 && measure.getBeats() == 4) {
        if (chord.getBeat() == 0)// first chord in the progression
            return 2;// the first chord will ocuppy 2 slots
        else
            return 1;// the last chords are 1 beat chords
    }
    return measure.getBeats();
}