1 #ifndef LIBRARIES_XMODULE_H
2 #define LIBRARIES_XMODULE_H
6 ** Copyright (C) 1995,96,97 Bernardo Innocenti
8 ** Set TAB size to 8 chars to read this header file
10 ** Public structures and constants for the xmodule.library
15 #endif /* DOS_DOS_H */
18 #include <exec/lists.h>
19 #endif /* EXEC_LISTS_H */
21 #ifndef EXEC_LIBRARIES_H
22 #include <exec/libraries.h>
23 #endif /* EXEC_LIBRARIES_H */
25 #ifndef EXEC_SEMAPHORES_H
26 #include <exec/semaphores.h>
27 #endif /* EXEC_SEMAPHORES_H */
29 #ifndef INTUITION_CLASSES_H
30 #include <intuition/classes.h>
31 #endif /* INTUITION_CLASSES_H */
33 #ifndef COMPILERSPECIFIC_H
34 #include "CompilerSpecific.h"
35 #endif /* COMPILERSPECIFIC_H */
44 struct Library xm_Library; /* Standard Library node structure */
45 UWORD xm_Pad0; /* Struct Library is misaligned! */
46 struct SignalSemaphore xm_BaseLock; /* Obtain this before browsing
47 * in any of the fields!
49 UWORD xm_Pad1; /* SignalSemaphore is misaligned! */
51 /* The following data is longword aligned */
53 struct MinList xm_Songs; /* List of public SongInfo structs */
54 struct MinList xm_Loaders; /* List of available loaders */
55 struct MinList xm_Savers; /* List of available savers */
57 void *xm_Pool; /* Public mem pool used by XModule */
58 Class *xm_SongClass; /* Song boopsi class */
59 struct SongInfo *xm_CurrentSong; /* Pointer to currently active song */
60 struct XMHook *xm_DefaultSaver; /* Currently selected saver hook */
61 struct Screen *xm_Screen; /* XModule screen (might be NULL) */
62 ULONG xm_Flags; /* See definitions below */
63 STRPTR xm_ScreenName; /* Name of XModule's public screen */
64 STRPTR xm_RexxName; /* Name of XModule's ARexx port */
68 struct DosLibrary *xm_DOSBase; /* Some useful library bases that */
69 struct UtilityBase *xm_UtilityBase; /* can be grabbed and used by */
70 struct Library *xm_IFFParseBase; /* external hooks. These four are */
71 struct IntuitionBase *xm_IntuitionBase; /* guaranteed to be always open. */
78 struct Node xmh_Link; /* Link to other hooks in a list.
79 * ln_Name contains the Hook name.
81 UWORD xmh_Version; /* Will be set to XMHOOK_VERSION */
82 STRPTR xmh_Descr; /* Short description of this hook */
83 STRPTR xmh_Author; /* Author's name */
84 ULONG xmh_Flags; /* See below for definitions */
85 ULONG xmh_ID; /* IFF-style ID. Set it to the FORM
86 * type for IFF loaders/savers.
88 APTR xmh_UserData; /* User's private data */
89 struct Library *xmh_LibraryBase; /* External hook's library base */
90 ASMCALL void (*xmh_RemoveHook) (
91 REG(a0,struct XMHook *hook)); /* Hook remotion entrypoint */
92 ASMCALL LONG (*xmh_LoadMod) (
94 REG(a0, struct SongInfo *song),
95 REG(a1, struct XMHook *loader),
96 REG(a2, struct TagItem *tags)); /* Module loader entrypoint */
97 ASMCALL LONG (*xmh_SaveMod) (
99 REG(a0, struct SongInfo *song),
100 REG(a1, struct XMHook *saver),
101 REG(a2, struct TagItem *tags)); /* Module saver entrypoint */
102 ASMCALL struct XMHook * (*xmh_IdentifyMod) (
104 REG(a0, struct XMHook *hook),
105 REG(a1, struct TagItem *tags)); /* Module identification entrypoint */
107 ULONG xmh_MaxTracks; /* Max. number of tracks */
108 ULONG xmh_MaxPatterns; /* Max. number of patterns */
109 ULONG xmh_MaxInstruments; /* Max. number of instruments */
110 ULONG xmh_MaxLength; /* Max. number of positions */
111 ULONG xmh_MaxSampleLen; /* Max. length of each sample */
112 ULONG xmh_MaxPattLen; /* Max. lines in a pattern */
114 ULONG xmh_Reserved[2]; /* Avoid recompilation :-) */
119 #define XMHOOK_VERSION 0
121 #define NT_XMSONG 'X'
122 #define NT_XMLOADER 'L'
123 #define NT_XMSAVER 'S'
127 /* Flag definitions for XMHook->xmh_Flags */
130 #define XMHF_BINARY 0x0000
131 #define XMHF_ASCII 0x0001
132 #define XMHF_IFF 0x0002
133 #define XMHF_MISC 0x0003
135 /* These specify that the saver is able to exclude
136 * the corresponding items when saving in its own format.
138 #define XMHF_EXCLUDE_SEQUENCE (1<<5)
139 #define XMHF_EXCLUDE_INSTRUMENTS (1<<6)
140 #define XMHF_EXCLUDE_PATTERNS (1<<7)
141 #define XMHF_EXCLUDE_NAMES (1<<8)
143 /* This module format does not support variable length
144 * patterns. Use in conjunction with XMHOOK_MaxPattLen tag.
146 #define XMHF_FIXED_PATT_LEN (1<<9)
148 /* This is an internal hook */
149 #define XMHF_INTERNAL (1<<31)
153 /* Flags for xmDisplayMessage() */
157 #define XMDMF_ALERT 0x00000000
158 #define XMDMF_FAIL 0x00000001
159 #define XMDMF_ERROR 0x00000002
160 #define XMDMF_WARNING 0x00000003
161 #define XMDMF_NOTE 0x00000004
162 #define XMDMF_INFORMATION 0x00000005
163 #define XMDMF_COMMENT 0x00000006
164 #define XMDMF_DEBUG 0x00000007
165 #define XMDMF_LEVELMASK 0x00000007
167 #define XMDMF_DOSERRORMASK 0x0000FFFF
168 #define XMDMF_DOSFAULT (1<<28)
169 #define XMDMF_ACTION (1<<29)
170 #define XMDMF_USEREQUESTER (1<<30)
171 #define XMDMF_USECATALOG (1<<31)
175 /* Specific error codes */
177 #define ERROR_NOTMODULE ERROR_OBJECT_WRONG_TYPE /* File format not recognized */
178 #define ERROR_IOERR RETURN_FAIL /* A DOS call (e.g.: Read()) failed.
179 * check IoErr() for specific error.
187 #define XMSNG_Dummy (TAG_USER + 'XS'<<8)
189 #define XMSNG_AddToList (XMSNG_Dummy + 1)
190 #define XMSNG_OldSong (XMSNG_Dummy + 2)
191 #define XMSNG_Loader (XMSNG_Dummy + 3)
192 #define XMSNG_FileHandle (XMSNG_Dummy + 4)
193 #define XMSNG_Active (XMSNG_Dummy + 5)
195 /* Tags for xmOptimizeSongA() */
197 #define XMSNG_Optimize (XMSNG_Dummy + 16)
198 #define XMSNG_RemapInstruments (XMSNG_Dummy + 17)
199 #define XMSNG_LimitPatterns (XMSNG_Dummy + 18)
200 #define XMSNG_Join (XMSNG_Dummy + 19)
201 #define XMSNG_Merge (XMSNG_Dummy + 20)
203 /* Flags for XMSNG_Optimize */
204 #define XMOF_DEFAULT (1<<0)
205 #define XMOF_REM_UNUSED_PATTERNS (1<<1)
206 #define XMOF_REM_DUP_PATTERNS (1<<2)
207 #define XMOF_REM_UNUSED_INSTRS (1<<3)
208 #define XMOF_REM_DUP_INSTRS (1<<4)
209 #define XMOF_CUT_INSTR_LOOPS (1<<5)
210 #define XMOF_CUT_INSTR_TAILS (1<<6)
211 #define XMOF_CUT_PATTERNS (1<<7)
212 #define XMOF_REMAP_INSTRS (1<<8)
215 /* XModule hook tags */
217 #define XMHOOK_Dummy (TAG_USER + 'XH'<<8)
219 #define XMHOOK_Type (XMHOOK_Dummy + 1)
220 #define XMHOOK_Name (XMHOOK_Dummy + 2)
221 #define XMHOOK_Priority (XMHOOK_Dummy + 3)
222 #define XMHOOK_Descr (XMHOOK_Dummy + 4)
223 #define XMHOOK_Author (XMHOOK_Dummy + 5)
224 #define XMHOOK_ID (XMHOOK_Dummy + 6)
225 #define XMHOOK_Flags (XMHOOK_Dummy + 7)
226 #define XMHOOK_UserData (XMHOOK_Dummy + 8)
227 #define XMHOOK_LibraryBase (XMHOOK_Dummy + 9)
228 #define XMHOOK_RemoveFunc (XMHOOK_Dummy + 10)
229 #define XMHOOK_LoadModFunc (XMHOOK_Dummy + 11)
230 #define XMHOOK_SaveModFunc (XMHOOK_Dummy + 12)
231 #define XMHOOK_IdentifyModFunc (XMHOOK_Dummy + 13)
232 #define XMHOOK_MaxTracks (XMHOOK_Dummy + 14)
233 #define XMHOOK_MaxPatterns (XMHOOK_Dummy + 15)
234 #define XMHOOK_MaxInstruments (XMHOOK_Dummy + 16)
235 #define XMHOOK_MaxLength (XMHOOK_Dummy + 17)
236 #define XMHOOK_MaxSampleLen (XMHOOK_Dummy + 18)
237 #define XMHOOK_MaxPattLen (XMHOOK_Dummy + 19)
240 #endif /* !LIBRARIES_XMODULE_H */