Esempio n. 1
0
// Called every frame
void UMMLComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	if(isLoaded)
		mml_fetch(&mml);
}
Esempio n. 2
0
Pattern *MMLReader::read(const char *text)
{
    pattern = new Pattern();
    currentPosition = Position(1, 0, 1);
    TimeSignature &time = AudioEngine::instance().getTimeSignature();
    if(time.isValid()) {
        ticksPerBar = mmlopt.bticks * time.getNumerator() * 4 / time.getDenominator();
    } else {
        ticksPerBar = mmlopt.bticks * 4;
    }
    mml_setup(&mml, &mmlopt, (char *)text);
    while (mml_fetch(&mml) == MML_RESULT_OK) {}
    return pattern;
}