609 |
uint16_t iSampleGroup = 0; // 0 refers to default sample group |
uint16_t iSampleGroup = 0; // 0 refers to default sample group |
610 |
File* pFile = static_cast<File*>(pParent); |
File* pFile = static_cast<File*>(pParent); |
611 |
if (pFile->pGroups) { |
if (pFile->pGroups) { |
612 |
std::list<Group*>::iterator iter = pFile->pGroups->begin(); |
std::vector<Group*>::iterator iter = pFile->pGroups->begin(); |
613 |
std::list<Group*>::iterator end = pFile->pGroups->end(); |
std::vector<Group*>::iterator end = pFile->pGroups->end(); |
614 |
for (int i = 0; iter != end; i++, iter++) { |
for (int i = 0; iter != end; i++, iter++) { |
615 |
if (*iter == pGroup) { |
if (*iter == pGroup) { |
616 |
iSampleGroup = i; |
iSampleGroup = i; |
4325 |
uint64_t soughtoffset = |
uint64_t soughtoffset = |
4326 |
uint64_t(file->pWavePoolTable[WavePoolTableIndex]) | |
uint64_t(file->pWavePoolTable[WavePoolTableIndex]) | |
4327 |
uint64_t(file->pWavePoolTableHi[WavePoolTableIndex]) << 32; |
uint64_t(file->pWavePoolTableHi[WavePoolTableIndex]) << 32; |
4328 |
Sample* sample = file->GetFirstSample(pProgress); |
size_t i = 0; |
4329 |
while (sample) { |
for (Sample* sample = file->GetSample(i, pProgress); sample; |
4330 |
|
sample = file->GetSample(++i)) |
4331 |
|
{ |
4332 |
if (sample->ullWavePoolOffset == soughtoffset) |
if (sample->ullWavePoolOffset == soughtoffset) |
4333 |
return static_cast<gig::Sample*>(sample); |
return sample; |
|
sample = file->GetNextSample(); |
|
4334 |
} |
} |
4335 |
} else { |
} else { |
4336 |
// use extension files and 32 bit wave pool offsets |
// use extension files and 32 bit wave pool offsets |
4337 |
file_offset_t soughtoffset = file->pWavePoolTable[WavePoolTableIndex]; |
file_offset_t soughtoffset = file->pWavePoolTable[WavePoolTableIndex]; |
4338 |
file_offset_t soughtfileno = file->pWavePoolTableHi[WavePoolTableIndex]; |
file_offset_t soughtfileno = file->pWavePoolTableHi[WavePoolTableIndex]; |
4339 |
Sample* sample = file->GetFirstSample(pProgress); |
size_t i = 0; |
4340 |
while (sample) { |
for (Sample* sample = file->GetSample(i, pProgress); sample; |
4341 |
|
sample = file->GetSample(++i)) |
4342 |
|
{ |
4343 |
if (sample->ullWavePoolOffset == soughtoffset && |
if (sample->ullWavePoolOffset == soughtoffset && |
4344 |
sample->FileNo == soughtfileno) return static_cast<gig::Sample*>(sample); |
sample->FileNo == soughtfileno) return sample; |
|
sample = file->GetNextSample(); |
|
4345 |
} |
} |
4346 |
} |
} |
4347 |
return NULL; |
return NULL; |
5394 |
* @param dst - destination instrument at which this instrument will be |
* @param dst - destination instrument at which this instrument will be |
5395 |
* moved to, or pass NULL for moving to end of list |
* moved to, or pass NULL for moving to end of list |
5396 |
* @throw gig::Exception if this instrument and target instrument are not |
* @throw gig::Exception if this instrument and target instrument are not |
5397 |
* part of the same file |
* part of the same file, as well as on unexpected |
5398 |
|
* internal error |
5399 |
*/ |
*/ |
5400 |
void Instrument::MoveTo(Instrument* dst) { |
void Instrument::MoveTo(Instrument* dst) { |
5401 |
if (dst && GetParent() != dst->GetParent()) |
if (dst && GetParent() != dst->GetParent()) |
5412 |
|
|
5413 |
File::InstrumentList::iterator itFrom = |
File::InstrumentList::iterator itFrom = |
5414 |
std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(this)); |
std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(this)); |
5415 |
|
if (itFrom == list.end()) |
5416 |
|
throw Exception( |
5417 |
|
"gig::Instrument::MoveTo(): unexpected missing membership " |
5418 |
|
"of this instrument." |
5419 |
|
); |
5420 |
|
list.erase(itFrom); |
5421 |
|
|
5422 |
File::InstrumentList::iterator itTo = |
File::InstrumentList::iterator itTo = |
5423 |
std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(dst)); |
std::find(list.begin(), list.end(), static_cast<DLS::Instrument*>(dst)); |
5424 |
|
|
5425 |
list.splice(itTo, list, itFrom); |
list.insert(itTo, this); |
5426 |
} |
} |
5427 |
|
|
5428 |
// move the instrument's actual list RIFF chunk appropriately |
// move the instrument's actual list RIFF chunk appropriately |
6070 |
Group::Group(File* file, RIFF::Chunk* ck3gnm) { |
Group::Group(File* file, RIFF::Chunk* ck3gnm) { |
6071 |
pFile = file; |
pFile = file; |
6072 |
pNameChunk = ck3gnm; |
pNameChunk = ck3gnm; |
6073 |
|
SamplesIterator = 0; |
6074 |
::LoadString(pNameChunk, Name); |
::LoadString(pNameChunk, Name); |
6075 |
} |
} |
6076 |
|
|
6129 |
} |
} |
6130 |
|
|
6131 |
/** |
/** |
6132 |
|
* Returns Sample object at @a index of this sample group. |
6133 |
|
* |
6134 |
|
* @param index - position of sample in this sample group's sample list |
6135 |
|
* (0..n) |
6136 |
|
* @returns sample object or NULL if index is out of bounds |
6137 |
|
*/ |
6138 |
|
Sample* Group::GetSample(size_t index) { |
6139 |
|
if (pFile->pSamples && index >= pFile->pSamples->size()) return NULL; |
6140 |
|
size_t indexInFile = 0; |
6141 |
|
size_t indexInGroup = 0; |
6142 |
|
for (Sample* pSample = pFile->GetSample(indexInFile); pSample; |
6143 |
|
pSample = pFile->GetSample(++indexInFile)) |
6144 |
|
{ |
6145 |
|
if (pSample->GetGroup() != this) continue; |
6146 |
|
if (indexInGroup++ == index) return pSample; |
6147 |
|
} |
6148 |
|
return NULL; |
6149 |
|
} |
6150 |
|
|
6151 |
|
/** |
6152 |
* Returns the first Sample of this Group. You have to call this method |
* Returns the first Sample of this Group. You have to call this method |
6153 |
* once before you use GetNextSample(). |
* once before you use GetNextSample(). |
6154 |
* |
* |
6158 |
* @returns pointer address to first Sample or NULL if there is none |
* @returns pointer address to first Sample or NULL if there is none |
6159 |
* applied to this Group |
* applied to this Group |
6160 |
* @see GetNextSample() |
* @see GetNextSample() |
6161 |
|
* @deprecated This method is not reentrant-safe, use GetSample() |
6162 |
|
* instead. |
6163 |
*/ |
*/ |
6164 |
Sample* Group::GetFirstSample() { |
Sample* Group::GetFirstSample() { |
6165 |
// FIXME: lazy und unsafe implementation, should be an autonomous iterator |
size_t& i = this->SamplesIterator; |
6166 |
for (Sample* pSample = pFile->GetFirstSample(); pSample; pSample = pFile->GetNextSample()) { |
i = 0; |
6167 |
if (pSample->GetGroup() == this) return pSample; |
for (Sample* pSample = pFile->GetSample(i); pSample; |
6168 |
|
pSample = pFile->GetSample(++i)) |
6169 |
|
{ |
6170 |
|
if (pSample->GetGroup() == this) |
6171 |
|
return pSample; |
6172 |
} |
} |
6173 |
return NULL; |
return NULL; |
6174 |
} |
} |
6182 |
* @returns pointer address to the next Sample of this Group or NULL if |
* @returns pointer address to the next Sample of this Group or NULL if |
6183 |
* end reached |
* end reached |
6184 |
* @see GetFirstSample() |
* @see GetFirstSample() |
6185 |
|
* @deprecated This method is not reentrant-safe, use GetSample() |
6186 |
|
* instead. |
6187 |
*/ |
*/ |
6188 |
Sample* Group::GetNextSample() { |
Sample* Group::GetNextSample() { |
6189 |
// FIXME: lazy und unsafe implementation, should be an autonomous iterator |
size_t& i = this->SamplesIterator; |
6190 |
for (Sample* pSample = pFile->GetNextSample(); pSample; pSample = pFile->GetNextSample()) { |
for (Sample* pSample = pFile->GetSample(++i); pSample; |
6191 |
if (pSample->GetGroup() == this) return pSample; |
pSample = pFile->GetSample(++i)) |
6192 |
|
{ |
6193 |
|
if (pSample->GetGroup() == this) |
6194 |
|
return pSample; |
6195 |
} |
} |
6196 |
return NULL; |
return NULL; |
6197 |
} |
} |
6211 |
*/ |
*/ |
6212 |
void Group::MoveAll() { |
void Group::MoveAll() { |
6213 |
// get "that" other group first |
// get "that" other group first |
6214 |
|
size_t i = 0; |
6215 |
Group* pOtherGroup = NULL; |
Group* pOtherGroup = NULL; |
6216 |
for (pOtherGroup = pFile->GetFirstGroup(); pOtherGroup; pOtherGroup = pFile->GetNextGroup()) { |
for (pOtherGroup = pFile->GetGroup(i); pOtherGroup; |
6217 |
|
pOtherGroup = pFile->GetGroup(++i)) |
6218 |
|
{ |
6219 |
if (pOtherGroup != this) break; |
if (pOtherGroup != this) break; |
6220 |
} |
} |
6221 |
if (!pOtherGroup) throw Exception( |
if (!pOtherGroup) throw Exception( |
6223 |
"other Group. This is a bug, report it!" |
"other Group. This is a bug, report it!" |
6224 |
); |
); |
6225 |
// now move all samples of this group to the other group |
// now move all samples of this group to the other group |
6226 |
for (Sample* pSample = GetFirstSample(); pSample; pSample = GetNextSample()) { |
Sample* pSample; |
6227 |
|
while ((pSample = GetSample(0))) { |
6228 |
pOtherGroup->AddSample(pSample); |
pOtherGroup->AddSample(pSample); |
6229 |
} |
} |
6230 |
} |
} |
6296 |
|
|
6297 |
File::~File() { |
File::~File() { |
6298 |
if (pGroups) { |
if (pGroups) { |
6299 |
std::list<Group*>::iterator iter = pGroups->begin(); |
std::vector<Group*>::iterator iter = pGroups->begin(); |
6300 |
std::list<Group*>::iterator end = pGroups->end(); |
std::vector<Group*>::iterator end = pGroups->end(); |
6301 |
while (iter != end) { |
while (iter != end) { |
6302 |
delete *iter; |
delete *iter; |
6303 |
++iter; |
++iter; |
6414 |
|
|
6415 |
SampleList::iterator tmp = SamplesIterator; |
SampleList::iterator tmp = SamplesIterator; |
6416 |
// remove all references to the sample |
// remove all references to the sample |
6417 |
for (Instrument* instrument = GetFirstInstrument() ; instrument ; |
size_t iIns = 0; |
6418 |
instrument = GetNextInstrument()) { |
for (Instrument* instrument = GetInstrument(iIns); instrument; |
6419 |
|
instrument = GetInstrument(++iIns)) |
6420 |
|
{ |
6421 |
size_t iRgn = 0; |
size_t iRgn = 0; |
6422 |
for (Region* region = instrument->GetRegionAt(iRgn); region; |
for (Region* region = instrument->GetRegionAt(iRgn); region; |
6423 |
region = instrument->GetRegionAt(++iRgn)) |
region = instrument->GetRegionAt(++iRgn)) |
6548 |
__notify_progress(pProgress, 1.0); // notify done |
__notify_progress(pProgress, 1.0); // notify done |
6549 |
} |
} |
6550 |
|
|
6551 |
|
/** |
6552 |
|
* Returns a pointer to the first <i>Instrument</i> object of the file, |
6553 |
|
* <i>NULL</i> otherwise. |
6554 |
|
* |
6555 |
|
* @deprecated This method is not reentrant-safe, use GetInstrument() |
6556 |
|
* instead. |
6557 |
|
*/ |
6558 |
Instrument* File::GetFirstInstrument() { |
Instrument* File::GetFirstInstrument() { |
6559 |
if (!pInstruments) LoadInstruments(); |
if (!pInstruments) LoadInstruments(); |
6560 |
if (!pInstruments) return NULL; |
if (!pInstruments) return NULL; |
6562 |
return static_cast<gig::Instrument*>( (InstrumentsIterator != pInstruments->end()) ? *InstrumentsIterator : NULL ); |
return static_cast<gig::Instrument*>( (InstrumentsIterator != pInstruments->end()) ? *InstrumentsIterator : NULL ); |
6563 |
} |
} |
6564 |
|
|
6565 |
|
/** |
6566 |
|
* Returns a pointer to the next <i>Instrument</i> object of the file, |
6567 |
|
* <i>NULL</i> otherwise. |
6568 |
|
* |
6569 |
|
* @deprecated This method is not reentrant-safe, use GetInstrument() |
6570 |
|
* instead. |
6571 |
|
*/ |
6572 |
Instrument* File::GetNextInstrument() { |
Instrument* File::GetNextInstrument() { |
6573 |
if (!pInstruments) return NULL; |
if (!pInstruments) return NULL; |
6574 |
InstrumentsIterator++; |
InstrumentsIterator++; |
6596 |
* @param pProgress - optional: callback function for progress notification |
* @param pProgress - optional: callback function for progress notification |
6597 |
* @returns sought instrument or NULL if there's no such instrument |
* @returns sought instrument or NULL if there's no such instrument |
6598 |
*/ |
*/ |
6599 |
Instrument* File::GetInstrument(uint index, progress_t* pProgress) { |
Instrument* File::GetInstrument(size_t index, progress_t* pProgress) { |
6600 |
if (!pInstruments) { |
if (!pInstruments) { |
6601 |
// TODO: hack - we simply load ALL samples here, it would have been done in the Region constructor anyway (ATM) |
// TODO: hack - we simply load ALL samples here, it would have been done in the Region constructor anyway (ATM) |
6602 |
|
|
6606 |
__divide_progress(pProgress, &subprogress, 3.0f, 0.0f); // randomly schedule 33% for this subtask |
__divide_progress(pProgress, &subprogress, 3.0f, 0.0f); // randomly schedule 33% for this subtask |
6607 |
__notify_progress(&subprogress, 0.0f); |
__notify_progress(&subprogress, 0.0f); |
6608 |
if (GetAutoLoad()) |
if (GetAutoLoad()) |
6609 |
GetFirstSample(&subprogress); // now force all samples to be loaded |
GetSample(0, &subprogress); // now force all samples to be loaded |
6610 |
__notify_progress(&subprogress, 1.0f); |
__notify_progress(&subprogress, 1.0f); |
6611 |
|
|
6612 |
// instrument loading subtask |
// instrument loading subtask |
6620 |
} else { |
} else { |
6621 |
// sample loading subtask |
// sample loading subtask |
6622 |
if (GetAutoLoad()) |
if (GetAutoLoad()) |
6623 |
GetFirstSample(); // now force all samples to be loaded |
GetSample(0); // now force all samples to be loaded |
6624 |
|
|
6625 |
// instrument loading subtask |
// instrument loading subtask |
6626 |
LoadInstruments(); |
LoadInstruments(); |
6627 |
} |
} |
6628 |
} |
} |
6629 |
if (!pInstruments) return NULL; |
if (!pInstruments) return NULL; |
6630 |
InstrumentsIterator = pInstruments->begin(); |
if (index >= pInstruments->size()) return NULL; |
6631 |
for (uint i = 0; InstrumentsIterator != pInstruments->end(); i++) { |
return static_cast<gig::Instrument*>( (*pInstruments)[index] ); |
|
if (i == index) return static_cast<gig::Instrument*>( *InstrumentsIterator ); |
|
|
InstrumentsIterator++; |
|
|
} |
|
|
return NULL; |
|
6632 |
} |
} |
6633 |
|
|
6634 |
/** @brief Add a new instrument definition. |
/** @brief Add a new instrument definition. |
6856 |
} |
} |
6857 |
|
|
6858 |
int File::GetWaveTableIndexOf(gig::Sample* pSample) { |
int File::GetWaveTableIndexOf(gig::Sample* pSample) { |
6859 |
if (!pSamples) GetFirstSample(); // make sure sample chunks were scanned |
if (!pSamples) GetSample(0); // make sure sample chunks were scanned |
6860 |
File::SampleList::iterator iter = pSamples->begin(); |
File::SampleList::iterator iter = pSamples->begin(); |
6861 |
File::SampleList::iterator end = pSamples->end(); |
File::SampleList::iterator end = pSamples->end(); |
6862 |
for (int index = 0; iter != end; ++iter, ++index) |
for (int index = 0; iter != end; ++iter, ++index) |
6876 |
if (!_3crc) return false; |
if (!_3crc) return false; |
6877 |
if (_3crc->GetNewSize() <= 0) return false; |
if (_3crc->GetNewSize() <= 0) return false; |
6878 |
if (_3crc->GetNewSize() % 8) return false; |
if (_3crc->GetNewSize() % 8) return false; |
6879 |
if (!pSamples) GetFirstSample(); // make sure sample chunks were scanned |
if (!pSamples) GetSample(0); // make sure sample chunks were scanned |
6880 |
if (_3crc->GetNewSize() != pSamples->size() * 8) return false; |
if (_3crc->GetNewSize() != pSamples->size() * 8) return false; |
6881 |
|
|
6882 |
const file_offset_t n = _3crc->GetNewSize() / 8; |
const file_offset_t n = _3crc->GetNewSize() / 8; |
6910 |
*/ |
*/ |
6911 |
bool File::RebuildSampleChecksumTable() { |
bool File::RebuildSampleChecksumTable() { |
6912 |
// make sure sample chunks were scanned |
// make sure sample chunks were scanned |
6913 |
if (!pSamples) GetFirstSample(); |
if (!pSamples) GetSample(0); |
6914 |
|
|
6915 |
bool bRequiresSave = false; |
bool bRequiresSave = false; |
6916 |
|
|
6959 |
return bRequiresSave; |
return bRequiresSave; |
6960 |
} |
} |
6961 |
|
|
6962 |
|
/** |
6963 |
|
* Returns a pointer to the first <i>Group</i> object of the file, |
6964 |
|
* <i>NULL</i> otherwise. |
6965 |
|
* |
6966 |
|
* @deprecated This method is not reentrant-safe, use GetGroup() instead. |
6967 |
|
*/ |
6968 |
Group* File::GetFirstGroup() { |
Group* File::GetFirstGroup() { |
6969 |
if (!pGroups) LoadGroups(); |
if (!pGroups) LoadGroups(); |
6970 |
// there must always be at least one group |
// there must always be at least one group |
6972 |
return *GroupsIterator; |
return *GroupsIterator; |
6973 |
} |
} |
6974 |
|
|
6975 |
|
/** |
6976 |
|
* Returns a pointer to the next <i>Group</i> object of the file, |
6977 |
|
* <i>NULL</i> otherwise. |
6978 |
|
* |
6979 |
|
* @deprecated This method is not reentrant-safe, use GetGroup() instead. |
6980 |
|
*/ |
6981 |
Group* File::GetNextGroup() { |
Group* File::GetNextGroup() { |
6982 |
if (!pGroups) return NULL; |
if (!pGroups) return NULL; |
6983 |
++GroupsIterator; |
++GroupsIterator; |
6990 |
* @param index - number of the sought group (0..n) |
* @param index - number of the sought group (0..n) |
6991 |
* @returns sought group or NULL if there's no such group |
* @returns sought group or NULL if there's no such group |
6992 |
*/ |
*/ |
6993 |
Group* File::GetGroup(uint index) { |
Group* File::GetGroup(size_t index) { |
6994 |
if (!pGroups) LoadGroups(); |
if (!pGroups) LoadGroups(); |
6995 |
GroupsIterator = pGroups->begin(); |
if (index >= pGroups->size()) return NULL; |
6996 |
for (uint i = 0; GroupsIterator != pGroups->end(); i++) { |
return (*pGroups)[index]; |
|
if (i == index) return *GroupsIterator; |
|
|
++GroupsIterator; |
|
|
} |
|
|
return NULL; |
|
6997 |
} |
} |
6998 |
|
|
6999 |
/** |
/** |
7008 |
*/ |
*/ |
7009 |
Group* File::GetGroup(String name) { |
Group* File::GetGroup(String name) { |
7010 |
if (!pGroups) LoadGroups(); |
if (!pGroups) LoadGroups(); |
7011 |
GroupsIterator = pGroups->begin(); |
size_t i = 0; |
7012 |
for (uint i = 0; GroupsIterator != pGroups->end(); ++GroupsIterator, ++i) |
for (Group* pGroup = GetGroup(i); pGroup; pGroup = GetGroup(++i)) |
7013 |
if ((*GroupsIterator)->Name == name) return *GroupsIterator; |
if (pGroup->Name == name) return pGroup; |
7014 |
return NULL; |
return NULL; |
7015 |
} |
} |
7016 |
|
|
7034 |
*/ |
*/ |
7035 |
void File::DeleteGroup(Group* pGroup) { |
void File::DeleteGroup(Group* pGroup) { |
7036 |
if (!pGroups) LoadGroups(); |
if (!pGroups) LoadGroups(); |
7037 |
std::list<Group*>::iterator iter = find(pGroups->begin(), pGroups->end(), pGroup); |
std::vector<Group*>::iterator iter = |
7038 |
|
find(pGroups->begin(), pGroups->end(), pGroup); |
7039 |
if (iter == pGroups->end()) throw gig::Exception("Could not delete group, could not find given group"); |
if (iter == pGroups->end()) throw gig::Exception("Could not delete group, could not find given group"); |
7040 |
if (pGroups->size() == 1) throw gig::Exception("Cannot delete group, there must be at least one default group!"); |
if (pGroups->size() == 1) throw gig::Exception("Cannot delete group, there must be at least one default group!"); |
7041 |
// delete all members of this group |
// delete all members of this group |
7042 |
for (Sample* pSample = pGroup->GetFirstSample(); pSample; pSample = pGroup->GetNextSample()) { |
Sample* pSample; |
7043 |
|
while ((pSample = pGroup->GetSample(0))) { |
7044 |
DeleteSample(pSample); |
DeleteSample(pSample); |
7045 |
} |
} |
7046 |
// now delete this group object |
// now delete this group object |
7061 |
*/ |
*/ |
7062 |
void File::DeleteGroupOnly(Group* pGroup) { |
void File::DeleteGroupOnly(Group* pGroup) { |
7063 |
if (!pGroups) LoadGroups(); |
if (!pGroups) LoadGroups(); |
7064 |
std::list<Group*>::iterator iter = find(pGroups->begin(), pGroups->end(), pGroup); |
std::vector<Group*>::iterator iter = |
7065 |
|
find(pGroups->begin(), pGroups->end(), pGroup); |
7066 |
if (iter == pGroups->end()) throw gig::Exception("Could not delete group, could not find given group"); |
if (iter == pGroups->end()) throw gig::Exception("Could not delete group, could not find given group"); |
7067 |
if (pGroups->size() == 1) throw gig::Exception("Cannot delete group, there must be at least one default group!"); |
if (pGroups->size() == 1) throw gig::Exception("Cannot delete group, there must be at least one default group!"); |
7068 |
// move all members of this group to another group |
// move all members of this group to another group |
7073 |
} |
} |
7074 |
|
|
7075 |
void File::LoadGroups() { |
void File::LoadGroups() { |
7076 |
if (!pGroups) pGroups = new std::list<Group*>; |
if (!pGroups) pGroups = new std::vector<Group*>; |
7077 |
// try to read defined groups from file |
// try to read defined groups from file |
7078 |
RIFF::List* lst3gri = pRIFF->GetSubList(LIST_TYPE_3GRI); |
RIFF::List* lst3gri = pRIFF->GetSubList(LIST_TYPE_3GRI); |
7079 |
if (lst3gri) { |
if (lst3gri) { |
7272 |
} |
} |
7273 |
} |
} |
7274 |
|
|
7275 |
std::list<Group*>::iterator iter = pGroups->begin(); |
std::vector<Group*>::iterator iter = pGroups->begin(); |
7276 |
std::list<Group*>::iterator end = pGroups->end(); |
std::vector<Group*>::iterator end = pGroups->end(); |
7277 |
for (; iter != end; ++iter) { |
for (; iter != end; ++iter) { |
7278 |
(*iter)->UpdateChunks(pProgress); |
(*iter)->UpdateChunks(pProgress); |
7279 |
} |
} |
7311 |
uint8_t* pData = (uint8_t*) einf->LoadChunkData(); |
uint8_t* pData = (uint8_t*) einf->LoadChunkData(); |
7312 |
|
|
7313 |
std::map<gig::Sample*,int> sampleMap; |
std::map<gig::Sample*,int> sampleMap; |
7314 |
int sampleIdx = 0; |
size_t sampleIdx = 0; |
7315 |
for (Sample* pSample = GetFirstSample(); pSample; pSample = GetNextSample()) { |
for (Sample* pSample = GetSample(0); pSample; |
7316 |
sampleMap[pSample] = sampleIdx++; |
pSample = GetSample(++sampleIdx)) |
7317 |
|
{ |
7318 |
|
sampleMap[pSample] = sampleIdx; |
7319 |
} |
} |
7320 |
|
|
7321 |
int totnbusedsamples = 0; |
int totnbusedsamples = 0; |
7327 |
|
|
7328 |
memset(&pData[48], 0, sublen - 48); |
memset(&pData[48], 0, sublen - 48); |
7329 |
|
|
7330 |
for (Instrument* instrument = GetFirstInstrument() ; instrument ; |
size_t iIns = 0; |
7331 |
instrument = GetNextInstrument()) { |
for (Instrument* instrument = GetInstrument(iIns); instrument; |
7332 |
|
instrument = GetInstrument(++iIns)) |
7333 |
|
{ |
7334 |
int nbusedsamples = 0; |
int nbusedsamples = 0; |
7335 |
int nbusedchannels = 0; |
int nbusedchannels = 0; |
7336 |
int nbdimregions = 0; |
int nbdimregions = 0; |
7435 |
void File::UpdateFileOffsets() { |
void File::UpdateFileOffsets() { |
7436 |
DLS::File::UpdateFileOffsets(); |
DLS::File::UpdateFileOffsets(); |
7437 |
|
|
7438 |
for (Instrument* instrument = GetFirstInstrument(); instrument; |
size_t i = 0; |
7439 |
instrument = GetNextInstrument()) |
for (Instrument* instrument = GetInstrument(i); instrument; |
7440 |
|
instrument = GetInstrument(++i)) |
7441 |
{ |
{ |
7442 |
instrument->UpdateScriptFileOffsets(); |
instrument->UpdateScriptFileOffsets(); |
7443 |
} |
} |