2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 #include <proto/utility.h>
7 #include <proto/exec.h>
9 # include <proto/camd.h>
12 #include "camd_intern.h"
16 /*****************************************************************************
20 AROS_LH1(struct MidiNode
*, CreateMidiA
,
23 AROS_LHA(struct TagItem
*, tags
, A0
),
26 struct CamdBase
*, CamdBase
, 7, Camd
)
31 tags - Tag-values supplied to SetMidiAttrs.
46 *****************************************************************************/
50 struct MyMidiNode
*midinode
;
53 midinode
=AllocMem(sizeof(struct MyMidiNode
),MEMF_ANY
| MEMF_CLEAR
| MEMF_PUBLIC
);
54 if(midinode
==NULL
) return NULL
;
57 NEWLIST((struct List
*)&midinode
->midinode
.mi_OutLinks
);
58 NEWLIST((struct List
*)&midinode
->midinode
.mi_InLinks
);
60 NEWMINLIST(midinode
->midinode
.mi_OutLinks
);
61 NEWMINLIST(midinode
->midinode
.mi_InLinks
);
64 midinode
->midinode
.mi_Node
.ln_Name
="unnamed";
66 midinode
->midinode
.mi_SigTask
=FindTask(0);
68 midinode
->midinode
.mi_ReceiveSigBit
=-1;
69 midinode
->midinode
.mi_ParticipantSigBit
=-1;
71 midinode
->midinode
.mi_TimeStamp
=&midinode
->dummytimestamp
;
73 InitSemaphore(&midinode
->receiversemaphore
);
74 InitSemaphore(&midinode
->sysexsemaphore
);
75 InitSemaphore(&midinode
->sysexsemaphore2
);
78 if(!SetMidiAttrsA(&midinode
->midinode
,tags
))
80 if(!SetMidiAttrsA(ICamd
, &midinode
->midinode
,tags
))
83 FreeMem(midinode
,sizeof(struct MyMidiNode
));
87 ObtainSemaphore(CB(CamdBase
)->CLSemaphore
);
88 AddHead(&CB(CamdBase
)->mymidinodes
,&midinode
->midinode
.mi_Node
);
89 ReleaseSemaphore(CB(CamdBase
)->CLSemaphore
);
91 return (struct MidiNode
*)midinode
;
100 struct MidiNode
* VARARGS68K
CreateMidi(
101 struct CamdIFace
*Self
,
106 struct TagItem
* varargs
;
107 va_startlinear(ap
, Self
);
108 varargs
= va_getlinearva(ap
, struct TagItem
*);
110 return CreateMidiA(Self
,