instfile.h
3.04 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//====================================================================
// instfile.h
//
// Copyright 1993, Silicon Graphics, Inc.
// All Rights Reserved.
//
// This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
// the contents of this file may not be disclosed to third parties, copied or
// duplicated in any form, in whole or in part, without the prior written
// permission of Silicon Graphics, Inc.
//
// RESTRICTED RIGHTS LEGEND:
// Use, duplication or disclosure by the Government is subject to restrictions
// as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
// and Computer Software clause at DFARS 252.227-7013, and/or in similar or
// successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
// rights reserved under the Copyright Laws of the United States.
//====================================================================
#pragma once
#include <stdio.h>
#include "libbank.h"
typedef struct {
long ckID;
long ckSize;
} ChunkHeader;
typedef struct {
long ckId;
long ckSize;
long format;
} FileHeader;
typedef struct {
char volume[28];
long dirID;
char file[32];
long type;
} FILP;
#include "InstrumentFile.h"
class SCInstrumentFile
{
protected:
FILE *file;
char *comment; // annotation from this instrument
char *name;
char *dir;
ICEnvelope envelope; // maps to SC envelope 3
ICInst instrument;
int soundCount; // number of sounds in the array
ICSoundFile **sounds; // array of sound file pointers
char midiChannel;
int scDebug;
ICSymTab *symtab;
ICObjTab *objtab;
ICWavTab *wavtab;
void parseAnno(ChunkHeader *hdr);
void parseKeyP(ChunkHeader *hdr);
void parseKeyS(ChunkHeader *hdr);
void parseFILP(ChunkHeader *hdr);
void parseEnvP(ChunkHeader *hdr);
void parseGenP(ChunkHeader *hdr);
void parseLFOP(ChunkHeader *hdr);
void parseRamp(ChunkHeader *hdr);
void parseTrkP(ChunkHeader *hdr);
void parseModP(ChunkHeader *hdr);
ALMicroTime scTime2alTime(short scTime);
short scAmp2alVol(short scAmp);
short scTuning2Cents(short tuning);
short scVol2alVol(short scVol);
ALPan scPan2alPan(short scPan);
void makePath(char *out, char *dir, char *fName);
void unixName(char *str);
public:
SCInstrumentFile(char *name, char *mode);
virtual ~SCInstrumentFile();
void Parse();
char GetMIDIChannel() { return midiChannel;}
ICInst *GetICInst() { return &instrument;}
void SetObjTab(ICObjTab *o) {objtab = o; }
void SetSymTab(ICSymTab *s) {symtab = s; }
void SetWavTab(ICWavTab *w) { wavtab = w; }
void SetDebug(int v) { scDebug = v; }
void ListFiles();
};