libxmp-lite: Changes to build as C++: Structs within other structs cannot be referred to by just the innermost name, and the using keyword does not work either. Split them out into the top level.

git-svn-id: https://svn.eduke32.com/eduke32@6161 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-09 06:39:52 +00:00
parent 35e8792efa
commit 6700a2a93d
2 changed files with 71 additions and 62 deletions

View file

@ -171,20 +171,6 @@ struct xmp_envelope {
short data[XMP_MAX_ENV_POINTS * 2]; short data[XMP_MAX_ENV_POINTS * 2];
}; };
struct xmp_instrument {
char name[32]; /* Instrument name */
int vol; /* Instrument volume */
int nsm; /* Number of samples */
int rls; /* Release (fadeout) */
struct xmp_envelope aei; /* Amplitude envelope info */
struct xmp_envelope pei; /* Pan envelope info */
struct xmp_envelope fei; /* Frequency envelope info */
struct {
unsigned char ins; /* Instrument number for each key */
signed char xpo; /* Instrument transpose for each key */
} map[XMP_MAX_KEYS];
struct xmp_subinstrument { struct xmp_subinstrument {
int vol; /* Default volume */ int vol; /* Default volume */
int gvl; /* Global volume */ int gvl; /* Global volume */
@ -213,7 +199,23 @@ struct xmp_instrument {
int dca; /* Duplicate check action */ int dca; /* Duplicate check action */
int ifc; /* Initial filter cutoff */ int ifc; /* Initial filter cutoff */
int ifr; /* Initial filter resonance */ int ifr; /* Initial filter resonance */
} *sub; };
struct xmp_instrument {
char name[32]; /* Instrument name */
int vol; /* Instrument volume */
int nsm; /* Number of samples */
int rls; /* Release (fadeout) */
struct xmp_envelope aei; /* Amplitude envelope info */
struct xmp_envelope pei; /* Pan envelope info */
struct xmp_envelope fei; /* Frequency envelope info */
struct {
unsigned char ins; /* Instrument number for each key */
signed char xpo; /* Instrument transpose for each key */
} map[XMP_MAX_KEYS];
struct xmp_subinstrument *sub;
void *extra; /* Extra fields */ void *extra; /* Extra fields */
}; };
@ -276,6 +278,19 @@ struct xmp_module_info {
struct xmp_sequence *seq_data; /* Pointer to sequence data */ struct xmp_sequence *seq_data; /* Pointer to sequence data */
}; };
struct xmp_channel_info { /* Current channel information */
unsigned int period; /* Sample period (* 4096) */
unsigned int position; /* Sample position */
short pitchbend; /* Linear bend from base note*/
unsigned char note; /* Current base note number */
unsigned char instrument; /* Current instrument number */
unsigned char sample; /* Current sample number */
unsigned char volume; /* Current volume */
unsigned char pan; /* Current stereo pan */
unsigned char reserved; /* Reserved */
struct xmp_event event; /* Current track event */
};
struct xmp_frame_info { /* Current frame information */ struct xmp_frame_info { /* Current frame information */
int pos; /* Current position */ int pos; /* Current position */
int pattern; /* Current pattern */ int pattern; /* Current pattern */
@ -296,18 +311,7 @@ struct xmp_frame_info { /* Current frame information */
int virt_used; /* Used virtual channels */ int virt_used; /* Used virtual channels */
int sequence; /* Current sequence */ int sequence; /* Current sequence */
struct xmp_channel_info { /* Current channel information */ struct xmp_channel_info channel_info[XMP_MAX_CHANNELS];
unsigned int period; /* Sample period (* 4096) */
unsigned int position; /* Sample position */
short pitchbend; /* Linear bend from base note*/
unsigned char note; /* Current base note number */
unsigned char instrument; /* Current instrument number */
unsigned char sample; /* Current sample number */
unsigned char volume; /* Current volume */
unsigned char pan; /* Current stereo pan */
unsigned char reserved; /* Reserved */
struct xmp_event event; /* Current track event */
} channel_info[XMP_MAX_CHANNELS];
}; };

View file

@ -295,6 +295,30 @@ struct module_data {
#endif #endif
}; };
struct pattern_loop {
int start;
int count;
};
struct flow_control {
int pbreak;
int jump;
int delay;
int jumpline;
int loop_chn;
struct pattern_loop *loop;
int num_rows;
int end_point;
int rowdelay; /* For IT pattern row delay */
int rowdelay_set;
};
struct virt_channel {
int count;
int map;
};
struct player_data { struct player_data {
int ord; int ord;
@ -318,23 +342,7 @@ struct player_data {
int master_vol; /* Music volume */ int master_vol; /* Music volume */
int gvol; int gvol;
struct flow_control { struct flow_control flow;
int pbreak;
int jump;
int delay;
int jumpline;
int loop_chn;
struct pattern_loop {
int start;
int count;
} *loop;
int num_rows;
int end_point;
int rowdelay; /* For IT pattern row delay */
int rowdelay_set;
} flow;
struct { struct {
int time; /* replay time in ms */ int time; /* replay time in ms */
@ -354,10 +362,7 @@ struct player_data {
int virt_used; /* Number of voices currently in use */ int virt_used; /* Number of voices currently in use */
int maxvoc; /* Number of sound card voices */ int maxvoc; /* Number of sound card voices */
struct virt_channel { struct virt_channel *virt_channel;
int count;
int map;
} *virt_channel;
struct mixer_voice *voice_array; struct mixer_voice *voice_array;
} virt; } virt;