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-2013 by Christian Schoenebeck * |
* Copyright (C) 2003-2016 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 * |
144 |
/** |
/** |
145 |
* Apply articulation connections to the respective RIFF chunks. You |
* Apply articulation connections to the respective RIFF chunks. You |
146 |
* have to call File::Save() to make changes persistent. |
* have to call File::Save() to make changes persistent. |
147 |
|
* |
148 |
|
* @param pProgress - callback function for progress notification |
149 |
*/ |
*/ |
150 |
void Articulation::UpdateChunks() { |
void Articulation::UpdateChunks(progress_t* pProgress) { |
151 |
const int iEntrySize = 12; // 12 bytes per connection block |
const int iEntrySize = 12; // 12 bytes per connection block |
152 |
pArticulationCk->Resize(HeaderSize + Connections * iEntrySize); |
pArticulationCk->Resize(HeaderSize + Connections * iEntrySize); |
153 |
uint8_t* pData = (uint8_t*) pArticulationCk->LoadChunkData(); |
uint8_t* pData = (uint8_t*) pArticulationCk->LoadChunkData(); |
219 |
/** |
/** |
220 |
* Apply all articulations to the respective RIFF chunks. You have to |
* Apply all articulations to the respective RIFF chunks. You have to |
221 |
* call File::Save() to make changes persistent. |
* call File::Save() to make changes persistent. |
222 |
|
* |
223 |
|
* @param pProgress - callback function for progress notification |
224 |
*/ |
*/ |
225 |
void Articulator::UpdateChunks() { |
void Articulator::UpdateChunks(progress_t* pProgress) { |
226 |
if (pArticulations) { |
if (pArticulations) { |
227 |
ArticulationList::iterator iter = pArticulations->begin(); |
ArticulationList::iterator iter = pArticulations->begin(); |
228 |
ArticulationList::iterator end = pArticulations->end(); |
ArticulationList::iterator end = pArticulations->end(); |
229 |
for (; iter != end; ++iter) { |
for (; iter != end; ++iter) { |
230 |
(*iter)->UpdateChunks(); |
(*iter)->UpdateChunks(pProgress); |
231 |
} |
} |
232 |
} |
} |
233 |
} |
} |
340 |
* |
* |
341 |
* Apply current INFO field values to the respective INFO chunks. You |
* Apply current INFO field values to the respective INFO chunks. You |
342 |
* have to call File::Save() to make changes persistent. |
* have to call File::Save() to make changes persistent. |
343 |
|
* |
344 |
|
* @param pProgress - callback function for progress notification |
345 |
*/ |
*/ |
346 |
void Info::UpdateChunks() { |
void Info::UpdateChunks(progress_t* pProgress) { |
347 |
if (!pResourceListChunk) return; |
if (!pResourceListChunk) return; |
348 |
|
|
349 |
// make sure INFO list chunk exists |
// make sure INFO list chunk exists |
470 |
* will not be applied at the moment (yet). |
* will not be applied at the moment (yet). |
471 |
* |
* |
472 |
* You have to call File::Save() to make changes persistent. |
* You have to call File::Save() to make changes persistent. |
473 |
|
* |
474 |
|
* @param pProgress - callback function for progress notification |
475 |
*/ |
*/ |
476 |
void Resource::UpdateChunks() { |
void Resource::UpdateChunks(progress_t* pProgress) { |
477 |
pInfo->UpdateChunks(); |
pInfo->UpdateChunks(pProgress); |
478 |
|
|
479 |
if (pDLSID) { |
if (pDLSID) { |
480 |
// make sure 'dlid' chunk exists |
// make sure 'dlid' chunk exists |
590 |
/** |
/** |
591 |
* Apply all sample player options to the respective RIFF chunk. You |
* Apply all sample player options to the respective RIFF chunk. You |
592 |
* have to call File::Save() to make changes persistent. |
* have to call File::Save() to make changes persistent. |
593 |
|
* |
594 |
|
* @param pProgress - callback function for progress notification |
595 |
*/ |
*/ |
596 |
void Sampler::UpdateChunks() { |
void Sampler::UpdateChunks(progress_t* pProgress) { |
597 |
// make sure 'wsmp' chunk exists |
// make sure 'wsmp' chunk exists |
598 |
RIFF::Chunk* wsmp = pParentList->GetSubChunk(CHUNK_ID_WSMP); |
RIFF::Chunk* wsmp = pParentList->GetSubChunk(CHUNK_ID_WSMP); |
599 |
int wsmpSize = uiHeaderSize + SampleLoops * 16; |
int wsmpSize = uiHeaderSize + SampleLoops * 16; |
711 |
* @param WavePoolOffset - offset of this sample data from wave pool |
* @param WavePoolOffset - offset of this sample data from wave pool |
712 |
* ('wvpl') list chunk |
* ('wvpl') list chunk |
713 |
*/ |
*/ |
714 |
Sample::Sample(File* pFile, RIFF::List* waveList, unsigned long WavePoolOffset) : Resource(pFile, waveList) { |
Sample::Sample(File* pFile, RIFF::List* waveList, file_offset_t WavePoolOffset) : Resource(pFile, waveList) { |
715 |
pWaveList = waveList; |
pWaveList = waveList; |
716 |
ulWavePoolOffset = WavePoolOffset - LIST_HEADER_SIZE; |
ullWavePoolOffset = WavePoolOffset - LIST_HEADER_SIZE(waveList->GetFile()->GetFileOffsetSize()); |
717 |
pCkFormat = waveList->GetSubChunk(CHUNK_ID_FMT); |
pCkFormat = waveList->GetSubChunk(CHUNK_ID_FMT); |
718 |
pCkData = waveList->GetSubChunk(CHUNK_ID_DATA); |
pCkData = waveList->GetSubChunk(CHUNK_ID_DATA); |
719 |
if (pCkFormat) { |
if (pCkFormat) { |
754 |
RIFF::List* pParent = pWaveList->GetParent(); |
RIFF::List* pParent = pWaveList->GetParent(); |
755 |
pParent->DeleteSubChunk(pWaveList); |
pParent->DeleteSubChunk(pWaveList); |
756 |
} |
} |
757 |
|
|
758 |
|
/** |
759 |
|
* Make a deep copy of the Sample object given by @a orig (without the |
760 |
|
* actual sample waveform data however) and assign it to this object. |
761 |
|
* |
762 |
|
* This is a special internal variant of CopyAssign() which only copies the |
763 |
|
* most mandatory member variables. It will be called by gig::Sample |
764 |
|
* descendent instead of CopyAssign() since gig::Sample has its own |
765 |
|
* implementation to access and copy the actual sample waveform data. |
766 |
|
* |
767 |
|
* @param orig - original Sample object to be copied from |
768 |
|
*/ |
769 |
|
void Sample::CopyAssignCore(const Sample* orig) { |
770 |
|
// handle base classes |
771 |
|
Resource::CopyAssign(orig); |
772 |
|
// handle actual own attributes of this class |
773 |
|
FormatTag = orig->FormatTag; |
774 |
|
Channels = orig->Channels; |
775 |
|
SamplesPerSecond = orig->SamplesPerSecond; |
776 |
|
AverageBytesPerSecond = orig->AverageBytesPerSecond; |
777 |
|
BlockAlign = orig->BlockAlign; |
778 |
|
BitDepth = orig->BitDepth; |
779 |
|
SamplesTotal = orig->SamplesTotal; |
780 |
|
FrameSize = orig->FrameSize; |
781 |
|
} |
782 |
|
|
783 |
|
/** |
784 |
|
* Make a deep copy of the Sample object given by @a orig and assign it to |
785 |
|
* this object. |
786 |
|
* |
787 |
|
* @param orig - original Sample object to be copied from |
788 |
|
*/ |
789 |
|
void Sample::CopyAssign(const Sample* orig) { |
790 |
|
CopyAssignCore(orig); |
791 |
|
|
792 |
|
// copy sample waveform data (reading directly from disc) |
793 |
|
Resize(orig->GetSize()); |
794 |
|
char* buf = (char*) LoadSampleData(); |
795 |
|
Sample* pOrig = (Sample*) orig; //HACK: circumventing the constness here for now |
796 |
|
const file_offset_t restorePos = pOrig->pCkData->GetPos(); |
797 |
|
pOrig->SetPos(0); |
798 |
|
for (file_offset_t todo = pOrig->GetSize(), i = 0; todo; ) { |
799 |
|
const int iReadAtOnce = 64*1024; |
800 |
|
file_offset_t n = (iReadAtOnce < todo) ? iReadAtOnce : todo; |
801 |
|
n = pOrig->Read(&buf[i], n); |
802 |
|
if (!n) break; |
803 |
|
todo -= n; |
804 |
|
i += (n * pOrig->FrameSize); |
805 |
|
} |
806 |
|
pOrig->pCkData->SetPos(restorePos); |
807 |
|
} |
808 |
|
|
809 |
/** @brief Load sample data into RAM. |
/** @brief Load sample data into RAM. |
810 |
* |
* |
855 |
* @returns number of sample points or 0 if FormatTag != DLS_WAVE_FORMAT_PCM |
* @returns number of sample points or 0 if FormatTag != DLS_WAVE_FORMAT_PCM |
856 |
* @see FrameSize, FormatTag |
* @see FrameSize, FormatTag |
857 |
*/ |
*/ |
858 |
unsigned long Sample::GetSize() { |
file_offset_t Sample::GetSize() const { |
859 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; |
860 |
return (pCkData) ? pCkData->GetSize() / FrameSize : 0; |
return (pCkData) ? pCkData->GetSize() / FrameSize : 0; |
861 |
} |
} |
882 |
* FormatTag must be DLS_WAVE_FORMAT_PCM. Trying to resize samples with |
* FormatTag must be DLS_WAVE_FORMAT_PCM. Trying to resize samples with |
883 |
* other formats will fail! |
* other formats will fail! |
884 |
* |
* |
885 |
* @param iNewSize - new sample wave data size in sample points (must be |
* @param NewSize - new sample wave data size in sample points (must be |
886 |
* greater than zero) |
* greater than zero) |
887 |
* @throws Excecption if FormatTag != DLS_WAVE_FORMAT_PCM |
* @throws Exception if FormatTag != DLS_WAVE_FORMAT_PCM |
888 |
* @throws Exception if \a iNewSize is less than 1 |
* @throws Exception if \a NewSize is less than 1 or unrealistic large |
889 |
* @see File::Save(), FrameSize, FormatTag |
* @see File::Save(), FrameSize, FormatTag |
890 |
*/ |
*/ |
891 |
void Sample::Resize(int iNewSize) { |
void Sample::Resize(file_offset_t NewSize) { |
892 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) throw Exception("Sample's format is not DLS_WAVE_FORMAT_PCM"); |
if (FormatTag != DLS_WAVE_FORMAT_PCM) throw Exception("Sample's format is not DLS_WAVE_FORMAT_PCM"); |
893 |
if (iNewSize < 1) throw Exception("Sample size must be at least one sample point"); |
if (NewSize < 1) throw Exception("Sample size must be at least one sample point"); |
894 |
const int iSizeInBytes = iNewSize * FrameSize; |
if ((NewSize >> 48) != 0) |
895 |
|
throw Exception("Unrealistic high DLS sample size detected"); |
896 |
|
const file_offset_t sizeInBytes = NewSize * FrameSize; |
897 |
pCkData = pWaveList->GetSubChunk(CHUNK_ID_DATA); |
pCkData = pWaveList->GetSubChunk(CHUNK_ID_DATA); |
898 |
if (pCkData) pCkData->Resize(iSizeInBytes); |
if (pCkData) pCkData->Resize(sizeInBytes); |
899 |
else pCkData = pWaveList->AddSubChunk(CHUNK_ID_DATA, iSizeInBytes); |
else pCkData = pWaveList->AddSubChunk(CHUNK_ID_DATA, sizeInBytes); |
900 |
} |
} |
901 |
|
|
902 |
/** |
/** |
915 |
* @throws Exception if no data RIFF chunk was created for the sample yet |
* @throws Exception if no data RIFF chunk was created for the sample yet |
916 |
* @see FrameSize, FormatTag |
* @see FrameSize, FormatTag |
917 |
*/ |
*/ |
918 |
unsigned long Sample::SetPos(unsigned long SampleCount, RIFF::stream_whence_t Whence) { |
file_offset_t Sample::SetPos(file_offset_t SampleCount, RIFF::stream_whence_t Whence) { |
919 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
920 |
if (!pCkData) throw Exception("No data chunk created for sample yet, call Sample::Resize() to create one"); |
if (!pCkData) throw Exception("No data chunk created for sample yet, call Sample::Resize() to create one"); |
921 |
unsigned long orderedBytes = SampleCount * FrameSize; |
file_offset_t orderedBytes = SampleCount * FrameSize; |
922 |
unsigned long result = pCkData->SetPos(orderedBytes, Whence); |
file_offset_t result = pCkData->SetPos(orderedBytes, Whence); |
923 |
return (result == orderedBytes) ? SampleCount |
return (result == orderedBytes) ? SampleCount |
924 |
: result / FrameSize; |
: result / FrameSize; |
925 |
} |
} |
933 |
* @param pBuffer destination buffer |
* @param pBuffer destination buffer |
934 |
* @param SampleCount number of sample points to read |
* @param SampleCount number of sample points to read |
935 |
*/ |
*/ |
936 |
unsigned long Sample::Read(void* pBuffer, unsigned long SampleCount) { |
file_offset_t Sample::Read(void* pBuffer, file_offset_t SampleCount) { |
937 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
938 |
return pCkData->Read(pBuffer, SampleCount, FrameSize); // FIXME: channel inversion due to endian correction? |
return pCkData->Read(pBuffer, SampleCount, FrameSize); // FIXME: channel inversion due to endian correction? |
939 |
} |
} |
953 |
* @throws Exception if current sample size is too small |
* @throws Exception if current sample size is too small |
954 |
* @see LoadSampleData() |
* @see LoadSampleData() |
955 |
*/ |
*/ |
956 |
unsigned long Sample::Write(void* pBuffer, unsigned long SampleCount) { |
file_offset_t Sample::Write(void* pBuffer, file_offset_t SampleCount) { |
957 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
if (FormatTag != DLS_WAVE_FORMAT_PCM) return 0; // failed: wave data not PCM format |
958 |
if (GetSize() < SampleCount) throw Exception("Could not write sample data, current sample size to small"); |
if (GetSize() < SampleCount) throw Exception("Could not write sample data, current sample size to small"); |
959 |
return pCkData->Write(pBuffer, SampleCount, FrameSize); // FIXME: channel inversion due to endian correction? |
return pCkData->Write(pBuffer, SampleCount, FrameSize); // FIXME: channel inversion due to endian correction? |
963 |
* Apply sample and its settings to the respective RIFF chunks. You have |
* Apply sample and its settings to the respective RIFF chunks. You have |
964 |
* to call File::Save() to make changes persistent. |
* to call File::Save() to make changes persistent. |
965 |
* |
* |
966 |
|
* @param pProgress - callback function for progress notification |
967 |
* @throws Exception if FormatTag != DLS_WAVE_FORMAT_PCM or no sample data |
* @throws Exception if FormatTag != DLS_WAVE_FORMAT_PCM or no sample data |
968 |
* was provided yet |
* was provided yet |
969 |
*/ |
*/ |
970 |
void Sample::UpdateChunks() { |
void Sample::UpdateChunks(progress_t* pProgress) { |
971 |
if (FormatTag != DLS_WAVE_FORMAT_PCM) |
if (FormatTag != DLS_WAVE_FORMAT_PCM) |
972 |
throw Exception("Could not save sample, only PCM format is supported"); |
throw Exception("Could not save sample, only PCM format is supported"); |
973 |
// we refuse to do anything if not sample wave form was provided yet |
// we refuse to do anything if not sample wave form was provided yet |
974 |
if (!pCkData) |
if (!pCkData) |
975 |
throw Exception("Could not save sample, there is no sample data to save"); |
throw Exception("Could not save sample, there is no sample data to save"); |
976 |
// update chunks of base class as well |
// update chunks of base class as well |
977 |
Resource::UpdateChunks(); |
Resource::UpdateChunks(pProgress); |
978 |
// make sure 'fmt' chunk exists |
// make sure 'fmt' chunk exists |
979 |
RIFF::Chunk* pCkFormat = pWaveList->GetSubChunk(CHUNK_ID_FMT); |
RIFF::Chunk* pCkFormat = pWaveList->GetSubChunk(CHUNK_ID_FMT); |
980 |
if (!pCkFormat) pCkFormat = pWaveList->AddSubChunk(CHUNK_ID_FMT, 16); // assumes PCM format |
if (!pCkFormat) pCkFormat = pWaveList->AddSubChunk(CHUNK_ID_FMT, 16); // assumes PCM format |
996 |
Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : Resource(pInstrument, rgnList), Articulator(rgnList), Sampler(rgnList) { |
Region::Region(Instrument* pInstrument, RIFF::List* rgnList) : Resource(pInstrument, rgnList), Articulator(rgnList), Sampler(rgnList) { |
997 |
pCkRegion = rgnList; |
pCkRegion = rgnList; |
998 |
|
|
999 |
// articulation informations |
// articulation information |
1000 |
RIFF::Chunk* rgnh = rgnList->GetSubChunk(CHUNK_ID_RGNH); |
RIFF::Chunk* rgnh = rgnList->GetSubChunk(CHUNK_ID_RGNH); |
1001 |
if (rgnh) { |
if (rgnh) { |
1002 |
rgnh->Read(&KeyRange, 2, 2); |
rgnh->Read(&KeyRange, 2, 2); |
1018 |
} |
} |
1019 |
SelfNonExclusive = FormatOptionFlags & F_RGN_OPTION_SELFNONEXCLUSIVE; |
SelfNonExclusive = FormatOptionFlags & F_RGN_OPTION_SELFNONEXCLUSIVE; |
1020 |
|
|
1021 |
// sample informations |
// sample information |
1022 |
RIFF::Chunk* wlnk = rgnList->GetSubChunk(CHUNK_ID_WLNK); |
RIFF::Chunk* wlnk = rgnList->GetSubChunk(CHUNK_ID_WLNK); |
1023 |
if (wlnk) { |
if (wlnk) { |
1024 |
WaveLinkOptionFlags = wlnk->ReadUint16(); |
WaveLinkOptionFlags = wlnk->ReadUint16(); |
1049 |
Sample* Region::GetSample() { |
Sample* Region::GetSample() { |
1050 |
if (pSample) return pSample; |
if (pSample) return pSample; |
1051 |
File* file = (File*) GetParent()->GetParent(); |
File* file = (File*) GetParent()->GetParent(); |
1052 |
unsigned long soughtoffset = file->pWavePoolTable[WavePoolTableIndex]; |
uint64_t soughtoffset = file->pWavePoolTable[WavePoolTableIndex]; |
1053 |
Sample* sample = file->GetFirstSample(); |
Sample* sample = file->GetFirstSample(); |
1054 |
while (sample) { |
while (sample) { |
1055 |
if (sample->ulWavePoolOffset == soughtoffset) return (pSample = sample); |
if (sample->ullWavePoolOffset == soughtoffset) return (pSample = sample); |
1056 |
sample = file->GetNextSample(); |
sample = file->GetNextSample(); |
1057 |
} |
} |
1058 |
return NULL; |
return NULL; |
1107 |
* Apply Region settings to the respective RIFF chunks. You have to |
* Apply Region settings to the respective RIFF chunks. You have to |
1108 |
* call File::Save() to make changes persistent. |
* call File::Save() to make changes persistent. |
1109 |
* |
* |
1110 |
|
* @param pProgress - callback function for progress notification |
1111 |
* @throws Exception - if the Region's sample could not be found |
* @throws Exception - if the Region's sample could not be found |
1112 |
*/ |
*/ |
1113 |
void Region::UpdateChunks() { |
void Region::UpdateChunks(progress_t* pProgress) { |
1114 |
// make sure 'rgnh' chunk exists |
// make sure 'rgnh' chunk exists |
1115 |
RIFF::Chunk* rgnh = pCkRegion->GetSubChunk(CHUNK_ID_RGNH); |
RIFF::Chunk* rgnh = pCkRegion->GetSubChunk(CHUNK_ID_RGNH); |
1116 |
if (!rgnh) rgnh = pCkRegion->AddSubChunk(CHUNK_ID_RGNH, Layer ? 14 : 12); |
if (!rgnh) rgnh = pCkRegion->AddSubChunk(CHUNK_ID_RGNH, Layer ? 14 : 12); |
1129 |
|
|
1130 |
// update chunks of base classes as well (but skip Resource, |
// update chunks of base classes as well (but skip Resource, |
1131 |
// as a rgn doesn't seem to have dlid and INFO chunks) |
// as a rgn doesn't seem to have dlid and INFO chunks) |
1132 |
Articulator::UpdateChunks(); |
Articulator::UpdateChunks(pProgress); |
1133 |
Sampler::UpdateChunks(); |
Sampler::UpdateChunks(pProgress); |
1134 |
|
|
1135 |
// make sure 'wlnk' chunk exists |
// make sure 'wlnk' chunk exists |
1136 |
RIFF::Chunk* wlnk = pCkRegion->GetSubChunk(CHUNK_ID_WLNK); |
RIFF::Chunk* wlnk = pCkRegion->GetSubChunk(CHUNK_ID_WLNK); |
1187 |
PhaseGroup = orig->PhaseGroup; |
PhaseGroup = orig->PhaseGroup; |
1188 |
MultiChannel = orig->MultiChannel; |
MultiChannel = orig->MultiChannel; |
1189 |
Channel = orig->Channel; |
Channel = orig->Channel; |
1190 |
WavePoolTableIndex = orig->WavePoolTableIndex; |
// only take the raw sample reference if the two Region objects are |
1191 |
pSample = orig->pSample; |
// part of the same file |
1192 |
|
if (GetParent()->GetParent() == orig->GetParent()->GetParent()) { |
1193 |
|
WavePoolTableIndex = orig->WavePoolTableIndex; |
1194 |
|
pSample = orig->pSample; |
1195 |
|
} else { |
1196 |
|
WavePoolTableIndex = -1; |
1197 |
|
pSample = NULL; |
1198 |
|
} |
1199 |
FormatOptionFlags = orig->FormatOptionFlags; |
FormatOptionFlags = orig->FormatOptionFlags; |
1200 |
WaveLinkOptionFlags = orig->WaveLinkOptionFlags; |
WaveLinkOptionFlags = orig->WaveLinkOptionFlags; |
1201 |
// handle the last, a bit sensible attribute |
// handle the last, a bit sensible attribute |
1277 |
RIFF::List* rgn = lrgn->AddSubList(LIST_TYPE_RGN); |
RIFF::List* rgn = lrgn->AddSubList(LIST_TYPE_RGN); |
1278 |
Region* pNewRegion = new Region(this, rgn); |
Region* pNewRegion = new Region(this, rgn); |
1279 |
pRegions->push_back(pNewRegion); |
pRegions->push_back(pNewRegion); |
1280 |
Regions = pRegions->size(); |
Regions = (uint32_t) pRegions->size(); |
1281 |
return pNewRegion; |
return pNewRegion; |
1282 |
} |
} |
1283 |
|
|
1284 |
void Instrument::MoveRegion(Region* pSrc, Region* pDst) { |
void Instrument::MoveRegion(Region* pSrc, Region* pDst) { |
1285 |
RIFF::List* lrgn = pCkInstrument->GetSubList(LIST_TYPE_LRGN); |
RIFF::List* lrgn = pCkInstrument->GetSubList(LIST_TYPE_LRGN); |
1286 |
lrgn->MoveSubChunk(pSrc->pCkRegion, pDst ? pDst->pCkRegion : 0); |
lrgn->MoveSubChunk(pSrc->pCkRegion, (RIFF::Chunk*) (pDst ? pDst->pCkRegion : 0)); |
1287 |
|
|
1288 |
pRegions->remove(pSrc); |
pRegions->remove(pSrc); |
1289 |
RegionList::iterator iter = find(pRegions->begin(), pRegions->end(), pDst); |
RegionList::iterator iter = find(pRegions->begin(), pRegions->end(), pDst); |
1295 |
RegionList::iterator iter = find(pRegions->begin(), pRegions->end(), pRegion); |
RegionList::iterator iter = find(pRegions->begin(), pRegions->end(), pRegion); |
1296 |
if (iter == pRegions->end()) return; |
if (iter == pRegions->end()) return; |
1297 |
pRegions->erase(iter); |
pRegions->erase(iter); |
1298 |
Regions = pRegions->size(); |
Regions = (uint32_t) pRegions->size(); |
1299 |
delete pRegion; |
delete pRegion; |
1300 |
} |
} |
1301 |
|
|
1303 |
* Apply Instrument with all its Regions to the respective RIFF chunks. |
* Apply Instrument with all its Regions to the respective RIFF chunks. |
1304 |
* You have to call File::Save() to make changes persistent. |
* You have to call File::Save() to make changes persistent. |
1305 |
* |
* |
1306 |
|
* @param pProgress - callback function for progress notification |
1307 |
* @throws Exception - on errors |
* @throws Exception - on errors |
1308 |
*/ |
*/ |
1309 |
void Instrument::UpdateChunks() { |
void Instrument::UpdateChunks(progress_t* pProgress) { |
1310 |
// first update base classes' chunks |
// first update base classes' chunks |
1311 |
Resource::UpdateChunks(); |
Resource::UpdateChunks(pProgress); |
1312 |
Articulator::UpdateChunks(); |
Articulator::UpdateChunks(pProgress); |
1313 |
// make sure 'insh' chunk exists |
// make sure 'insh' chunk exists |
1314 |
RIFF::Chunk* insh = pCkInstrument->GetSubChunk(CHUNK_ID_INSH); |
RIFF::Chunk* insh = pCkInstrument->GetSubChunk(CHUNK_ID_INSH); |
1315 |
if (!insh) insh = pCkInstrument->AddSubChunk(CHUNK_ID_INSH, 12); |
if (!insh) insh = pCkInstrument->AddSubChunk(CHUNK_ID_INSH, 12); |
1316 |
uint8_t* pData = (uint8_t*) insh->LoadChunkData(); |
uint8_t* pData = (uint8_t*) insh->LoadChunkData(); |
1317 |
// update 'insh' chunk |
// update 'insh' chunk |
1318 |
Regions = (pRegions) ? pRegions->size() : 0; |
Regions = (pRegions) ? uint32_t(pRegions->size()) : 0; |
1319 |
midi_locale_t locale; |
midi_locale_t locale; |
1320 |
locale.instrument = MIDIProgram; |
locale.instrument = MIDIProgram; |
1321 |
locale.bank = MIDI_BANK_ENCODE(MIDIBankCoarse, MIDIBankFine); |
locale.bank = MIDI_BANK_ENCODE(MIDIBankCoarse, MIDIBankFine); |
1328 |
if (!pRegions) return; |
if (!pRegions) return; |
1329 |
RegionList::iterator iter = pRegions->begin(); |
RegionList::iterator iter = pRegions->begin(); |
1330 |
RegionList::iterator end = pRegions->end(); |
RegionList::iterator end = pRegions->end(); |
1331 |
for (; iter != end; ++iter) { |
for (int i = 0; iter != end; ++iter, ++i) { |
1332 |
(*iter)->UpdateChunks(); |
// divide local progress into subprogress |
1333 |
|
progress_t subprogress; |
1334 |
|
__divide_progress(pProgress, &subprogress, pRegions->size(), i); |
1335 |
|
// do the actual work |
1336 |
|
(*iter)->UpdateChunks(&subprogress); |
1337 |
} |
} |
1338 |
|
__notify_progress(pProgress, 1.0); // notify done |
1339 |
} |
} |
1340 |
|
|
1341 |
/** @brief Destructor. |
/** @brief Destructor. |
1469 |
for (int i = 0 ; i < WavePoolCount ; i++) { |
for (int i = 0 ; i < WavePoolCount ; i++) { |
1470 |
pWavePoolTableHi[i] = ptbl->ReadUint32(); |
pWavePoolTableHi[i] = ptbl->ReadUint32(); |
1471 |
pWavePoolTable[i] = ptbl->ReadUint32(); |
pWavePoolTable[i] = ptbl->ReadUint32(); |
1472 |
if (pWavePoolTable[i] & 0x80000000) |
//NOTE: disabled this 2GB check, not sure why this check was still left here (Christian, 2016-05-12) |
1473 |
throw DLS::Exception("Files larger than 2 GB not yet supported"); |
//if (pWavePoolTable[i] & 0x80000000) |
1474 |
|
// throw DLS::Exception("Files larger than 2 GB not yet supported"); |
1475 |
} |
} |
1476 |
} else { // conventional 32 bit offsets |
} else { // conventional 32 bit offsets |
1477 |
ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); |
ptbl->Read(pWavePoolTable, WavePoolCount, sizeof(uint32_t)); |
1528 |
if (!pSamples) pSamples = new SampleList; |
if (!pSamples) pSamples = new SampleList; |
1529 |
RIFF::List* wvpl = pRIFF->GetSubList(LIST_TYPE_WVPL); |
RIFF::List* wvpl = pRIFF->GetSubList(LIST_TYPE_WVPL); |
1530 |
if (wvpl) { |
if (wvpl) { |
1531 |
unsigned long wvplFileOffset = wvpl->GetFilePos(); |
file_offset_t wvplFileOffset = wvpl->GetFilePos(); |
1532 |
RIFF::List* wave = wvpl->GetFirstSubList(); |
RIFF::List* wave = wvpl->GetFirstSubList(); |
1533 |
while (wave) { |
while (wave) { |
1534 |
if (wave->GetListType() == LIST_TYPE_WAVE) { |
if (wave->GetListType() == LIST_TYPE_WAVE) { |
1535 |
unsigned long waveFileOffset = wave->GetFilePos(); |
file_offset_t waveFileOffset = wave->GetFilePos(); |
1536 |
pSamples->push_back(new Sample(this, wave, waveFileOffset - wvplFileOffset)); |
pSamples->push_back(new Sample(this, wave, waveFileOffset - wvplFileOffset)); |
1537 |
} |
} |
1538 |
wave = wvpl->GetNextSubList(); |
wave = wvpl->GetNextSubList(); |
1541 |
else { // Seen a dwpl list chunk instead of a wvpl list chunk in some file (officially not DLS compliant) |
else { // Seen a dwpl list chunk instead of a wvpl list chunk in some file (officially not DLS compliant) |
1542 |
RIFF::List* dwpl = pRIFF->GetSubList(LIST_TYPE_DWPL); |
RIFF::List* dwpl = pRIFF->GetSubList(LIST_TYPE_DWPL); |
1543 |
if (dwpl) { |
if (dwpl) { |
1544 |
unsigned long dwplFileOffset = dwpl->GetFilePos(); |
file_offset_t dwplFileOffset = dwpl->GetFilePos(); |
1545 |
RIFF::List* wave = dwpl->GetFirstSubList(); |
RIFF::List* wave = dwpl->GetFirstSubList(); |
1546 |
while (wave) { |
while (wave) { |
1547 |
if (wave->GetListType() == LIST_TYPE_WAVE) { |
if (wave->GetListType() == LIST_TYPE_WAVE) { |
1548 |
unsigned long waveFileOffset = wave->GetFilePos(); |
file_offset_t waveFileOffset = wave->GetFilePos(); |
1549 |
pSamples->push_back(new Sample(this, wave, waveFileOffset - dwplFileOffset)); |
pSamples->push_back(new Sample(this, wave, waveFileOffset - dwplFileOffset)); |
1550 |
} |
} |
1551 |
wave = dwpl->GetNextSubList(); |
wave = dwpl->GetNextSubList(); |
1678 |
String File::GetFileName() { |
String File::GetFileName() { |
1679 |
return pRIFF->GetFileName(); |
return pRIFF->GetFileName(); |
1680 |
} |
} |
1681 |
|
|
1682 |
|
/** |
1683 |
|
* You may call this method store a future file name, so you don't have to |
1684 |
|
* to pass it to the Save() call later on. |
1685 |
|
*/ |
1686 |
|
void File::SetFileName(const String& name) { |
1687 |
|
pRIFF->SetFileName(name); |
1688 |
|
} |
1689 |
|
|
1690 |
/** |
/** |
1691 |
* Apply all the DLS file's current instruments, samples and settings to |
* Apply all the DLS file's current instruments, samples and settings to |
1692 |
* the respective RIFF chunks. You have to call Save() to make changes |
* the respective RIFF chunks. You have to call Save() to make changes |
1693 |
* persistent. |
* persistent. |
1694 |
* |
* |
1695 |
|
* @param pProgress - callback function for progress notification |
1696 |
* @throws Exception - on errors |
* @throws Exception - on errors |
1697 |
*/ |
*/ |
1698 |
void File::UpdateChunks() { |
void File::UpdateChunks(progress_t* pProgress) { |
1699 |
// first update base class's chunks |
// first update base class's chunks |
1700 |
Resource::UpdateChunks(); |
Resource::UpdateChunks(pProgress); |
1701 |
|
|
1702 |
// if version struct exists, update 'vers' chunk |
// if version struct exists, update 'vers' chunk |
1703 |
if (pVersion) { |
if (pVersion) { |
1711 |
} |
} |
1712 |
|
|
1713 |
// update 'colh' chunk |
// update 'colh' chunk |
1714 |
Instruments = (pInstruments) ? pInstruments->size() : 0; |
Instruments = (pInstruments) ? uint32_t(pInstruments->size()) : 0; |
1715 |
RIFF::Chunk* colh = pRIFF->GetSubChunk(CHUNK_ID_COLH); |
RIFF::Chunk* colh = pRIFF->GetSubChunk(CHUNK_ID_COLH); |
1716 |
if (!colh) colh = pRIFF->AddSubChunk(CHUNK_ID_COLH, 4); |
if (!colh) colh = pRIFF->AddSubChunk(CHUNK_ID_COLH, 4); |
1717 |
uint8_t* pData = (uint8_t*) colh->LoadChunkData(); |
uint8_t* pData = (uint8_t*) colh->LoadChunkData(); |
1719 |
|
|
1720 |
// update instrument's chunks |
// update instrument's chunks |
1721 |
if (pInstruments) { |
if (pInstruments) { |
1722 |
|
// divide local progress into subprogress |
1723 |
|
progress_t subprogress; |
1724 |
|
__divide_progress(pProgress, &subprogress, 20.f, 0.f); // arbitrarily subdivided into 5% of total progress |
1725 |
|
|
1726 |
|
// do the actual work |
1727 |
InstrumentList::iterator iter = pInstruments->begin(); |
InstrumentList::iterator iter = pInstruments->begin(); |
1728 |
InstrumentList::iterator end = pInstruments->end(); |
InstrumentList::iterator end = pInstruments->end(); |
1729 |
for (; iter != end; ++iter) { |
for (int i = 0; iter != end; ++iter, ++i) { |
1730 |
(*iter)->UpdateChunks(); |
// divide subprogress into sub-subprogress |
1731 |
|
progress_t subsubprogress; |
1732 |
|
__divide_progress(&subprogress, &subsubprogress, pInstruments->size(), i); |
1733 |
|
// do the actual work |
1734 |
|
(*iter)->UpdateChunks(&subsubprogress); |
1735 |
} |
} |
1736 |
|
|
1737 |
|
__notify_progress(&subprogress, 1.0); // notify subprogress done |
1738 |
} |
} |
1739 |
|
|
1740 |
// update 'ptbl' chunk |
// update 'ptbl' chunk |
1741 |
const int iSamples = (pSamples) ? pSamples->size() : 0; |
const int iSamples = (pSamples) ? int(pSamples->size()) : 0; |
1742 |
const int iPtblOffsetSize = (b64BitWavePoolOffsets) ? 8 : 4; |
int iPtblOffsetSize = (b64BitWavePoolOffsets) ? 8 : 4; |
1743 |
RIFF::Chunk* ptbl = pRIFF->GetSubChunk(CHUNK_ID_PTBL); |
RIFF::Chunk* ptbl = pRIFF->GetSubChunk(CHUNK_ID_PTBL); |
1744 |
if (!ptbl) ptbl = pRIFF->AddSubChunk(CHUNK_ID_PTBL, 1 /*anything, we'll resize*/); |
if (!ptbl) ptbl = pRIFF->AddSubChunk(CHUNK_ID_PTBL, 1 /*anything, we'll resize*/); |
1745 |
const int iPtblSize = WavePoolHeaderSize + iPtblOffsetSize * iSamples; |
int iPtblSize = WavePoolHeaderSize + iPtblOffsetSize * iSamples; |
1746 |
ptbl->Resize(iPtblSize); |
ptbl->Resize(iPtblSize); |
1747 |
pData = (uint8_t*) ptbl->LoadChunkData(); |
pData = (uint8_t*) ptbl->LoadChunkData(); |
1748 |
WavePoolCount = iSamples; |
WavePoolCount = iSamples; |
1752 |
|
|
1753 |
// update sample's chunks |
// update sample's chunks |
1754 |
if (pSamples) { |
if (pSamples) { |
1755 |
|
// divide local progress into subprogress |
1756 |
|
progress_t subprogress; |
1757 |
|
__divide_progress(pProgress, &subprogress, 20.f, 1.f); // arbitrarily subdivided into 95% of total progress |
1758 |
|
|
1759 |
|
// do the actual work |
1760 |
SampleList::iterator iter = pSamples->begin(); |
SampleList::iterator iter = pSamples->begin(); |
1761 |
SampleList::iterator end = pSamples->end(); |
SampleList::iterator end = pSamples->end(); |
1762 |
for (; iter != end; ++iter) { |
for (int i = 0; iter != end; ++iter, ++i) { |
1763 |
(*iter)->UpdateChunks(); |
// divide subprogress into sub-subprogress |
1764 |
} |
progress_t subsubprogress; |
1765 |
|
__divide_progress(&subprogress, &subsubprogress, pSamples->size(), i); |
1766 |
|
// do the actual work |
1767 |
|
(*iter)->UpdateChunks(&subsubprogress); |
1768 |
|
} |
1769 |
|
|
1770 |
|
__notify_progress(&subprogress, 1.0); // notify subprogress done |
1771 |
|
} |
1772 |
|
|
1773 |
|
// the RIFF file to be written might now been grown >= 4GB or might |
1774 |
|
// been shrunk < 4GB, so we might need to update the wave pool offset |
1775 |
|
// size and thus accordingly we would need to resize the wave pool |
1776 |
|
// chunk |
1777 |
|
const file_offset_t finalFileSize = pRIFF->GetRequiredFileSize(); |
1778 |
|
const bool bRequires64Bit = (finalFileSize >> 32) != 0; |
1779 |
|
if (b64BitWavePoolOffsets != bRequires64Bit) { |
1780 |
|
b64BitWavePoolOffsets = bRequires64Bit; |
1781 |
|
iPtblOffsetSize = (b64BitWavePoolOffsets) ? 8 : 4; |
1782 |
|
iPtblSize = WavePoolHeaderSize + iPtblOffsetSize * iSamples; |
1783 |
|
ptbl->Resize(iPtblSize); |
1784 |
} |
} |
1785 |
|
|
1786 |
|
__notify_progress(pProgress, 1.0); // notify done |
1787 |
} |
} |
1788 |
|
|
1789 |
/** @brief Save changes to another file. |
/** @brief Save changes to another file. |
1798 |
* the new file (given by \a Path) afterwards. |
* the new file (given by \a Path) afterwards. |
1799 |
* |
* |
1800 |
* @param Path - path and file name where everything should be written to |
* @param Path - path and file name where everything should be written to |
1801 |
|
* @param pProgress - optional: callback function for progress notification |
1802 |
*/ |
*/ |
1803 |
void File::Save(const String& Path) { |
void File::Save(const String& Path, progress_t* pProgress) { |
1804 |
UpdateChunks(); |
{ |
1805 |
pRIFF->Save(Path); |
// divide local progress into subprogress |
1806 |
__UpdateWavePoolTableChunk(); |
progress_t subprogress; |
1807 |
|
__divide_progress(pProgress, &subprogress, 2.f, 0.f); // arbitrarily subdivided into 50% of total progress |
1808 |
|
// do the actual work |
1809 |
|
UpdateChunks(&subprogress); |
1810 |
|
|
1811 |
|
} |
1812 |
|
{ |
1813 |
|
// divide local progress into subprogress |
1814 |
|
progress_t subprogress; |
1815 |
|
__divide_progress(pProgress, &subprogress, 2.f, 1.f); // arbitrarily subdivided into 50% of total progress |
1816 |
|
// do the actual work |
1817 |
|
pRIFF->Save(Path, &subprogress); |
1818 |
|
} |
1819 |
|
UpdateFileOffsets(); |
1820 |
|
__notify_progress(pProgress, 1.0); // notify done |
1821 |
} |
} |
1822 |
|
|
1823 |
/** @brief Save changes to same file. |
/** @brief Save changes to same file. |
1826 |
* file. The file might temporarily grow to a higher size than it will |
* file. The file might temporarily grow to a higher size than it will |
1827 |
* have at the end of the saving process. |
* have at the end of the saving process. |
1828 |
* |
* |
1829 |
* @throws RIFF::Exception if any kind of IO error occured |
* @param pProgress - optional: callback function for progress notification |
1830 |
* @throws DLS::Exception if any kind of DLS specific error occured |
* @throws RIFF::Exception if any kind of IO error occurred |
1831 |
|
* @throws DLS::Exception if any kind of DLS specific error occurred |
1832 |
|
*/ |
1833 |
|
void File::Save(progress_t* pProgress) { |
1834 |
|
{ |
1835 |
|
// divide local progress into subprogress |
1836 |
|
progress_t subprogress; |
1837 |
|
__divide_progress(pProgress, &subprogress, 2.f, 0.f); // arbitrarily subdivided into 50% of total progress |
1838 |
|
// do the actual work |
1839 |
|
UpdateChunks(&subprogress); |
1840 |
|
} |
1841 |
|
{ |
1842 |
|
// divide local progress into subprogress |
1843 |
|
progress_t subprogress; |
1844 |
|
__divide_progress(pProgress, &subprogress, 2.f, 1.f); // arbitrarily subdivided into 50% of total progress |
1845 |
|
// do the actual work |
1846 |
|
pRIFF->Save(&subprogress); |
1847 |
|
} |
1848 |
|
UpdateFileOffsets(); |
1849 |
|
__notify_progress(pProgress, 1.0); // notify done |
1850 |
|
} |
1851 |
|
|
1852 |
|
/** @brief Updates all file offsets stored all over the file. |
1853 |
|
* |
1854 |
|
* This virtual method is called whenever the overall file layout has been |
1855 |
|
* changed (i.e. file or individual RIFF chunks have been resized). It is |
1856 |
|
* then the responsibility of this method to update all file offsets stored |
1857 |
|
* in the file format. For example samples are referenced by instruments by |
1858 |
|
* file offsets. The gig format also stores references to instrument |
1859 |
|
* scripts as file offsets, and thus it overrides this method to update |
1860 |
|
* those file offsets as well. |
1861 |
*/ |
*/ |
1862 |
void File::Save() { |
void File::UpdateFileOffsets() { |
|
UpdateChunks(); |
|
|
pRIFF->Save(); |
|
1863 |
__UpdateWavePoolTableChunk(); |
__UpdateWavePoolTableChunk(); |
1864 |
} |
} |
1865 |
|
|
1897 |
RIFF::Chunk* ptbl = pRIFF->GetSubChunk(CHUNK_ID_PTBL); |
RIFF::Chunk* ptbl = pRIFF->GetSubChunk(CHUNK_ID_PTBL); |
1898 |
const int iOffsetSize = (b64BitWavePoolOffsets) ? 8 : 4; |
const int iOffsetSize = (b64BitWavePoolOffsets) ? 8 : 4; |
1899 |
// check if 'ptbl' chunk is large enough |
// check if 'ptbl' chunk is large enough |
1900 |
WavePoolCount = (pSamples) ? pSamples->size() : 0; |
WavePoolCount = (pSamples) ? uint32_t(pSamples->size()) : 0; |
1901 |
const unsigned long ulRequiredSize = WavePoolHeaderSize + iOffsetSize * WavePoolCount; |
const file_offset_t ulRequiredSize = WavePoolHeaderSize + iOffsetSize * WavePoolCount; |
1902 |
if (ptbl->GetSize() < ulRequiredSize) throw Exception("Fatal error, 'ptbl' chunk too small"); |
if (ptbl->GetSize() < ulRequiredSize) throw Exception("Fatal error, 'ptbl' chunk too small"); |
1903 |
// save the 'ptbl' chunk's current read/write position |
// save the 'ptbl' chunk's current read/write position |
1904 |
unsigned long ulOriginalPos = ptbl->GetPos(); |
file_offset_t ullOriginalPos = ptbl->GetPos(); |
1905 |
// update headers |
// update headers |
1906 |
ptbl->SetPos(0); |
ptbl->SetPos(0); |
1907 |
uint32_t tmp = WavePoolHeaderSize; |
uint32_t tmp = WavePoolHeaderSize; |
1924 |
} |
} |
1925 |
} |
} |
1926 |
// restore 'ptbl' chunk's original read/write position |
// restore 'ptbl' chunk's original read/write position |
1927 |
ptbl->SetPos(ulOriginalPos); |
ptbl->SetPos(ullOriginalPos); |
1928 |
} |
} |
1929 |
|
|
1930 |
/** |
/** |
1933 |
* exists already. |
* exists already. |
1934 |
*/ |
*/ |
1935 |
void File::__UpdateWavePoolTable() { |
void File::__UpdateWavePoolTable() { |
1936 |
WavePoolCount = (pSamples) ? pSamples->size() : 0; |
WavePoolCount = (pSamples) ? uint32_t(pSamples->size()) : 0; |
1937 |
// resize wave pool table arrays |
// resize wave pool table arrays |
1938 |
if (pWavePoolTable) delete[] pWavePoolTable; |
if (pWavePoolTable) delete[] pWavePoolTable; |
1939 |
if (pWavePoolTableHi) delete[] pWavePoolTableHi; |
if (pWavePoolTableHi) delete[] pWavePoolTableHi; |
1947 |
SampleList::iterator iter = pSamples->begin(); |
SampleList::iterator iter = pSamples->begin(); |
1948 |
SampleList::iterator end = pSamples->end(); |
SampleList::iterator end = pSamples->end(); |
1949 |
for (int i = 0 ; iter != end ; ++iter, i++) { |
for (int i = 0 ; iter != end ; ++iter, i++) { |
1950 |
uint64_t _64BitOffset = (*iter)->pWaveList->GetFilePos() - wvplFileOffset - LIST_HEADER_SIZE; |
uint64_t _64BitOffset = (*iter)->pWaveList->GetFilePos() - wvplFileOffset - LIST_HEADER_SIZE(pRIFF->GetFileOffsetSize()); |
1951 |
(*iter)->ulWavePoolOffset = _64BitOffset; |
(*iter)->ullWavePoolOffset = _64BitOffset; |
1952 |
pWavePoolTableHi[i] = (uint32_t) (_64BitOffset >> 32); |
pWavePoolTableHi[i] = (uint32_t) (_64BitOffset >> 32); |
1953 |
pWavePoolTable[i] = (uint32_t) _64BitOffset; |
pWavePoolTable[i] = (uint32_t) _64BitOffset; |
1954 |
} |
} |
1956 |
SampleList::iterator iter = pSamples->begin(); |
SampleList::iterator iter = pSamples->begin(); |
1957 |
SampleList::iterator end = pSamples->end(); |
SampleList::iterator end = pSamples->end(); |
1958 |
for (int i = 0 ; iter != end ; ++iter, i++) { |
for (int i = 0 ; iter != end ; ++iter, i++) { |
1959 |
uint64_t _64BitOffset = (*iter)->pWaveList->GetFilePos() - wvplFileOffset - LIST_HEADER_SIZE; |
uint64_t _64BitOffset = (*iter)->pWaveList->GetFilePos() - wvplFileOffset - LIST_HEADER_SIZE(pRIFF->GetFileOffsetSize()); |
1960 |
(*iter)->ulWavePoolOffset = _64BitOffset; |
(*iter)->ullWavePoolOffset = _64BitOffset; |
1961 |
pWavePoolTable[i] = (uint32_t) _64BitOffset; |
pWavePoolTable[i] = (uint32_t) _64BitOffset; |
1962 |
} |
} |
1963 |
} |
} |