MCPcopy Create free account
hub / github.com/csound/csound / killInstance

Function killInstance

Engine/insert.c:2684–2720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2682 int allow_release);
2683
2684void killInstance(CSOUND *csound, MYFLT instr, int insno, INSDS *ip,
2685 int mode, int allow_release) {
2686 INSDS *ip2 = NULL, *nip;
2687 do { /* This loop does not terminate in mode=0 */
2688 nip = ip->nxtact;
2689 if (((mode & 8) && ip->offtim >= 0.0) ||
2690 ((mode & 4) && ip->p1.value != instr) ||
2691 (allow_release && ip->relesing)) {
2692 ip = nip;
2693 continue;
2694 }
2695 if (!(mode & 3)) {
2696 if (allow_release) {
2697 xturnoff(csound, ip);
2698 }
2699 else {
2700 nip = ip->nxtact;
2701 xturnoff_now(csound, ip);
2702 }
2703 }
2704 else {
2705 ip2 = ip;
2706 if ((mode & 3) == 1)
2707 break;
2708 }
2709 ip = nip;
2710 } while (ip != NULL && (int) ip->insno == insno);
2711
2712 if (ip2 != NULL) {
2713 if (allow_release) {
2714 xturnoff(csound, ip2);
2715 }
2716 else {
2717 xturnoff_now(csound, ip2);
2718 }
2719 }
2720}
2721
2722int csoundKillInstanceInternal(CSOUND *csound, MYFLT instr, char *instrName,
2723 int mode, int allow_release, int async)

Callers 2

message_dequeueFunction · 0.85

Calls 2

xturnoffFunction · 0.85
xturnoff_nowFunction · 0.85

Tested by

no test coverage detected