262 |
static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s); |
static void LoadString(uint32_t ChunkID, RIFF::List* lstINFO, String& s); |
263 |
}; |
}; |
264 |
|
|
265 |
|
class Region; |
266 |
|
|
267 |
class Sample { |
class Sample { |
268 |
public: |
public: |
269 |
|
|
322 |
unsigned long ReadAndLoop ( |
unsigned long ReadAndLoop ( |
323 |
void* pBuffer, |
void* pBuffer, |
324 |
unsigned long FrameCount, |
unsigned long FrameCount, |
325 |
PlaybackState* pPlaybackState |
PlaybackState* pPlaybackState, |
326 |
|
Region* pRegion |
327 |
); |
); |
328 |
|
|
329 |
//protected: |
//protected: |
334 |
//private: |
//private: |
335 |
int ChannelCount; // 2 for left and right samples |
int ChannelCount; // 2 for left and right samples |
336 |
|
|
337 |
uint32_t Start; // in sample data points (frames) |
uint32_t Start; // in sample data points (frames) from the begining of the sample data field |
338 |
uint32_t End; // in sample data points (frames) |
uint32_t End; // in sample data points (frames) from the begining of the sample data field |
339 |
uint32_t StartLoop; // in sample data points (frames) |
uint32_t StartLoop; // in sample data points (frames) from the begining of the sample data field |
340 |
uint32_t EndLoop; // in sample data points (frames) |
uint32_t EndLoop; // in sample data points (frames) from the begining of the sample data field |
341 |
uint32_t SampleRate; |
uint32_t SampleRate; |
342 |
uint8_t OriginalPitch; |
uint8_t OriginalPitch; |
343 |
uint8_t PitchCorrection; |
uint8_t PitchCorrection; |
359 |
int minVel, maxVel; |
int minVel, maxVel; |
360 |
int pan; // -64 - +63 |
int pan; // -64 - +63 |
361 |
int fineTune; // -99 - +99 |
int fineTune; // -99 - +99 |
362 |
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset; |
int coarseTune; // TODO: |
363 |
int startloopAddrsOffset, endloopAddrsOffset; |
int overridingRootKey; // represents the MIDI key number at which the sample is to be played back at its original sample rate. |
364 |
|
int startAddrsOffset, startAddrsCoarseOffset, endAddrsOffset, endAddrsCoarseOffset; |
365 |
|
int startloopAddrsOffset, startloopAddrsCoarseOffset, endloopAddrsOffset, endloopAddrsCoarseOffset; |
366 |
|
|
367 |
double EG1PreAttackDelay; |
double EG1PreAttackDelay; |
368 |
double EG1Attack; |
double EG1Attack; |
379 |
double EG2Release; |
double EG2Release; |
380 |
|
|
381 |
Sample* pSample; |
Sample* pSample; |
382 |
|
bool HasLoop; |
383 |
|
uint LoopStart; // index (in frames) from the beginning of the sample |
384 |
|
uint LoopEnd; // index (in frames) from the beginning of the sample |
385 |
Instrument* pInstrument; // used when the region belongs to preset |
Instrument* pInstrument; // used when the region belongs to preset |
386 |
|
|
387 |
Region(); |
Region(); |
388 |
Sample* GetSample() { return pSample; } |
Sample* GetSample() { return pSample; } |
389 |
Region* GetParent() { return this; } |
Region* GetParent() { return this; } |
390 |
|
|
391 |
|
int GetUnityNote(); |
392 |
|
|
393 |
std::vector<ModulatorItem> modulators; |
std::vector<ModulatorItem> modulators; |
394 |
|
|
395 |
friend class Instrument; |
friend class Instrument; |
425 |
public: |
public: |
426 |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |
Instrument(sf2::File* pFile, RIFF::Chunk* ck); |
427 |
~Instrument(); |
~Instrument(); |
428 |
|
|
429 |
|
void DeleteRegion(Region* pRegion); |
430 |
//private: |
//private: |
431 |
uint16_t InstBagNdx; |
uint16_t InstBagNdx; |
432 |
|
|
434 |
* Load all regions (zones, bags) in the range idx1 - idx2 |
* Load all regions (zones, bags) in the range idx1 - idx2 |
435 |
*/ |
*/ |
436 |
void LoadRegions(int idx1, int idx2); |
void LoadRegions(int idx1, int idx2); |
437 |
|
|
438 |
|
Region* CreateRegion(); |
439 |
}; |
}; |
440 |
|
|
441 |
class Preset : public InstrumentBase { |
class Preset : public InstrumentBase { |
470 |
Preset* GetPreset(int idx); |
Preset* GetPreset(int idx); |
471 |
int GetInstrumentCount(); |
int GetInstrumentCount(); |
472 |
Instrument* GetInstrument(int idx); |
Instrument* GetInstrument(int idx); |
473 |
|
void DeleteInstrument(Instrument* pInstrument); |
474 |
int GetSampleCount(); |
int GetSampleCount(); |
475 |
Sample* GetSample(int idx); |
Sample* GetSample(int idx); |
476 |
void DeleteSample(Sample* pSample); |
void DeleteSample(Sample* pSample); |