added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / libs / realtime / getplayerattrsa.c
blobad2b384e563ed0074ccaeb0dc72b9f8b790aab56
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
7 #include <proto/realtime.h>
8 #include <proto/utility.h>
9 #include "realtime_intern.h"
11 /*****************************************************************************
13 NAME */
15 #include <utility/tagitem.h>
16 #include <libraries/realtime.h>
18 AROS_LH2(BOOL, GetPlayerAttrsA,
20 /* SYNOPSIS */
22 AROS_LHA(struct Player *, player , A0),
23 AROS_LHA(struct TagItem *, tagList, A1),
25 /* LOCATION */
27 struct Library *, RealTimeBase, 14, RealTime)
29 /* FUNCTION
31 Query the attributes of a player. For each tagitem ti_Tag specifies the
32 attribute and ti_Data a pointer to the IPTR variable in which you want
33 the value to be stored.
35 INPUTS
37 player -- The player the attributes of which to set; may be NULL,
38 in which case the result is 0.
39 tagList -- Pointer to an array of tags describing the player's
40 attributes or NULL.
42 TAGS
44 See CreatePlayerA().
46 RESULT
48 The number of items successfully filled in.
50 NOTES
52 EXAMPLE
54 BUGS
56 SEE ALSO
58 CreatePlayer(), SetPlayerAttrs()
60 INTERNALS
62 ******************************************************************************/
64 #define Put (*((IPTR *)(tag->ti_Data)))
67 AROS_LIBFUNC_INIT
69 int nAttrs = 0;
70 struct TagItem *tag, *tl = tagList;
72 /* Maybe we could use FindTagItem to initialize error and conductor
73 first... */
75 if (player != NULL)
77 while ((tag = NextTagItem(&tl)) != NULL)
79 switch (tag->ti_Tag)
81 case PLAYER_Name:
82 Put = (IPTR)player->pl_Link.ln_Name;
83 break;
85 case PLAYER_Hook:
86 Put = (IPTR)player->pl_Hook;
87 break;
89 case PLAYER_Priority:
90 Put = (IPTR)player->pl_Link.ln_Pri;
91 break;
93 case PLAYER_Conductor:
94 Put = (IPTR)player->pl_Source;
95 break;
97 case PLAYER_Ready:
98 Put = (player->pl_Flags & PLAYERF_READY) != 0;
99 break;
101 case PLAYER_AlarmTime:
102 Put = player->pl_AlarmTime;
103 break;
105 case PLAYER_Alarm:
106 Put = (player->pl_Flags & PLAYERF_ALARMSET) != 0;
107 break;
109 case PLAYER_AlarmSigTask:
110 Put = (IPTR)player->pl_Task;
111 break;
113 case PLAYER_AlarmSigBit:
114 /* We could use player->pl_Link.mn_Type here */
115 Put = player->pl_Reserved0; /* NOTE! */
116 break;
118 case PLAYER_Quiet:
119 Put = (player->pl_Flags & PLAYERF_QUIET) != 0;
120 break;
122 case PLAYER_UserData:
123 Put = (IPTR)player->pl_UserData;
124 break;
126 case PLAYER_ID:
127 Put = player->pl_PlayerID;
128 break;
130 case PLAYER_Conducted:
131 Put = (player->pl_Flags & PLAYERF_CONDUCTED) != 0;
132 break;
134 case PLAYER_ExtSync:
135 Put = (player->pl_Flags & PLAYERF_EXTSYNC) != 0;
136 break;
139 nAttrs++;
143 return nAttrs;
145 AROS_LIBFUNC_EXIT
146 } /* GetPlayerAttrsA */