Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / camd / getmidiattrsa.c
blob9807441877095133d8ef695894f1ed709371bf89
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
8 #include <proto/utility.h>
9 #include <proto/exec.h>
11 #include "camd_intern.h"
14 /*****************************************************************************
16 NAME */
18 AROS_LH2(ULONG, GetMidiAttrsA,
20 /* SYNOPSIS */
21 AROS_LHA(struct MidiNode *, midinode, A0),
22 AROS_LHA(struct TagItem *, tags, A1),
24 /* LOCATION */
25 struct CamdBase *, CamdBase, 10, Camd)
27 /* FUNCTION
29 INPUTS
31 RESULT
33 NOTES
34 If you are not the owner of the midinode, you should lock
35 Camd before calling to ensure that it wont go away.
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 SetMidiAttrsA()
44 INTERNALS
46 HISTORY
47 2001-01-12 ksvalast first created
48 2007-07-01 Lyle Hazelwood fixed Tag <-> Data bug.
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 struct TagItem *tag;
56 const struct TagItem *tstate=tags;
57 ULONG *where;
58 ULONG ret=0;
60 ObtainSemaphoreShared(CB(CamdBase)->CLSemaphore);
62 while((tag=NextTagItem(&tstate))){
63 ret++;
64 where=(ULONG *)tag->ti_Data;
65 switch(tag->ti_Tag){
66 case MIDI_Name:
67 *where=(ULONG)midinode->mi_Node.ln_Name;
68 break;
69 case MIDI_SignalTask:
70 *where=(ULONG)midinode->mi_SigTask;
71 break;
72 case MIDI_RecvHook:
73 *where=(ULONG)midinode->mi_ReceiveHook;
74 break;
75 case MIDI_PartHook:
76 *where=(ULONG)midinode->mi_ParticipantHook;
77 break;
78 case MIDI_RecvSignal:
79 *where=(ULONG)midinode->mi_ReceiveSigBit;
80 break;
81 case MIDI_PartSignal:
82 *where=(ULONG)midinode->mi_ParticipantSigBit;
83 break;
84 case MIDI_MsgQueue:
85 *where=(ULONG)midinode->mi_MsgQueueSize;
86 break;
87 case MIDI_SysExSize:
88 *where=(ULONG)midinode->mi_SysExQueueSize;
89 break;
90 case MIDI_TimeStamp:
91 *where=(ULONG)midinode->mi_TimeStamp;
92 break;
93 case MIDI_ErrFilter:
94 *where=(ULONG)midinode->mi_ErrFilter;
95 break;
96 case MIDI_ClientType:
97 *where=(ULONG)midinode->mi_ClientType;
98 break;
99 case MIDI_Image:
100 *where=(ULONG)midinode->mi_Image;
101 break;
102 default:
103 ret--;
104 break;
108 ReleaseSemaphore(CB(CamdBase)->CLSemaphore);
110 return ret;
112 AROS_LIBFUNC_EXIT
116 #ifdef __amigaos4__
117 #include <stdarg.h>
118 ULONG VARARGS68K GetMidiAttrs(
119 struct CamdIFace *Self,
120 struct MidiNode * mi,
124 va_list ap;
125 struct TagItem * varargs;
126 va_startlinear(ap, mi);
127 varargs = va_getlinearva(ap, struct TagItem *);
128 return Self->GetMidiAttrsA(
130 varargs);
132 #endif