2013-05-26 01:19:09 +02:00
|
|
|
#ifndef IMPORTMIDI_METER_H
|
|
|
|
#define IMPORTMIDI_METER_H
|
|
|
|
|
|
|
|
|
|
|
|
namespace Ms {
|
|
|
|
|
2013-08-17 00:57:42 +02:00
|
|
|
class ReducedFraction;
|
2013-05-26 01:19:09 +02:00
|
|
|
class TDuration;
|
2013-07-04 12:28:51 +02:00
|
|
|
|
|
|
|
namespace MidiTuplet {
|
2013-06-11 23:14:05 +02:00
|
|
|
struct TupletData;
|
2013-07-04 12:28:51 +02:00
|
|
|
}
|
2013-05-26 01:19:09 +02:00
|
|
|
|
|
|
|
namespace Meter {
|
|
|
|
|
2014-05-21 18:52:58 +02:00
|
|
|
enum class DurationType : char
|
2013-05-26 01:19:09 +02:00
|
|
|
{
|
|
|
|
NOTE,
|
|
|
|
REST
|
|
|
|
};
|
|
|
|
|
2013-08-17 00:57:42 +02:00
|
|
|
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
|
|
|
|
2013-08-17 00:57:42 +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;
|
|
|
|
|
2013-08-17 00:57:42 +02:00
|
|
|
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
|
2013-08-17 00:57:42 +02:00
|
|
|
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
|
2013-08-17 00:57:42 +02:00
|
|
|
QList<std::pair<ReducedFraction, TDuration> >
|
|
|
|
toDurationList(const ReducedFraction &startTickInBar,
|
|
|
|
const ReducedFraction &endTickInBar,
|
|
|
|
const ReducedFraction &barFraction,
|
2013-07-04 12:28:51 +02:00
|
|
|
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
|