aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/dyn/dyn_conn.cpp
blob: 4300062ca1e226b95b2e8003dcd360a55b9bf662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* 
dyn - dynamical object management

Copyright (c)2003-2004 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  
*/

#include "dyn_proto.h"

dyn_conn::~dyn_conn()
{
    dyn_patchable *sobj = NULL,*dobj = NULL;
    if(src != DYN_ID_NONE && (sobj = src->Patchable()))
        sobj->RmvOutlet(this);

    if(dst != DYN_ID_NONE && (dobj = dst->Patchable()))
        dobj->RmvInlet(this);

    if(sobj || dobj) {
        src = dst = DYN_ID_NONE; 
        ident->Callback(DYN_SIGNAL_DISCONN);
    }

    if(sobj && dobj) {
//        sys_lock();
        obj_disconnect((t_object *)sobj->pdobj,slet,(t_object *)dobj->pdobj,dlet);
//        sys_unlock();
    }
}

/*
void dyn_conn::Invalidate() 
{ 
    if(src != DYN_ID_NONE || dst != DYN_ID_NONE) {
        src = dst = DYN_ID_NONE; 
        ident->Callback(DYN_SIGNAL_DISCONN);
    }
}
*/