Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / camd / getmidilinkattrsa.c
blobc71dcfa16cdb1fc6afb80b0afdf4ea7296a76f25
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
7 #include <proto/utility.h>
8 #include <proto/exec.h>
10 #include "camd_intern.h"
12 /*****************************************************************************
14 NAME */
16 AROS_LH2(ULONG, GetMidiLinkAttrsA,
18 /* SYNOPSIS */
19 AROS_LHA(struct MidiLink *, midilink, A0),
20 AROS_LHA(struct TagItem *, tags, A1),
22 /* LOCATION */
23 struct CamdBase *, CamdBase, 17, Camd)
25 /* FUNCTION
26 Remind me to fill in things here later.
28 INPUTS
30 RESULT
32 NOTES
33 If you are not the owner of the midilink, you should lock
34 Camd before calling to ensure that it wont go away.
35 Theres no point in locking if you know it wont go away.
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 SetMidiLinkAttrsA()
44 INTERNALS
46 HISTORY
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 struct TagItem *tag;
53 struct TagItem *tstate=tags;
54 IPTR *where;
55 ULONG ret=0;
57 ObtainSemaphoreShared(CB(CamdBase)->CLSemaphore);
59 while((tag=NextTagItem(&tstate))){
60 ret++;
61 where=(IPTR *)tag->ti_Data;
62 switch(tag->ti_Tag){
63 case MLINK_Name:
64 *where=(IPTR)midilink->ml_Node.ln_Name;
65 break;
66 case MLINK_Location:
67 *where=(IPTR)midilink->ml_Location->mcl_Node.ln_Name;
68 break;
69 case MLINK_ChannelMask:
70 *where=(IPTR)midilink->ml_ChannelMask;
71 break;
72 case MLINK_EventMask:
73 *where=(IPTR)midilink->ml_EventTypeMask;
74 break;
75 case MLINK_UserData:
76 *where=(IPTR)midilink->ml_UserData;
77 break;
78 case MLINK_Comment:
79 ret--;
80 break;
81 case MLINK_PortID:
82 *where=(IPTR)midilink->ml_PortID;
83 break;
84 case MLINK_Private:
85 *where=(IPTR)midilink->ml_Flags&MLF_PrivateLink;
86 break;
87 case MLINK_Priority:
88 *where=(IPTR)midilink->ml_Node.ln_Pri;
89 break;
90 case MLINK_SysExFilter:
91 *where=(IPTR)midilink->ml_SysExFilter.sxf_Packed;
92 break;
93 case MLINK_SysExFilterX:
94 *where=(IPTR)midilink->ml_SysExFilter.sxf_Packed;
95 break;
96 case MLINK_Parse:
97 *where=(IPTR)midilink->ml_ParserData==0?FALSE:TRUE;
98 break;
99 default:
100 ret--;
101 break;
105 ReleaseSemaphore(CB(CamdBase)->CLSemaphore);
107 return ret;
110 AROS_LIBFUNC_EXIT
114 #ifdef __amigaos4__
115 #include <stdarg.h>
116 ULONG VARARGS68K GetMidiLinkAttrs(
117 struct CamdIFace *Self,
118 struct MidiLink * ml,
122 va_list ap;
123 struct TagItem * varargs;
124 va_startlinear(ap, ml);
125 varargs = va_getlinearva(ap, struct TagItem *);
126 return Self->GetMidiLinkAttrsA(
128 varargs);
130 #endif