added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / camd / getmidiattrsa.c
blob3a3a66ef4bdc0af1ba73312f598797a19b0d96d6
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
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 struct TagItem *tag;
53 const struct TagItem *tstate=tags;
54 ULONG *where;
55 ULONG ret=0;
57 ObtainSemaphoreShared(CB(CamdBase)->CLSemaphore);
59 while((tag=NextTagItem(&tstate))){
60 ret++;
61 where=(ULONG *)tag->ti_Tag;
62 switch(tag->ti_Tag){
63 case MIDI_Name:
64 *where=(ULONG)midinode->mi_Node.ln_Name;
65 break;
66 case MIDI_SignalTask:
67 *where=(ULONG)midinode->mi_SigTask;
68 break;
69 case MIDI_RecvHook:
70 *where=(ULONG)midinode->mi_ReceiveHook;
71 break;
72 case MIDI_PartHook:
73 *where=(ULONG)midinode->mi_ParticipantHook;
74 break;
75 case MIDI_RecvSignal:
76 *where=(ULONG)midinode->mi_ReceiveSigBit;
77 break;
78 case MIDI_PartSignal:
79 *where=(ULONG)midinode->mi_ParticipantSigBit;
80 break;
81 case MIDI_MsgQueue:
82 *where=(ULONG)midinode->mi_MsgQueueSize;
83 break;
84 case MIDI_SysExSize:
85 *where=(ULONG)midinode->mi_SysExQueueSize;
86 break;
87 case MIDI_TimeStamp:
88 *where=(ULONG)midinode->mi_TimeStamp;
89 break;
90 case MIDI_ErrFilter:
91 *where=(ULONG)midinode->mi_ErrFilter;
92 break;
93 case MIDI_ClientType:
94 *where=(ULONG)midinode->mi_ClientType;
95 break;
96 case MIDI_Image:
97 *where=(ULONG)midinode->mi_Image;
98 break;
99 default:
100 ret--;
101 break;
105 ReleaseSemaphore(CB(CamdBase)->CLSemaphore);
107 return ret;
109 AROS_LIBFUNC_EXIT
113 #ifdef __amigaos4__
114 #include <stdarg.h>
115 ULONG VARARGS68K GetMidiAttrs(
116 struct CamdIFace *Self,
117 struct MidiNode * mi,
121 va_list ap;
122 struct TagItem * varargs;
123 va_startlinear(ap, mi);
124 varargs = va_getlinearva(ap, struct TagItem *);
125 return Self->GetMidiAttrsA(
127 varargs);
129 #endif