MuseScore/mscore/importmidi_meter.h

59 lines
1.7 KiB
C
Raw Normal View History

2013-05-26 01:19:09 +02:00
#ifndef IMPORTMIDI_METER_H
#define IMPORTMIDI_METER_H
namespace Ms {
class ReducedFraction;
2013-05-26 01:19:09 +02:00
class TDuration;
namespace MidiTuplet {
2013-06-11 23:14:05 +02:00
struct TupletData;
}
2013-05-26 01:19:09 +02:00
namespace Meter {
enum class DurationType
{
NOTE,
REST
};
bool isSimple(const ReducedFraction &barFraction);
bool isCompound(const ReducedFraction &barFraction);
bool isComplex(const ReducedFraction &barFraction);
bool isDuple(const ReducedFraction &barFraction);
bool isTriple(const ReducedFraction &barFraction);
bool isQuadruple(const ReducedFraction &barFraction);
2013-08-27 11:20:29 +02:00
bool isQuintuple(const ReducedFraction &barFraction);
bool isSeptuple(const ReducedFraction &barFraction);
2013-05-26 01:19:09 +02:00
ReducedFraction beatLength(const ReducedFraction &barFraction);
2013-06-02 01:06:41 +02:00
2013-07-14 11:48:47 +02:00
struct DivisionInfo;
DivisionInfo metricDivisionsOfBar(const ReducedFraction &barFraction);
2013-07-14 11:48:47 +02:00
DivisionInfo metricDivisionsOfTuplet(const MidiTuplet::TupletData &tuplet,
int tupletStartLevel);
2013-08-20 13:31:10 +02:00
bool isSimpleNoteDuration(const ReducedFraction &duration); // quarter, half, eighth, 16th ...
2013-06-11 23:14:05 +02:00
// division lengths of bar, each can be a tuplet length
std::vector<ReducedFraction> divisionsOfBarForTuplets(const ReducedFraction &barFraction);
2013-06-02 01:06:41 +02:00
2013-06-11 23:14:05 +02:00
// duration and all tuplets should belong to the same voice
2013-07-03 23:54:54 +02:00
// nested tuplets are not allowed
QList<std::pair<ReducedFraction, TDuration> >
toDurationList(const ReducedFraction &startTickInBar,
const ReducedFraction &endTickInBar,
const ReducedFraction &barFraction,
const std::vector<MidiTuplet::TupletData> &tupletsInBar,
2013-07-03 23:54:54 +02:00
DurationType durationType,
bool useDots);
2013-05-26 01:19:09 +02:00
} // namespace Meter
} // namespace Ms
#endif // IMPORTMIDI_METER_H