2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2016 by Christian Schoenebeck * |
* Copyright (C) 2003-2019 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
60 |
# define CHUNK_ID_COLH 0x636F6C68 |
# define CHUNK_ID_COLH 0x636F6C68 |
61 |
# define CHUNK_ID_ARTL 0x6172746C |
# define CHUNK_ID_ARTL 0x6172746C |
62 |
# define CHUNK_ID_ART2 0x61727432 |
# define CHUNK_ID_ART2 0x61727432 |
63 |
|
# define CHUNK_ID_XFIL 0x7866696C |
64 |
|
# define CHUNK_ID_DOXF 0x646F7866 |
65 |
#else // little endian |
#else // little endian |
66 |
# define RIFF_TYPE_DLS 0x20534C44 |
# define RIFF_TYPE_DLS 0x20534C44 |
67 |
# define LIST_TYPE_WVPL 0x6C707677 |
# define LIST_TYPE_WVPL 0x6C707677 |
96 |
# define CHUNK_ID_COLH 0x686C6F63 |
# define CHUNK_ID_COLH 0x686C6F63 |
97 |
# define CHUNK_ID_ARTL 0x6C747261 |
# define CHUNK_ID_ARTL 0x6C747261 |
98 |
# define CHUNK_ID_ART2 0x32747261 |
# define CHUNK_ID_ART2 0x32747261 |
99 |
|
# define CHUNK_ID_XFIL 0x6C696678 |
100 |
|
# define CHUNK_ID_DOXF 0x66786F64 |
101 |
#endif // WORDS_BIGENDIAN |
#endif // WORDS_BIGENDIAN |
102 |
|
|
103 |
#define DLS_WAVE_FORMAT_PCM 0x0001 |
#define DLS_WAVE_FORMAT_PCM 0x0001 |
128 |
}; |
}; |
129 |
|
|
130 |
/** Connection Sources */ |
/** Connection Sources */ |
131 |
typedef enum { |
enum conn_src_t { |
132 |
// Modulator Sources |
// Modulator Sources |
133 |
conn_src_none = 0x0000, |
conn_src_none = 0x0000, |
134 |
conn_src_lfo = 0x0001, |
conn_src_lfo = 0x0001, |
151 |
conn_src_rpn0 = 0x0100, |
conn_src_rpn0 = 0x0100, |
152 |
conn_src_rpn1 = 0x0101, |
conn_src_rpn1 = 0x0101, |
153 |
conn_src_rpn2 = 0x0102 |
conn_src_rpn2 = 0x0102 |
154 |
} conn_src_t; |
}; |
155 |
|
|
156 |
/** Connection Destinations */ |
/** Connection Destinations */ |
157 |
typedef enum { |
enum conn_dst_t { |
158 |
// Generic Destinations |
// Generic Destinations |
159 |
conn_dst_none = 0x0000, |
conn_dst_none = 0x0000, |
160 |
conn_dst_gain = 0x0001, |
conn_dst_gain = 0x0001, |
196 |
// Filter Destinations |
// Filter Destinations |
197 |
conn_dst_filter_cutoff = 0x0500, |
conn_dst_filter_cutoff = 0x0500, |
198 |
conn_dst_filter_q = 0x0501 |
conn_dst_filter_q = 0x0501 |
199 |
} conn_dst_t; |
}; |
200 |
|
|
201 |
/** Connection Transforms */ |
/** Connection Transforms */ |
202 |
typedef enum { |
enum conn_trn_t { |
203 |
conn_trn_none = 0x0000, |
conn_trn_none = 0x0000, |
204 |
conn_trn_concave = 0x0001, |
conn_trn_concave = 0x0001, |
205 |
conn_trn_convex = 0x0002, |
conn_trn_convex = 0x0002, |
206 |
conn_trn_switch = 0x0003 |
conn_trn_switch = 0x0003 |
207 |
} conn_trn_t; |
}; |
208 |
|
|
209 |
/** Lower and upper limit of a range. */ |
/** Lower and upper limit of a range. */ |
210 |
struct range_t { |
struct range_t { |
211 |
uint16_t low; ///< Low value of range. |
uint16_t low; ///< Low value of range. |
356 |
const Resource* GetParent() const { return pParent; } |
const Resource* GetParent() const { return pParent; } |
357 |
virtual void UpdateChunks(progress_t* pProgress); |
virtual void UpdateChunks(progress_t* pProgress); |
358 |
void GenerateDLSID(); |
void GenerateDLSID(); |
359 |
|
static void GenerateDLSID(dlsid_t* pDLSID); |
360 |
virtual void CopyAssign(const Resource* orig); |
virtual void CopyAssign(const Resource* orig); |
361 |
protected: |
protected: |
362 |
Resource* pParent; |
Resource* pParent; |
527 |
typedef std::list<Instrument*> InstrumentList; |
typedef std::list<Instrument*> InstrumentList; |
528 |
|
|
529 |
RIFF::File* pRIFF; |
RIFF::File* pRIFF; |
530 |
std::list<RIFF::File*> ExtensionFiles; |
std::list<RIFF::File*> ExtensionFiles; //FIXME: These should automatically be freed, since implicitly allocated. |
531 |
SampleList* pSamples; |
SampleList* pSamples; |
532 |
SampleList::iterator SamplesIterator; |
SampleList::iterator SamplesIterator; |
533 |
InstrumentList* pInstruments; |
InstrumentList* pInstruments; |
537 |
uint32_t* pWavePoolTable; |
uint32_t* pWavePoolTable; |
538 |
uint32_t* pWavePoolTableHi; |
uint32_t* pWavePoolTableHi; |
539 |
bool b64BitWavePoolOffsets; |
bool b64BitWavePoolOffsets; |
540 |
|
bool bOwningRiff; ///< If @c true then @c pRIFF was implicitly allocated by this class and hence pRIFF will automatically be freed by the @c DLS::File destructor in that case. |
541 |
|
|
542 |
virtual void LoadSamples(); |
virtual void LoadSamples(); |
543 |
virtual void LoadInstruments(); |
virtual void LoadInstruments(); |
558 |
*/ |
*/ |
559 |
class Exception : public RIFF::Exception { |
class Exception : public RIFF::Exception { |
560 |
public: |
public: |
561 |
Exception(String Message); |
Exception(String format, ...); |
562 |
|
Exception(String format, va_list arg); |
563 |
void PrintMessage(); |
void PrintMessage(); |
564 |
|
protected: |
565 |
|
Exception(); |
566 |
}; |
}; |
567 |
|
|
568 |
String libraryName(); |
String libraryName(); |