Merge branch 'stable-1.2'
# Conflicts: # .travis/linux..before_install.sh # .travis/linux..install.sh # .travis/linux..script.sh # cmake/linux/package_linux.sh.in # include/AudioWeakJack.def # plugins/vst_base/CMakeLists.txt # plugins/zynaddsubfx/zynaddsubfx
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
#include "AutomationTrack.h"
|
||||
#include "BBTrack.h"
|
||||
#include "BBTrackContainer.h"
|
||||
#include "DetuningHelper.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "Pattern.h"
|
||||
#include "TrackContainer.h"
|
||||
|
||||
#include "Engine.h"
|
||||
@@ -105,6 +108,55 @@ private slots:
|
||||
QCOMPARE(song->automatedValuesAt(150)[&model], 0.5f);
|
||||
}
|
||||
|
||||
void testLengthRespected()
|
||||
{
|
||||
FloatModel model;
|
||||
|
||||
auto song = Engine::getSong();
|
||||
AutomationTrack track(song);
|
||||
|
||||
AutomationPattern p(&track);
|
||||
p.setProgressionType(AutomationPattern::LinearProgression);
|
||||
p.addObject(&model);
|
||||
|
||||
p.putValue(0, 0.0, false);
|
||||
p.putValue(100, 1.0, false);
|
||||
|
||||
p.changeLength(100);
|
||||
QCOMPARE(song->automatedValuesAt( 0)[&model], 0.0f);
|
||||
QCOMPARE(song->automatedValuesAt( 50)[&model], 0.5f);
|
||||
QCOMPARE(song->automatedValuesAt(100)[&model], 1.0f);
|
||||
|
||||
p.changeLength(50);
|
||||
QCOMPARE(song->automatedValuesAt( 0)[&model], 0.0f);
|
||||
QCOMPARE(song->automatedValuesAt( 50)[&model], 0.5f);
|
||||
QCOMPARE(song->automatedValuesAt(100)[&model], 0.5f);
|
||||
}
|
||||
|
||||
void testInlineAutomation()
|
||||
{
|
||||
auto song = Engine::getSong();
|
||||
|
||||
InstrumentTrack* instrumentTrack =
|
||||
dynamic_cast<InstrumentTrack*>(Track::create(Track::InstrumentTrack, song));
|
||||
|
||||
Pattern* notePattern = dynamic_cast<Pattern*>(instrumentTrack->createTCO(0));
|
||||
notePattern->changeLength(MidiTime(4, 0));
|
||||
Note* note = notePattern->addNote(Note(MidiTime(4, 0)), false);
|
||||
note->createDetuning();
|
||||
|
||||
DetuningHelper* dh = note->detuning();
|
||||
auto pattern = dh->automationPattern();
|
||||
pattern->setProgressionType( AutomationPattern::LinearProgression );
|
||||
pattern->putValue(MidiTime(0, 0), 0.0);
|
||||
pattern->putValue(MidiTime(4, 0), 1.0);
|
||||
|
||||
QCOMPARE(pattern->valueAt(MidiTime(0, 0)), 0.0f);
|
||||
QCOMPARE(pattern->valueAt(MidiTime(1, 0)), 0.25f);
|
||||
QCOMPARE(pattern->valueAt(MidiTime(2, 0)), 0.5f);
|
||||
QCOMPARE(pattern->valueAt(MidiTime(4, 0)), 1.0f);
|
||||
}
|
||||
|
||||
void testBBTrack()
|
||||
{
|
||||
auto song = Engine::getSong();
|
||||
|
||||
Reference in New Issue
Block a user