2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
11 #include <proto/exec.h>
13 #include "camd_intern.h"
15 /*****************************************************************************
19 AROS_LH1(BOOL
, MidiLinkConnected
,
22 AROS_LHA(struct MidiLink
*, midilink
, A0
),
25 struct CamdBase
*, CamdBase
, 20, Camd
)
28 If midilink is a sender, returns FALSE if the cluster has no
29 receivers. If midilink is a receiver, returns FALSE if the
30 cluster has no senders. Else TRUE.
33 midilink - pointer to midilink we want to check.
49 2001-01-12 ksvalast first created
51 *****************************************************************************/
57 struct MyMidiCluster
*mycluster
=(struct MyMidiCluster
*)midilink
->ml_Location
;
58 int type
=midilink
->ml_Node
.ln_Type
;
60 if(type
==NT_USER
-MLTYPE_Sender
){
61 ObtainSemaphoreShared(&mycluster
->semaphore
);
62 if(IsListEmpty(&midilink
->ml_Location
->mcl_Receivers
)) ret
=FALSE
;
63 ReleaseSemaphore(&mycluster
->semaphore
);
65 ObtainSemaphoreShared(CB(CamdBase
)->CLSemaphore
);
66 if(IsListEmpty(&midilink
->ml_Location
->mcl_Senders
)) ret
=FALSE
;
67 ReleaseSemaphore(CB(CamdBase
)->CLSemaphore
);