File: mo3_parse.h

package info (click to toggle)
unmo3 0.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 320 kB
  • sloc: ansic: 1,013; makefile: 35; sh: 31
file content (58 lines) | stat: -rw-r--r-- 1,323 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef MO3_PARSE_H 
#define MO3_PARSE_H 1

typedef unsigned char *(*samplePackMethod)(unsigned char *, unsigned char *, long);

#define MO3TYPE_MOD 1
#define MO3TYPE_XM 2
#define MO3TYPE_MTM 3
#define MO3TYPE_IT 4
#define MO3TYPE_S3M 5

#define MO3COMPR_LOSSLESS8D 1
#define MO3COMPR_LOSSLESS8DP 2
#define MO3COMPR_LOSSLESS16D 3
#define MO3COMPR_LOSSLESS16DP 4
#define MO3COMPR_NONE 5
#define MO3COMPR_MP3 6
#define MO3COMPR_OGG 7
#define MO3COMPR_REMOVED 8

#define MO3RESO_8BITS 1
#define MO3RESO_16BITS 2


struct mo3Sample {
  samplePackMethod method;
  long len;
  long lenComp;
  unsigned short flags;
  char compression;
  char reso;
};

struct mo3Data {
  char channelNb;
  short songLen;
  short uniqueVoice;
  short patternNb;
  short instrNb;
  short sampleNb;

  struct mo3Sample *samples;  

  short *patternLen;
  long *voicePtr;
  long patternTable;
  long instr;
  unsigned long flags;
  int type;
  int version;
};

int parseHeader(unsigned char *src, unsigned long size, int parseLevel, struct mo3Data *mo3Hdr);
int parseVoice(unsigned char *src, long offset, struct mo3Data *mo3Hdr, int parseLevel);
short findVoiceNumber(short pattern, char channel, unsigned char *mo3, struct mo3Data *mo3Hdr);
int parseTrack(unsigned char *src, long offset, struct mo3Data *mo3Hdr, int write);

#endif // MO3_PARSE_H