forked from osoumen/C700
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXIFile.h
71 lines (59 loc) · 1.47 KB
/
XIFile.h
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
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* XIFile.h
* C700
*
* Created by osoumen on 12/10/10.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "FileAccess.h"
#include "DataBuffer.h"
#include "C700Generator.h"
class XIFile : public FileAccess, public DataBuffer {
public:
XIFile( const char *path, int allocMemSize=1024*1024 );
virtual ~XIFile();
virtual bool Write();
#if MAC
void SetCFData( CFDataRef propertydata );
CFDataRef GetCFData() const;
#endif
bool SetDataFromChip( const C700Generator *chip, int targetProgram, double tempo );
private:
#if MAC
CFDataRef mCFData;
#endif
public:
typedef struct {
char extxi[21]; // Extended Instrument:
char name[23]; // Name, 1Ah
char trkname[20]; // FastTracker v2.00
unsigned short shsize; // 0x0102
} XIFILEHEADER;
typedef struct {
unsigned char snum[96];
unsigned short venv[24];
unsigned short penv[24];
unsigned char vnum, pnum;
unsigned char vsustain, vloops, vloope, psustain, ploops, ploope;
unsigned char vtype, ptype;
unsigned char vibtype, vibsweep, vibdepth, vibrate;
unsigned short volfade;
unsigned short res;
unsigned char reserved1[20];
unsigned short reserved2; //nsamples?
} XIINSTRUMENTHEADER;
typedef struct {
unsigned int samplen;
unsigned int loopstart;
unsigned int looplen;
unsigned char vol;
signed char finetune;
unsigned char type;
unsigned char pan;
signed char relnote;
unsigned char res;
char name[22];
} XISAMPLEHEADER;
};