23#ifndef AUDIO_ENGINE_TESTS_H
24#define AUDIO_ENGINE_TESTS_H
103#ifdef H2CORE_HAVE_JACK
108 static void testTransportProcessingJack();
114 static void testTransportProcessingOffsetsJack();
119 static void testTransportRelocationJack();
125 static void testTransportRelocationOffsetsJack();
129 static int jackTestProcessCallback( uint32_t nFrames,
void* args );
139 long long* nLastLookahead,
140 long long* nLastTransportFrame,
141 long long* nTotalFrames,
142 long* nLastPlayheadTick,
143 double* fLastTickIntervalEnd,
144 bool bCheckLookahead =
true );
161 const std::vector<std::shared_ptr<Note>> newNotes,
162 const QString& sContext,
164 bool bTestAudio =
true,
165 float fPassedTicks = 0.0 );
178 static void mergeQueues( std::vector<std::shared_ptr<Note>>* noteList,
179 std::vector<std::shared_ptr<Note>> newNotes );
180 static void mergeQueues( std::vector<std::shared_ptr<Note>>* noteList,
181 std::vector<Note*> newNotes );
185#ifdef H2CORE_HAVE_JACK
186 static void stopJackAudioDriver();
188 double fTick,
long long nFrame );
Defined in here since it requires access to methods and variables private to the AudioEngine class.
static std::vector< std::shared_ptr< Note > > copySongNoteQueue()
static void testTransportProcessingTimeline()
More detailed test of the transport and playhead integrity in case Timeline/tempo markers are involve...
static void testUpdateTransportPosition()
Checks is reproducible and works even without any song set.
static void testLoopMode()
Unit test checking that loop mode as well as deactivating it works.
static void testSongSizeChange()
Unit test checking consistency of transport position when playback was looped at least once and the s...
static void toggleAndCheckConsistency(int nToggleColumn, int nToggleRow, const QString &sContext)
Toggles the grid cell defined by nToggleColumn and nToggleRow twice and checks whether the transport ...
static void testNoteEnqueuing()
Unit test checking that all notes in a song are picked up once.
static void checkTransportPosition(std::shared_ptr< TransportPosition > pPos, const QString &sContext)
Checks the consistency of the transport position pPos by converting the current tick,...
static void testTransportRelocation()
Unit test checking the relocation of the transport position in audioEngine_process().
static void testTransportProcessing()
Unit test checking the incremental update of the transport position in audioEngine_process().
static void testNoteEnqueuingTimeline()
Checks whether the order of notes enqueued and processed by the Sampler is consistent on tempo change...
static void testSongSizeChangeInLoopMode()
Unit test checking consistency of transport position when playback was looped at least once and the s...
static void resetSampler(const QString &sContext)
static int processTransport(const QString &sContext, int nFrames, long long *nLastLookahead, long long *nLastTransportFrame, long long *nTotalFrames, long *nLastPlayheadTick, double *fLastTickIntervalEnd, bool bCheckLookahead=true)
static void mergeQueues(std::vector< std::shared_ptr< Note > > *noteList, std::vector< std::shared_ptr< Note > > newNotes)
Add every Note in newNotes not yet contained in noteList to the latter.
static void throwException(const QString &sMsg)
static void testFrameToTickConversion()
Unit test checking for consistency when converting frames to ticks and back.
static void testHumanization()
Unit test checking that custom note properties take effect and that humanization works as expected.
static void checkAudioConsistency(const std::vector< std::shared_ptr< Note > > oldNotes, const std::vector< std::shared_ptr< Note > > newNotes, const QString &sContext, int nPassedFrames, bool bTestAudio=true, float fPassedTicks=0.0)
Takes two instances of Sampler::m_playingNotesQueue and checks whether matching notes have exactly nP...
JACK (Jack Audio Connection Kit) server driver.
Timebase
Whether Hydrogen or another program is in Timebase control.
Object holding most of the information about the transport state of the AudioEngine.