annotate jssplr.h @ 183:a65f0c3deaa7

Some more player logic cleanups and variable renames.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 06 Oct 2012 14:58:29 +0300
parents 9024d249e47a
children 47c327fb321a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * miniJSS - Module playing routines
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 * Programmed and designed by Matti 'ccr' Hamalainen
142
69e3041032e9 Update copyright.
Matti Hamalainen <ccr@tnsp.org>
parents: 136
diff changeset
4 * (C) Copyright 2006-2012 Tecnic Software productions (TNSP)
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 */
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #ifndef JSSPLR_H
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #define JSSPLR_H
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #include "jss.h"
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #include "jssmod.h"
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #include "jssmix.h"
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 // Player general constants
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #define mpMinVol (0)
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 #define mpMaxVol (64)
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 #define mpPanCenter (0)
143
17a1c46db7eb It would seem, based on tests, that the actual starting value for XM ext
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
18 //#define mpMaxFadeoutVol (65535)
17a1c46db7eb It would seem, based on tests, that the actual starting value for XM ext
Matti Hamalainen <ccr@tnsp.org>
parents: 142
diff changeset
19 #define mpMaxFadeoutVol (32768)
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 // Channel New-Data flags
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #define cdfNONE (0x00) // Set nothing
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #define cdfNewInstr (0x01) // Set a new instrument
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #define cdfNewPitch (0x02) // Set a new pitch
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #define cdfNewPos (0x04) // Set a new position
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 #define cdfNewVolume (0x08) // Set a new volume
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 #define cdfNewPanPos (0x10) // Set a new panning position
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 #define cdfNewGlobalVol (0x20) // Set a new global volume
180
bc8019c38ba5 Refactoring of the note triggering and other player logic, fixes various
Matti Hamalainen <ccr@tnsp.org>
parents: 144
diff changeset
30 #define cdfPlay (0x40) // Start or restart playing sample
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 #define cdfStop (0x80) // Stop channel playing
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
183
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
34 // Player envelope data
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
35 typedef struct
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
36 {
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
37 int frame, value;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
38 BOOL exec;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
39 } JSSPlayerEnvelope;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
40
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
41
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
42 typedef struct
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
43 {
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
44 int pos, speed, depth, wc;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
45 } JSSPlayerVData;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
46
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
47
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
48 // Player channel structure
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 typedef struct
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 {
183
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
51 JSSPlayerEnvelope volumeEnv, panningEnv;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
52
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
53 JSSPlayerVData vibrato, tremolo;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
54
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
55 BOOL keyOff;
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
56
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
57 JSSInstrument *instrument; // Instrument
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
58 JSSExtInstrument *extInstrument; // ExtInstrument
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
59 int ninstrument,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
60 nextInstrument,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
61 note, // Current note
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
62 pitch, // Pitch (NOT actual frequency!)
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
63 oldPitch,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
64 position, // Sample position
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
65 volume, // Volume
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
66 panning, // Panning position
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
67
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
68 newDataFlags, // New data flags
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
69
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
70 fadeOutVol,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
71
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
72 iCAutoVib_Frame,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
73
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
74 iCLastFineVolumeslideUpParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
75 iCLastFineVolumeslideDownParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
76 iCLastExtraFinePortamentoUpParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
77 iCLastExtraFinePortamentoDownParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
78 iCLastFinePortamentoUpParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
79 iCLastFinePortamentoDownParam,
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
80
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
81 iPatLoopRow, // Pattern loop start row
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
82 iPatLoopCount, // Pattern loop count
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 iLastPortaParam, // Last portamento effect parameter
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 iLastPortaToNoteParam, // Last porta-to-note parameter
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 iLastPortaToNotePitch, // Last porta-to-note pitch
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 iLastTremorParam,
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 iTremorCount,
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 iLastSampleOffset,
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 iLastRetrigParam,
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 iLastVolSlideParam,
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 iRetrigNDFlags, // For retrig-effect
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 iSaveNDFlags; // For notedelay-effect
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
96 } JSSPlayerChannel;
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
97
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
98
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
99 // Struct holding all player related information
136
8ac24d753304 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 97
diff changeset
100 typedef struct _JSSPlayer
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
101 {
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
102 // General variables
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
103 int tempo, // Current values
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
104 speed,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
105 tick,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
106 order,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
107 npattern,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
108 row,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
109 globalVol,
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
110 options; // Playing option flags
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
111 BOOL isPlaying; // Are we playing?
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
112
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
113 int newOrder, // NEW order number
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
114 newRow; // NEW row number
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
115 BOOL newOrderSet, // TRUE if new order has been set
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
116 newRowSet; // TRUE if new row has been set
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
117
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
118 int patternDelay, // Pattern delay tick-counter
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
119 lastPatLoopRow; // Latest set pattern loop row (any channel)
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
120
183
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
121 BOOL jumpFlag, // Pattern jump flag
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
122 breakFlag; // Pattern break flag
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
123
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
124 // All channels for this player
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
125 // int nchannels;
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
126 JSSPlayerChannel channels[jsetNChannels];
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
127
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 // Module and sounddevice specific
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
130 JSSModule *module; // Current module in this player
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
131 JSSPattern *pattern; // Current pattern
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
132 JSSMixer *device; // Pointer to mixing device structure
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133
144
22e1be63f6af Various improvements in XM replay: implement the 5ms volume fadein and
Matti Hamalainen <ccr@tnsp.org>
parents: 143
diff changeset
134 struct _JSSPlayer *future;
22e1be63f6af Various improvements in XM replay: implement the 5ms volume fadein and
Matti Hamalainen <ccr@tnsp.org>
parents: 143
diff changeset
135
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 #ifdef JSS_SUP_THREADS
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 DMMutex *mutex;
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 #endif
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 } JSSPlayer;
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 /* External functions for end users
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 */
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 int jmpPlayOrder(JSSPlayer *, int);
182
9024d249e47a Add a new function jmpChangeOrder() to change orderlist position "on fly",
Matti Hamalainen <ccr@tnsp.org>
parents: 180
diff changeset
146 int jmpChangeOrder(JSSPlayer *, int);
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 int jmpPlayPattern(JSSPlayer *, int);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148 void jmpStop(JSSPlayer *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 void jmpResume(JSSPlayer *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150 void jmpSetModule(JSSPlayer *, JSSModule *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 JSSPlayer * jmpInit(JSSMixer *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152 int jmpClose(JSSPlayer *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 void jmpExec(void *, void *);
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156 /* Helper macros
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 */
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 #define JMPMAKEPARAM(AIVAL, AVALX, AVALY) { AVALX = (((AIVAL) >> 4) & 0x0f); AVALY = ((AIVAL) & 0x0f); }
183
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
159 #define JMPSETNDFLAGS(IVAL) chn->newDataFlags |= IVAL
a65f0c3deaa7 Some more player logic cleanups and variable renames.
Matti Hamalainen <ccr@tnsp.org>
parents: 182
diff changeset
160 #define JMPUNSETNDFLAGS(IVAL) chn->newDataFlags &= (~(IVAL))
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
161 #define JMPGETNOTE(MNOTE, MROW, MCHAN) assert(mp); assert(mp->pattern); assert((MROW) >= 0); assert((MROW) < mp->pattern->nrows); MNOTE = &mp->pattern->data[(mp->pattern->nchannels * MROW) + (MCHAN)]
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 #define JMPGETEFFECT(MEFF, MIEFF) if ((MIEFF >= 0) && (MIEFF < jmpNMODEffectTable)) MEFF = jmpMODEffectTable[MIEFF]; else MEFF = 0
55
e0e470c3fc8e Initial round of cleaning up the player code a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
163 #define JMPGETMODFLAGS(Q, Z) ((Q->module->defFlags & (Z)) == (Z))
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 /* Debugging macros
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 */
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 #if !defined(JSS_LIGHT) && defined(JSS_DEBUG)
97
2884a611042b Fix building with debug mode.
Matti Hamalainen <ccr@tnsp.org>
parents: 55
diff changeset
169 # define JMPDEBUG(QQ) { fprintf(stderr, "[o=%03d:p=%03d:r=%03d] (%c/%x:%x) %s\n", mp->order, mp->npattern, mp->row, effect, currNote->effect, currNote->param, QQ ); }
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 #else
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 # define JMPDEBUG(QQ) // stub
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 #endif
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 #endif // JSSPLR_H