Initial commit.
[amiga/xmodule.git] / include / libraries / songclass.i
1         IFND    LIBRARIES_SONGLCASS_I
2 LIBRARIES_SONGCLASS_I   SET     1
3 **
4 **      $VER: songclass.i 3.9 (7.1.96)
5 **      Copyright (C) 1995,96 Bernardo Innocenti
6 **
7 **      Set TAB size to 8 chars to read this header file
8 **
9 **      Assembler structure definitions for the song class
10 **
11
12
13         IFND    EXEC_TYPES_I
14         include exec/types.i
15         ENDC    ; EXEC_TYPES_I
16
17         IFND    EXEC_NODES_I
18         include exec/nodes.i
19         ENDC    ; EXEC_NODES_I
20
21         IFND    EXEC_SEMAPHORES_I
22         include exec/semaphores.i
23         ENDC    ; EXEC_SEMAPHORES_I
24
25
26 MAXOCTAVES      EQU     6                       ; Number of octaves currently supported
27 MAXNOTES        EQU     (12*MAXOCTAVES+1)       ; Entries in note conversion table
28 MAXTRACKS       EQU     255                     ; Maximum number of tracks in a pattern
29 MAXINSTRUMENTS  EQU     255                     ; Maximum number of instruments in a song
30 MAXPATTLINES    EQU     32767                   ; Maximum number of lines in a pattern
31 MAXPOSITIONS    EQU     32767                   ; Maximum number of song positions
32 MAXPATTERNS     EQU     32767                   ; Maximum number of patterns
33
34
35
36 **************************************************************************
37 ** Some definitions transcripted from "XModule.h"
38 **************************************************************************
39
40         ENUM 0
41
42         EITEM EFF_NULL
43         EITEM EFF_PORTAMENTOUP
44         EITEM EFF_PORTAMENTODOWN
45         EITEM EFF_TONEPORTAMENTO
46         EITEM EFF_VIBRATO
47         EITEM EFF_TONEPVOLSLIDE
48         EITEM EFF_VIBRATOVOLSLIDE
49         EITEM EFF_TREMOLO
50         EITEM EFF_UNUSED
51         EITEM EFF_SAMPLEOFFSET
52         EITEM EFF_VOLSLIDE
53         EITEM EFF_POSJUMP
54         EITEM EFF_SETVOLUME
55         EITEM EFF_PATTERNBREAK
56         EITEM EFF_MISC
57         EITEM EFF_SETSPEED
58         EITEM EFF_SETTEMPO
59         EITEM EFF_ARPEGGIO
60
61         EITEM EFF_COUNT
62
63
64
65         STRUCTURE       Note,0
66         UBYTE note_Note
67         UBYTE note_Inst
68         UBYTE note_Vol
69         UBYTE note_Pad
70         UBYTE note_EffNum
71         UBYTE note_EffVal
72         LABEL Note_SIZEOF
73
74
75         STRUCTURE       Instrument,0
76         UWORD   in_InstType             ; Instrument type (See defs)
77         UWORD   in_Volume               ; Volume (max $40)
78         APTR    in_Name                 ; Instrument Name
79         APTR    in_SampleData           ; Sampled data
80         ULONG   in_Length               ; Length of instr
81         ULONG   in_Repeat               ; Loop start (No loop = 0)
82         ULONG   in_Replen               ; Loop size (No loop = 1)
83         WORD    in_FineTune             ; Instrument FineTune (-8..+7)
84         UWORD   in_Flags                ; Unused
85         LABEL   in_SIZEOF
86
87
88         STRUCTURE       Pattern,0
89         UWORD   pa_Tracks               ; Support for variable number of tracks
90         UWORD   pa_Lines                ; Number of lines in pattern
91         APTR    pa_Name                 ; Pattern Name
92         STRUCT  pa_Reserved,8   ; Reserved for future enhancements
93         LABEL   pa_Notes,0              ; Pointers to all tracks follow
94         LABEL   pa_SIZEOF
95
96
97 * Song class white box istance
98 *
99 * You can read from this structure directly for speed critical operations.
100 * Modifying the data contained in the SongInfo structure is only allowed
101 * by means of object methods.
102 *
103 * Before using a public song, please protect yourself against other tasks
104 * modifying these fields. Always obtainin a (shared) lock on the
105 * SignalSemaphore contained in the SongInfo structure before doing anything
106 * with it. The methods provided by the song class will not handle access
107 * arbitration for you.
108 *
109         STRUCTURE       SongInfo,LN_SIZE
110         STRUCT  si_Lock,SS_SIZE
111         UWORD   si_Length               ; Number of positions in song
112         UWORD   si_MaxTracks            ; Number of tracks in song
113         UWORD   si_NumPatterns          ; Number of patterns in song
114         UWORD   si_LastInstrument       ; Unused
115         UWORD   si_CurrentPatt
116         UWORD   si_CurrentPos
117         UWORD   si_CurrentInst
118         UWORD   si_CurrentLine
119         UWORD   si_CurrentTrack
120         UWORD   si_DefNumTracks         ; Default number of tracks in new patterns
121         UWORD   si_DefPattLen           ; Default number of lines in new patterns
122
123         UWORD   si_GlobalSpeed          ; Default song speed
124         UWORD   si_GlobalTempo          ; Default song tempo
125         UWORD   si_RestartPos           ; Position to restart from
126         STRUCT  si_Reserved,8           ; Reserved for future enhancements
127
128 * Note: all data beyond this point is longword aligned
129
130         ULONG   si_Flags                ; See definitions below
131         APTR    si_Pool                 ; The memory pool where song data
132                                         ; must be allocated from.
133         APTR    si_Sequence             ; UWORD *: Pointer to song sequence
134         APTR    si_Patt
135         APTR    si_Instr
136         APTR    si_ActiveTracks         ; UWORD *: Active Tracks (-1 = disabled)
137         APTR    si_Title                ; Song name
138         APTR    si_Author               ; Author of song
139         APTR    si_Path                 ; Original song path
140         APTR    si_Description          ; Verbose song description
141
142         ULONG   si_Changes              ; Number of changes made to this song
143         ULONG   si_TotalChanges         ; Total number of changes made so far
144         ULONG   si_CreationDate         ; Date of OM_NEW
145         ULONG   si_LastChanged          ; Date of last saving
146
147         LABEL   si_SIZEOF
148
149
150
151         ENDC    ; !LIBRARIES_SONGCLASS_I