zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 972bdaede37764d642f65655382b14d7b0fde0dd
parent ceab4c1c4e953dd611132e45026221a02dacaeb6
Author: michiboo <chanmickyyun@gmail.com>
Date:   Mon, 15 Jul 2019 13:05:22 +0300

add trigger active to header

Diffstat:
Msrc/Synth/WatchPoint.cpp | 3++-
Msrc/Synth/WatchPoint.h | 1+
Msrc/Tests/AdNoteTest.h | 7++++---
3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/Synth/WatchPoint.cpp b/src/Synth/WatchPoint.cpp @@ -149,7 +149,8 @@ bool WatchManager::trigger_active(const char *id) const for(int i=0; i<MAX_WATCH; ++i) if(!strcmp(active_list[i], id)) if(trigger[i]) - return true + return true; + return false; } int WatchManager::samples(const char *id) const diff --git a/src/Synth/WatchPoint.h b/src/Synth/WatchPoint.h @@ -50,6 +50,7 @@ struct WatchManager void add_watch(const char *); void del_watch(const char *); void tick(void); + bool trigger_active(const char *) const; //Watch Point Query API bool active(const char *) const; diff --git a/src/Tests/AdNoteTest.h b/src/Tests/AdNoteTest.h @@ -137,7 +137,7 @@ class AdNoteTest:public CxxTest::TestSuite TS_ASSERT_DELTA(outL[255], -0.4688f, 0.0001f); w->tick(); TS_ASSERT(!tr->hasNext()); - + note->noteout(outL, outR); sampleCount += synth->buffersize; w->tick(); @@ -147,12 +147,12 @@ class AdNoteTest:public CxxTest::TestSuite sampleCount += synth->buffersize; TS_ASSERT_DELTA(outL[255], 0.0971f, 0.0001f); w->tick(); - note->noteout(outL, outR); sampleCount += synth->buffersize; TS_ASSERT_DELTA(outL[255], -0.0901f, 0.0001f); + TS_ASSERT(!w->trigger_active("/part0/kit0/adpars/noteout")); w->tick(); - + TS_ASSERT(tr->hasNext()); TS_ASSERT_EQUALS(string("noteout"), tr->read()); TS_ASSERT(!tr->hasNext()); @@ -160,6 +160,7 @@ class AdNoteTest:public CxxTest::TestSuite note->noteout(outL, outR); sampleCount += synth->buffersize; + while(!note->finished()) { note->noteout(outL, outR); #ifdef WRITE_OUTPUT