alsa.audio: limit the supported frequencies to common set
[AROS.git] / workbench / libs / asl / asl_init.c
blob48be671d6118dececd357949b6bbac0570485e1e
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
5 ASL initialization code.
6 */
9 #include <stddef.h>
10 #include <exec/libraries.h>
11 #include <exec/lists.h>
12 #include <exec/resident.h>
13 #include <aros/libcall.h>
14 #include <aros/asmcall.h>
15 #include <aros/symbolsets.h>
16 #include <intuition/screens.h>
17 #include <graphics/modeid.h>
19 #include <proto/dos.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
23 #include "asl_intern.h"
24 #include LC_LIBDEFS_FILE
26 #define CATCOMP_NUMBERS
27 #include "strings.h"
29 #define DEBUG 0
30 #include <aros/debug.h>
32 /*****************************************************************************************/
34 /* Requester type specific default data */
35 const struct IntFileReq def_filereq =
38 ASL_FileRequest,
39 NULL, /* Window */
40 NULL, /* Screen */
41 NULL, /* PubScreenName */
42 NULL, /* IntuiMsgFunc */
43 NULL, /* TextAttr */
44 NULL, /* Locale */
45 NULL, /* Catalog */
46 NULL, /* MemPool */
47 2048, /* MemPoolPuddle */
48 2048, /* MemPoolThresh */
49 MSG_FILEREQ_TITLE, /* TitleID */
50 NULL, /* TitleText */
51 NULL, /* PositiveText */
52 NULL, /* NegativeText */
53 -1, -1, /* --> center on screen */
54 300, 300 /* Width/Height */
57 "", /* File */
58 "", /* Drawer */
59 "#?", /* Pattern */
60 NULL, /* AcceptPattern */ /* def. = "#?", but must be ParsePatternNoCase'ed */
61 NULL, /* RejectPattern */ /* def. = "~(#?)", but must be ParsePatternNoCase'ed */
62 0, /* Flags1 */
63 0, /* Flags2 */
64 NULL, /* FilterFunc */
65 NULL, /* HookFunc */
66 NULL, /* GetSortBy */
67 NULL, /* GetSortOrder */
68 NULL, /* GetSortDrawers */
69 ASLFRSORTBY_Name, /* SortBy */
70 ASLFRSORTORDER_Ascend, /* SortOrder */
71 ASLFRSORTDRAWERS_First, /* SortDrawers */
72 FALSE /* InitialShowVolumes */
75 /*****************************************************************************************/
77 const struct IntSMReq def_smreq =
80 ASL_ScreenModeRequest,
81 NULL, /* Window */
82 NULL, /* Screen */
83 NULL, /* PubScreenName */
84 NULL, /* IntuiMsgFunc */
85 NULL, /* TextAttr */
86 NULL, /* Locale */
87 NULL, /* Catalog */
88 NULL, /* MemPool */
89 2048, /* MemPoolPuddle */
90 2048, /* MemPoolThresh */
91 MSG_MODEREQ_TITLE, /* TitleID */
92 NULL, /* TitleText */
93 NULL, /* PositiveText */
94 NULL, /* NegativeText */
95 -1, -1, /* --> center on screen */
96 300, 300 /* Width/Height */
99 NULL, /* CustomSMList */
100 NULL, /* FilterFunc */
101 0, /* Flags */
102 LORES_KEY, /* DisplayID */
103 640, /* DisplayWidth */
104 200, /* DisplayHeight */
105 640, /* BitMapWidth */
106 200, /* BitMapHeight */
107 2, /* DisplayDepth */
108 OSCAN_TEXT, /* OverscanType */
109 TRUE, /* AutoScroll */
110 DIPF_IS_WB, /* PropertyFlags */
111 DIPF_IS_WB, /* PropertyMask */
112 1, /* MinDepth */
113 24, /* MaxDepth */
114 16, /* MinWidth */
115 16384, /* MaxWidth */
116 16, /* MinHeight */
117 16384, /* MaxHeight */
118 20, /* InfoLeftEdge */
119 20, /* InfoTopEdge */
120 FALSE /* InfoOpened */
123 /*****************************************************************************************/
125 const struct IntFontReq def_fontreq =
128 ASL_FontRequest,
129 NULL, /* Window */
130 NULL, /* Screen */
131 NULL, /* PubScreenName */
132 NULL, /* IntuiMsgFunc */
133 NULL, /* TextAttr */
134 NULL, /* Locale */
135 NULL, /* Catalog */
136 NULL, /* MemPool */
137 2048, /* MemPoolPuddle */
138 2048, /* MemPoolThresh */
139 MSG_FONTREQ_TITLE, /* TitleID */
140 NULL, /* TitleText */
141 NULL, /* PositiveText */
142 NULL, /* NegativeText */
143 -1, -1, /* --> center on screen */
144 300, 300 /* Width/Height */
146 {"topaz", 8, FS_NORMAL,FPF_ROMFONT},/* Default textattr */
147 1, /* FrontPen */
148 0, /* BackPen */
149 JAM1, /* DrawMode */
150 0, /* Flags */
152 5, /* Minheight */
153 24, /* MaxHeight */
154 NULL, /* FilterFunc */
155 NULL, /* HookFunc */
156 32, /* MaxFrontPen */
157 32, /* MaxBackPen */
159 NULL, /* ModeList */
160 NULL, /* FrontPens */
161 NULL, /* BackPens */
165 /* coolimages may fail to open */
166 LONG CoolImagesBase_version = -1;
168 /*****************************************************************************************/
170 VOID InitReqInfo(struct AslBase_intern *);
172 /*****************************************************************************************/
174 static int InitBase(LIBBASETYPEPTR LIBBASE)
176 D(bug("Inside InitBase of asl.library\n"));
178 NEWLIST(&LIBBASE->ReqList);
180 InitSemaphore(&LIBBASE->ReqListSem);
182 InitReqInfo(LIBBASE);
184 return TRUE;
187 /*****************************************************************************************/
189 ADD2INITLIB(InitBase, 0);
191 /*****************************************************************************************/
193 #include <string.h>
194 #include "filereqhooks.h"
195 #include "fontreqhooks.h"
196 #include "modereqhooks.h"
198 /*****************************************************************************************/
200 VOID InitReqInfo(struct AslBase_intern *AslBase)
202 struct AslReqInfo *reqinfo;
204 /* Set file requester info */
206 reqinfo = &(ASLB(AslBase)->ReqInfo[ASL_FileRequest]);
207 D(bug("AslBase: %p reqinfo: %p\n", AslBase, reqinfo));
208 reqinfo->IntReqSize = sizeof (struct IntFileReq);
209 reqinfo->ReqSize = sizeof (struct FileRequester);
210 reqinfo->DefaultReq = (struct IntFileReq *)&def_filereq;
211 reqinfo->UserDataSize = sizeof (struct FRUserData);
213 bzero(&(reqinfo->ParseTagsHook), sizeof (struct Hook));
214 bzero(&(reqinfo->GadgetryHook), sizeof (struct Hook));
215 reqinfo->ParseTagsHook.h_Entry = (void *)AROS_ASMSYMNAME(FRTagHook);
216 reqinfo->GadgetryHook.h_Entry = (void *)AROS_ASMSYMNAME(FRGadgetryHook);
218 /* Set font requester info */
220 reqinfo = &(ASLB(AslBase)->ReqInfo[ASL_FontRequest]);
221 reqinfo->IntReqSize = sizeof (struct IntFontReq);
222 reqinfo->ReqSize = sizeof (struct FontRequester);
223 reqinfo->DefaultReq = (struct IntFontReq *)&def_fontreq;
224 reqinfo->UserDataSize = sizeof (struct FOUserData);
226 bzero(&(reqinfo->ParseTagsHook), sizeof (struct Hook));
227 bzero(&(reqinfo->GadgetryHook), sizeof (struct Hook));
228 reqinfo->ParseTagsHook.h_Entry = (void *)AROS_ASMSYMNAME(FOTagHook);
229 reqinfo->GadgetryHook.h_Entry = (void *)AROS_ASMSYMNAME(FOGadgetryHook);
231 /* Set screenmode requester info */
233 reqinfo = &(ASLB(AslBase)->ReqInfo[ASL_ScreenModeRequest]);
234 reqinfo->IntReqSize = sizeof (struct IntSMReq);
235 reqinfo->ReqSize = sizeof (struct ScreenModeRequester);
236 reqinfo->DefaultReq = (struct IntSMReq *)&def_smreq;
237 reqinfo->UserDataSize = sizeof(struct SMUserData);
239 bzero(&(reqinfo->ParseTagsHook), sizeof (struct Hook));
240 bzero(&(reqinfo->GadgetryHook), sizeof (struct Hook));
241 reqinfo->ParseTagsHook.h_Entry = (void *)AROS_ASMSYMNAME(SMTagHook);
242 reqinfo->GadgetryHook.h_Entry = (void *)AROS_ASMSYMNAME(SMGadgetryHook);
244 return;
247 /*****************************************************************************************/